Fix up Menu
This commit is contained in:
@@ -2,127 +2,106 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
anchors.top: TopBar.bottom
|
||||
ColumnLayout {
|
||||
anchors.top: Navigation.bottom
|
||||
|
||||
Rectangle
|
||||
{
|
||||
color: "dimgrey"
|
||||
Rectangle {
|
||||
Layout.bottomMargin: 3
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 3
|
||||
color: "dimgrey"
|
||||
radius: 45
|
||||
|
||||
RowLayout
|
||||
{
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle
|
||||
{
|
||||
Rectangle {
|
||||
id: contractButton
|
||||
width: 300
|
||||
height: 145
|
||||
color: "darkslategray"
|
||||
radius: 45
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
border.color: "steelblue"
|
||||
border.width: 1
|
||||
Text
|
||||
{
|
||||
text: qsTr("Aufträge")
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 45
|
||||
font.bold: true
|
||||
color: "lightgoldenrodyellow"
|
||||
}
|
||||
color: "darkslategray"
|
||||
height: 145
|
||||
radius: 45
|
||||
width: 300
|
||||
|
||||
MouseArea
|
||||
{
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
color: "lightgoldenrodyellow"
|
||||
font.bold: true
|
||||
font.pixelSize: 45
|
||||
text: qsTr("Aufträge")
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
onPressed:
|
||||
{
|
||||
contractButton.color = "darkolivegreen"
|
||||
contractButton.border.width = 3
|
||||
contractButton.border.color = "skyblue"
|
||||
console.log("Aufträge...")
|
||||
|
||||
onExited: {
|
||||
contractButton.color = "darkslategray";
|
||||
contractButton.border.color = "steelblue";
|
||||
contractButton.border.width = 1;
|
||||
}
|
||||
|
||||
onReleased:
|
||||
{
|
||||
contractButton.color = "darkslategray"
|
||||
contractButton.border.width = 1
|
||||
contractButton.border.color = "steelblue"
|
||||
onHoveredChanged: {
|
||||
var w = contractButton.border.width === 3 ? 1 : 3;
|
||||
contractButton.border.width = w;
|
||||
}
|
||||
|
||||
onHoveredChanged:
|
||||
{
|
||||
var w = contractButton.border.width === 3? 1: 3
|
||||
contractButton.border.width = w
|
||||
onPressed: {
|
||||
contractButton.color = "darkolivegreen";
|
||||
contractButton.border.width = 3;
|
||||
contractButton.border.color = "skyblue";
|
||||
console.log("Aufträge...");
|
||||
}
|
||||
|
||||
onExited:
|
||||
{
|
||||
|
||||
contractButton.color = "darkslategray"
|
||||
contractButton.border.color = "steelblue"
|
||||
contractButton.border.width = 1
|
||||
onReleased: {
|
||||
contractButton.color = "darkslategray";
|
||||
contractButton.border.width = 1;
|
||||
contractButton.border.color = "steelblue";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
Rectangle {
|
||||
id: offerButton
|
||||
width: 300
|
||||
height: 145
|
||||
color: "darkslategray"
|
||||
radius: 45
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
border.color: "steelblue"
|
||||
border.width: 1
|
||||
Text
|
||||
{
|
||||
text: qsTr("Angebote")
|
||||
color: "darkslategray"
|
||||
height: 145
|
||||
radius: 45
|
||||
width: 300
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 45
|
||||
font.bold: true
|
||||
color: "lightgoldenrodyellow"
|
||||
font.bold: true
|
||||
font.pixelSize: 45
|
||||
text: qsTr("Angebote")
|
||||
}
|
||||
MouseArea
|
||||
{
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
|
||||
onPressed:
|
||||
{
|
||||
offerButton.color = "darkolivegreen"
|
||||
offerButton.border.width = 3
|
||||
offerButton.border.color = "skyblue"
|
||||
console.log("Angebote...")
|
||||
onExited: {
|
||||
offerButton.color = "darkslategray";
|
||||
offerButton.border.color = "steelblue";
|
||||
offerButton.border.width = 1;
|
||||
}
|
||||
onReleased:
|
||||
{
|
||||
offerButton.color = "darkslategray"
|
||||
offerButton.border.width = 1
|
||||
offerButton.border.color = "steelblue"
|
||||
onHoveredChanged: {
|
||||
var w = offerButton.border.width === 3 ? 1 : 3;
|
||||
offerButton.border.width = w;
|
||||
}
|
||||
|
||||
onHoveredChanged:
|
||||
{
|
||||
var w = offerButton.border.width === 3? 1: 3
|
||||
offerButton.border.width = w
|
||||
onPressed: {
|
||||
offerButton.color = "darkolivegreen";
|
||||
offerButton.border.width = 3;
|
||||
offerButton.border.color = "skyblue";
|
||||
console.log("Angebote...");
|
||||
}
|
||||
|
||||
onExited:
|
||||
{
|
||||
|
||||
offerButton.color = "darkslategray"
|
||||
offerButton.border.color = "steelblue"
|
||||
offerButton.border.width = 1
|
||||
onReleased: {
|
||||
offerButton.color = "darkslategray";
|
||||
offerButton.border.width = 1;
|
||||
offerButton.border.color = "steelblue";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
ColumnLayout {
|
||||
id: topBar
|
||||
|
||||
height: parent.height
|
||||
spacing: 0
|
||||
|
||||
@@ -14,18 +12,12 @@ ColumnLayout {
|
||||
}
|
||||
ButtonGroup {
|
||||
id: buttonBar
|
||||
|
||||
}
|
||||
BarButton {
|
||||
id: dashBoard
|
||||
|
||||
ButtonGroup.group: buttonBar
|
||||
Layout.margins: 3
|
||||
Layout.topMargin: Dimensions.s
|
||||
flat: true
|
||||
icon.source: "qrc:/images/dash.svg"
|
||||
implicitHeight: 90
|
||||
implicitWidth: 90
|
||||
text: qsTr("Dashboard")
|
||||
|
||||
onClicked: {
|
||||
@@ -36,11 +28,7 @@ ColumnLayout {
|
||||
id: kunden
|
||||
|
||||
ButtonGroup.group: buttonBar
|
||||
Layout.margins: 3
|
||||
flat: true
|
||||
icon.source: "qrc:/images/customer.svg"
|
||||
implicitHeight: 90
|
||||
implicitWidth: 90
|
||||
text: qsTr("Kunden")
|
||||
|
||||
onClicked: {
|
||||
@@ -51,11 +39,7 @@ ColumnLayout {
|
||||
id: objekt
|
||||
|
||||
ButtonGroup.group: buttonBar
|
||||
Layout.margins: 3
|
||||
flat: true
|
||||
icon.source: "qrc:/images/object.svg"
|
||||
implicitHeight: 90
|
||||
implicitWidth: 90
|
||||
text: qsTr("Objekt")
|
||||
|
||||
onClicked: {
|
||||
@@ -66,11 +50,7 @@ ColumnLayout {
|
||||
id: mitarbeiter
|
||||
|
||||
ButtonGroup.group: buttonBar
|
||||
Layout.margins: 3
|
||||
flat: true
|
||||
icon.source: "qrc:/images/employee.svg"
|
||||
implicitHeight: 90
|
||||
implicitWidth: 90
|
||||
text: qsTr("Mitarbeiter")
|
||||
|
||||
onClicked: {
|
||||
@@ -81,11 +61,7 @@ ColumnLayout {
|
||||
id: offers
|
||||
|
||||
ButtonGroup.group: buttonBar
|
||||
Layout.margins: 3
|
||||
flat: true
|
||||
icon.source: "qrc:/images/offer.svg"
|
||||
implicitHeight: 90
|
||||
implicitWidth: 90
|
||||
text: qsTr("Angebote")
|
||||
|
||||
onClicked: {
|
||||
@@ -96,11 +72,7 @@ ColumnLayout {
|
||||
id: abrechnung
|
||||
|
||||
ButtonGroup.group: buttonBar
|
||||
Layout.margins: 3
|
||||
flat: true
|
||||
icon.source: "qrc:/images/invoice.svg"
|
||||
implicitHeight: 90
|
||||
implicitWidth: 90
|
||||
text: qsTr("Abrechnung")
|
||||
}
|
||||
Item {
|
||||
219
Gui/main.qml
219
Gui/main.qml
@@ -4,173 +4,148 @@ import QtQuick.Controls
|
||||
import QtQuick.Dialogs
|
||||
import QtCore
|
||||
|
||||
ApplicationWindow
|
||||
{
|
||||
ApplicationWindow {
|
||||
id: appWindow
|
||||
width: Screen.width * .75
|
||||
height: Screen.height * .85
|
||||
visible: true
|
||||
title: "TERO Personal"
|
||||
font: Typography.body
|
||||
color: Colors.mantle
|
||||
|
||||
property string confile: ""
|
||||
property alias settingsFileDialog: settingsFiledialog
|
||||
|
||||
function goToLogin() {
|
||||
appLoader.source = "LoginScreen.qml";
|
||||
navigation.visible = true;
|
||||
}
|
||||
function showWindow(why) {
|
||||
if (why === 3) {
|
||||
systray.setVisible(false);
|
||||
appWindow.show();
|
||||
}
|
||||
}
|
||||
|
||||
color: Colors.mantle
|
||||
font: Typography.body
|
||||
height: Screen.height * .85
|
||||
palette.text: Colors.foreground
|
||||
title: "TERO Personal"
|
||||
visible: true
|
||||
width: Screen.width * .75
|
||||
|
||||
Component.onCompleted: {
|
||||
config.configurationReady.connect(goToLogin);
|
||||
systray.activated.connect(showWindow);
|
||||
|
||||
TopBar
|
||||
{
|
||||
id:topBar
|
||||
visible: bad_config || !db_con ? false: true
|
||||
if (bad_config) {
|
||||
importDialog.open();
|
||||
} else {
|
||||
if (db_con)
|
||||
appLoader.source = "LoginScreen.qml";
|
||||
else
|
||||
appLoader.source = "NoDbConnection.qml";
|
||||
}
|
||||
}
|
||||
onClosing: close => {
|
||||
if (false) {
|
||||
console.log("Main window closed!! Was soll ich tun? kann ich mich beenden?!");
|
||||
}
|
||||
}
|
||||
onVisibilityChanged: {
|
||||
if (appWindow.visibility === Window.Minimized && config.systray()) {
|
||||
systray.setVisible(true);
|
||||
appWindow.hide();
|
||||
}
|
||||
}
|
||||
onWindowStateChanged: windowState => {
|
||||
if (windowState !== Qt.WindowMinimized) {
|
||||
systray.setVisible(false);
|
||||
appWindow.show();
|
||||
}
|
||||
}
|
||||
|
||||
PrinterDialog
|
||||
{
|
||||
Navigation {
|
||||
id: navigation
|
||||
|
||||
visible: bad_config || !db_con ? false : true
|
||||
}
|
||||
PrinterDialog {
|
||||
id: printerDialog
|
||||
}
|
||||
|
||||
ReadMe
|
||||
{
|
||||
}
|
||||
ReadMe {
|
||||
id: readMeWin
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
}
|
||||
Item {
|
||||
id: mainView
|
||||
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: appLoader
|
||||
|
||||
anchors
|
||||
{
|
||||
left: topBar.right
|
||||
Rectangle {
|
||||
id: contentBackground
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: navigation.right
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
|
||||
|
||||
|
||||
topMargin: Dimensions.l
|
||||
bottomMargin: Dimensions.l
|
||||
rightMargin: Dimensions.l
|
||||
leftMargin: Dimensions.l
|
||||
|
||||
}
|
||||
color: Colors.background
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: appLoader
|
||||
|
||||
property alias window: appWindow
|
||||
|
||||
anchors {
|
||||
fill: contentBackground
|
||||
margins: Dimensions.l
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Dialog
|
||||
{
|
||||
Dialog {
|
||||
id: importDialog
|
||||
modal: true
|
||||
|
||||
anchors.centerIn: parent
|
||||
modal: true
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
onAccepted: settingsFiledialog.open()
|
||||
onRejected: appLoader.source= "Firststart.qml"
|
||||
title: qsTr("Einstellungen importieren")
|
||||
|
||||
onAccepted: settingsFiledialog.open()
|
||||
onRejected: appLoader.source = "Firststart.qml"
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
|
||||
FileDialog {
|
||||
id: settingsFiledialog
|
||||
title: qsTr("PYQCRM Einstellungen")
|
||||
|
||||
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
||||
modality: "ApplicationModal"
|
||||
nameFilters: [qsTr("PYQCRM Einstellungen (*.pyqrec)")]
|
||||
onAccepted:
|
||||
{
|
||||
exportFilePassword.open()
|
||||
confile = selectedFile
|
||||
title: qsTr("PYQCRM Einstellungen")
|
||||
|
||||
onAccepted: {
|
||||
exportFilePassword.open();
|
||||
confile = selectedFile;
|
||||
}
|
||||
}
|
||||
|
||||
Dialog
|
||||
{
|
||||
Dialog {
|
||||
id: exportFilePassword
|
||||
modal: true
|
||||
title: qsTr("PYQCRM Einstellungen")
|
||||
|
||||
anchors.centerIn: parent
|
||||
modal: true
|
||||
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||
title: qsTr("PYQCRM Einstellungen")
|
||||
|
||||
onAccepted: config.importConfig(confile, exportPasswordInput.text)
|
||||
ColumnLayout
|
||||
{
|
||||
RowLayout
|
||||
{
|
||||
Label
|
||||
{
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
Label {
|
||||
text: qsTr("Passwort eingeben:")
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
TextField {
|
||||
id: exportPasswordInput
|
||||
|
||||
echoMode: TextInput.Password
|
||||
implicitWidth: 300
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
config.configurationReady.connect(goToLogin)
|
||||
systray.activated.connect(showWindow)
|
||||
|
||||
if(bad_config)
|
||||
{
|
||||
importDialog.open()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (db_con) appLoader.source= "LoginScreen.qml"
|
||||
else appLoader.source= "NoDbConnection.qml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showWindow(why)
|
||||
{
|
||||
if (why === 3)
|
||||
{
|
||||
systray.setVisible(false)
|
||||
appWindow.show()
|
||||
}
|
||||
}
|
||||
onVisibilityChanged:
|
||||
{
|
||||
if (appWindow.visibility === Window.Minimized && config.systray())
|
||||
{
|
||||
systray.setVisible(true)
|
||||
appWindow.hide()
|
||||
}
|
||||
}
|
||||
|
||||
onWindowStateChanged: (windowState) =>
|
||||
{
|
||||
if (windowState !== Qt.WindowMinimized)
|
||||
{
|
||||
systray.setVisible(false)
|
||||
appWindow.show()
|
||||
}
|
||||
}
|
||||
|
||||
onClosing: (close) =>
|
||||
{
|
||||
if (false)
|
||||
{
|
||||
console.log("Main window closed!! Was soll ich tun? kann ich mich beenden?!")
|
||||
}
|
||||
}
|
||||
|
||||
function goToLogin()
|
||||
{
|
||||
appLoader.source= "LoginScreen.qml"
|
||||
topBar.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
module gui
|
||||
TopBar 1.0 TopBar.qml
|
||||
TopBar 1.0 Navigation.qml
|
||||
|
||||
Reference in New Issue
Block a user