fixedloader

This commit is contained in:
2024-11-05 16:26:14 +01:00
parent 4ecec8e25b
commit 493270efc1
8 changed files with 68 additions and 132 deletions

15
gui/Dashboard.qml Normal file
View File

@@ -0,0 +1,15 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
ColumnLayout
{
Item
{
Component.onCompleted:
{
appLoader.source = "firststart.qml"
appLoader.window.title = "pyqcrm"
}
}
}

View File

@@ -1,23 +0,0 @@
import QtQuick
import QtQuick.Controls
Item
{
anchors.fill: parent
TopBar
{
id:topBar
}
Component.onCompleted:
{
appLoader.window.title = "PYQCRM"
appLoader.window.height = Screen.height * .5
appLoader.window.width = Screen.width * .5
}
}

6
gui/Tables.qml Normal file
View File

@@ -0,0 +1,6 @@
import QtQuick
Item {
text: "tables"
}

View File

@@ -1,19 +1,11 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Controls.Material
// Item
// {
// id: topBar
// anchors
// {
// top: parent.top
// left: parent.left
// right: parent.right
// }
// height: 30
RowLayout
{
@@ -33,107 +25,40 @@ import QtQuick.Controls.Material
Button
{
id: dashBoard
implicitWidth: 85
hoverEnabled: true
highlighted: true
flat: true
background: Rectangle
{
color: dashBoard.down? Material.Grey: Material.background
border.color: dashBoard.hovered? Material.Amber: "transparent"
radius: 0
}
Text
{
text: "Dashboard"
anchors.centerIn: parent
color: Material.accent
}
text: qsTr("Dashboard")
}
Button
{
id: kunden
implicitWidth: 85
hoverEnabled: true
highlighted: true
flat: true
background: Rectangle
text: qsTr("Kunden")
onClicked:
{
color: kunden.down? Material.Grey: Material.background
border.color: kunden.hovered? Material.Amber: "transparent"
radius: 0
}
Text
{
text: "Kunden"
anchors.centerIn: parent
color: Material.accent
appLoader.source = "Tables.qml"
}
}
Button
{
id: objekt
implicitWidth: 85
hoverEnabled: true
highlighted: true
flat: true
background: Rectangle
{
color: objekt.down? Material.Grey: Material.background
border.color: objekt.hovered? Material.Amber: "transparent"
radius: 0
}
Text
{
text: "Objekt"
anchors.centerIn: parent
color: Material.accent
}
text: qsTr("Objekt")
}
Button
{
id: mitarbeiter
implicitWidth: 85
hoverEnabled: true
highlighted: true
flat: true
background: Rectangle
{
color: mitarbeiter.down? Material.Grey: Material.background
border.color: mitarbeiter.hovered? Material.Amber: "transparent"
radius: 0
}
Text
{
text: "Mitarbeiter"
anchors.centerIn: parent
color: Material.accent
}
text: qsTr("Mitarbeiter")
}
Button
{
id: abrechnung
implicitWidth: 85
hoverEnabled: true
background: Rectangle
{
color: abrechnung.down? Material.Grey: Material.background
border.color: abrechnung.hovered? Material.Amber: "transparent"
radius: 0
}
Text
{
text: "Abrechnung"
anchors.centerIn: parent
color: Material.accent
}
flat: true
text: qsTr("Abrechnung")
}
Item
@@ -142,12 +67,15 @@ import QtQuick.Controls.Material
Layout.fillWidth: true
}
Image
Button
{
id: atajos
source: "../images/menu.png"
sourceSize.height: 35
icon.source: "../images/menu.svg"
icon.color: "red"
flat: true
}
}

View File

@@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material
import "../js/qmldict.js" as Qmldict
@@ -242,7 +242,9 @@ Item
if (pyqcrm_conf)
{
config.setConfig(pyqcrm_conf)
appLoader.source = "Start.qml"
appLoader.source = "Dashboard.qml"
topBar.visible = true
}
}
}

View File

@@ -1,6 +1,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
ApplicationWindow
@@ -9,25 +9,31 @@ ApplicationWindow
width: Screen.width * .6
height: Screen.height * .6
visible: true
Material.theme: Material.Dark
Material.accent: Material.BlueGrey
Material.primary: Material.Grey
title: "PYQCRM"
TopBar
{
id:topBar
visible: if (bad_config) visible = false
}
Item
{
id: mainView
}
Loader
{
id: appLoader
anchors.fill: parent
// {
// left: parent.left
// right: parent.right
// top: parent.top
// bottom: parent.bottom
// }
source: bad_config? "firststart.qml":"Start.qml"
anchors
{
left: parent.left
right: parent.right
top: topBar.bottom
bottom: parent.bottom
}
source: bad_config? "firststart.qml":"Dashboard.qml"
property alias window: appWindow
}
}

1
images/menu.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg>

After

Width:  |  Height:  |  Size: 193 B

View File

@@ -5,9 +5,10 @@
"lib/__init__.py",
"main.py",
"gui/main.qml",
"gui/Start.qml",
"gui/Dashboard.qml",
"js/qmldict.js",
"lib/Vermasseln.py",
"gui/TopBar.qml"
"gui/TopBar.qml",
"gui/Tables.qml"
]
}