Alisa/native/Main.qml

51 lines
1.1 KiB
QML
Raw Normal View History

2024-07-11 10:49:13 +02:00
import QtQuick 2.15
2024-07-11 10:39:35 +02:00
import QtQuick.Window 2.15
import QtQuick.Layouts 2.15
2024-07-10 15:00:00 +02:00
import QtQuick.Controls 2.15
2024-07-08 16:08:21 +02:00
Window {
2024-07-09 17:50:34 +02:00
SystemPalette { id: activeColors; colorGroup: SystemPalette.Active }
SystemPalette { id: inactiveColors; colorGroup: SystemPalette.Inactive }
SystemPalette { id: disabledColors; colorGroup: SystemPalette.Disabled }
2024-07-09 12:36:14 +02:00
2024-07-09 18:04:57 +02:00
function getColors() {
return root.active ? activeColors : inactiveColors;
}
2024-07-08 16:08:21 +02:00
id: root
width: 640
height: 480
visible: true
2024-07-09 18:04:57 +02:00
color: getColors().window
2024-07-08 16:08:21 +02:00
2024-07-11 11:05:07 +02:00
title: qsTr("Alisa - License Management")
2024-07-08 16:08:21 +02:00
2024-07-11 10:49:13 +02:00
property string authToken: ""
2024-07-10 22:24:28 +02:00
2024-07-11 10:49:13 +02:00
StackView {
id: stackView
anchors.fill: parent
initialItem: loginPageComponent
2024-07-10 12:40:38 +02:00
}
2024-07-09 18:37:01 +02:00
2024-07-11 10:49:13 +02:00
Component {
id: loginPageComponent
LoginScreen {
2024-07-11 11:41:24 +02:00
onLoginSuccess: function(token) {
authToken = token;
stackView.push(mainPageComponent);
2024-07-10 12:40:38 +02:00
}
2024-07-09 18:37:01 +02:00
}
2024-07-08 16:08:21 +02:00
}
2024-07-11 10:02:24 +02:00
2024-07-11 10:49:13 +02:00
Component {
id: mainPageComponent
MainPage {
authToken: authToken
2024-07-11 11:25:08 +02:00
onLogout: {
stackView.push(loginPageComponent)
}
}
}
2024-07-08 16:08:21 +02:00
}