Use common StackView

This commit is contained in:
Yuri Becker
2025-04-03 13:06:37 +02:00
parent f172468ba6
commit 3083406b1b
35 changed files with 131 additions and 277 deletions

View File

@@ -10,10 +10,6 @@ ApplicationWindow {
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);
@@ -30,16 +26,15 @@ ApplicationWindow {
width: Screen.width * .75
Component.onCompleted: {
config.configurationReady.connect(goToLogin);
systray.activated.connect(showWindow);
if (bad_config) {
importDialog.open();
} else {
if (db_con)
appLoader.source = "LoginScreen.qml";
contentStack.replace("LoginScreen.qml")
else
appLoader.source = "NoDbConnection.qml";
contentStack.replace("NoDbConnection.qml");
}
}
onClosing: close => {
@@ -63,7 +58,7 @@ ApplicationWindow {
Navigation {
id: navigation
visible: bad_config || !db_con ? false : true
visible: !(bad_config || !db_con)
}
PrinterDialog {
id: printerDialog
@@ -82,17 +77,15 @@ ApplicationWindow {
id: contentBackground
anchors {
bottom: parent.bottom
left: navigation.right
left: navigation.visible ? navigation.right : parent.left
right: parent.right
top: parent.top
}
color: Colors.background
}
Loader {
id: appLoader
property alias window: appWindow
StackView {
id: contentStack
anchors {
fill: contentBackground
@@ -109,7 +102,7 @@ ApplicationWindow {
title: qsTr("Einstellungen importieren")
onAccepted: settingsFiledialog.open()
onRejected: appLoader.source = "Firststart.qml"
onRejected: contentStack.replace("Firststart.qml")
}
FileDialog {
id: settingsFiledialog