diff --git a/gui/Dashboard.qml b/gui/Dashboard.qml new file mode 100644 index 0000000..b78908c --- /dev/null +++ b/gui/Dashboard.qml @@ -0,0 +1,15 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +ColumnLayout +{ + Item + { + Component.onCompleted: + { + appLoader.source = "firststart.qml" + appLoader.window.title = "pyqcrm" + } + } +} diff --git a/gui/Start.qml b/gui/Start.qml deleted file mode 100644 index a294828..0000000 --- a/gui/Start.qml +++ /dev/null @@ -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 - - } - - -} diff --git a/gui/Tables.qml b/gui/Tables.qml new file mode 100644 index 0000000..54d7e07 --- /dev/null +++ b/gui/Tables.qml @@ -0,0 +1,6 @@ +import QtQuick + +Item { + text: "tables" + +} diff --git a/gui/TopBar.qml b/gui/TopBar.qml index 190de4a..7d546da 100644 --- a/gui/TopBar.qml +++ b/gui/TopBar.qml @@ -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 + } + } diff --git a/gui/firststart.qml b/gui/firststart.qml index ffd175a..4b946c6 100644 --- a/gui/firststart.qml +++ b/gui/firststart.qml @@ -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 } } } diff --git a/gui/main.qml b/gui/main.qml index 6a95605..721ed59 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -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 } - - } diff --git a/images/menu.svg b/images/menu.svg new file mode 100644 index 0000000..81b3e4e --- /dev/null +++ b/images/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pyqcrm.pyproject b/pyqcrm.pyproject index 9068891..81632d6 100644 --- a/pyqcrm.pyproject +++ b/pyqcrm.pyproject @@ -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" ] }