2022-10-04 20:25:14 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
2022-10-14 08:29:36 +00:00
|
|
|
import QtQuick.Layouts 1.14
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
import Qt.labs.settings 1.0
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import Storybook 1.0
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
ApplicationWindow {
|
2022-10-14 08:29:36 +00:00
|
|
|
id: root
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
width: 1450
|
|
|
|
height: 840
|
|
|
|
visible: true
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
property string currentPage
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
font.pixelSize: 13
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: pagesModel
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
ListElement {
|
|
|
|
title: "CommunitiesPortalLayout"
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
ListElement {
|
|
|
|
title: "LoginView"
|
|
|
|
}
|
2022-10-13 19:02:40 +00:00
|
|
|
ListElement {
|
|
|
|
title: "AboutView"
|
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
}
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
SplitView {
|
|
|
|
anchors.fill: parent
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
ColumnLayout {
|
|
|
|
SplitView.preferredWidth: 240
|
2022-10-04 21:51:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
CheckBox {
|
|
|
|
id: loadAsyncCheckBox
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
text: "Load asynchronously"
|
|
|
|
}
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
CheckBox {
|
|
|
|
id: darkModeCheckBox
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
text: "Dark mode"
|
|
|
|
|
|
|
|
StatusLightTheme { id: lightTheme }
|
|
|
|
StatusDarkTheme { id: darkTheme }
|
|
|
|
|
|
|
|
Binding {
|
|
|
|
target: Theme
|
|
|
|
property: "palette"
|
|
|
|
value: darkModeCheckBox.checked ? darkTheme : lightTheme
|
2022-10-12 09:42:51 +00:00
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
}
|
2022-10-12 09:42:51 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
Pane {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
PagesList {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
currentPage: root.currentPage
|
|
|
|
model: pagesModel
|
|
|
|
|
|
|
|
onPageSelected: root.currentPage = page
|
2022-10-04 21:51:14 +00:00
|
|
|
}
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
Item {
|
|
|
|
SplitView.fillWidth: true
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: viewLoader
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
clip: true
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
source: Qt.resolvedUrl(`./pages/${root.currentPage}Page.qml`)
|
|
|
|
asynchronous: loadAsyncCheckBox.checked
|
2022-10-12 11:02:37 +00:00
|
|
|
visible: status === Loader.Ready
|
|
|
|
|
|
|
|
// force reload when `asynchronous` changes
|
|
|
|
onAsynchronousChanged: {
|
2022-10-14 08:29:36 +00:00
|
|
|
active = false
|
|
|
|
active = true
|
2022-10-12 11:02:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BusyIndicator {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: viewLoader.status === Loader.Loading
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
2022-10-14 08:29:36 +00:00
|
|
|
property alias currentPage: root.currentPage
|
|
|
|
property alias loadAsynchronously: loadAsyncCheckBox.checked
|
|
|
|
property alias darkMode: darkModeCheckBox.checked
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
|
|
|
}
|