mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-22 03:28:52 +00:00
parent
e94554b209
commit
d5317a91ba
@ -1,5 +1,6 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include "cachecleaner.h"
|
||||
#include "directorieswatcher.h"
|
||||
@ -42,6 +43,9 @@ int main(int argc, char *argv[])
|
||||
for (const auto& path : additionalImportPaths)
|
||||
engine.addImportPath(path);
|
||||
|
||||
engine.rootContext()->setContextProperty(
|
||||
"pagesFolder", QML_IMPORT_ROOT + QStringLiteral("/pages"));
|
||||
|
||||
qmlRegisterType<FigmaDecoratorModel>("Storybook", 1, 0, "FigmaDecoratorModel");
|
||||
qmlRegisterType<FigmaLinksSource>("Storybook", 1, 0, "FigmaLinksSource");
|
||||
qmlRegisterType<PagesModelInitialized>("Storybook", 1, 0, "PagesModel");
|
||||
|
@ -102,59 +102,71 @@ ApplicationWindow {
|
||||
SplitView {
|
||||
anchors.fill: parent
|
||||
|
||||
Pane {
|
||||
ColumnLayout {
|
||||
SplitView.preferredWidth: 270
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
Pane {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
Button {
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
text: "Settings"
|
||||
Button {
|
||||
Layout.fillWidth: true
|
||||
|
||||
onClicked: settingsPopup.open()
|
||||
}
|
||||
text: "Settings"
|
||||
|
||||
CheckBox {
|
||||
id: darkModeCheckBox
|
||||
onClicked: settingsPopup.open()
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
CheckBox {
|
||||
id: darkModeCheckBox
|
||||
|
||||
text: "Dark mode"
|
||||
Layout.fillWidth: true
|
||||
|
||||
StatusLightTheme { id: lightTheme }
|
||||
StatusDarkTheme { id: darkTheme }
|
||||
text: "Dark mode"
|
||||
|
||||
Binding {
|
||||
target: Theme
|
||||
property: "palette"
|
||||
value: darkModeCheckBox.checked ? darkTheme : lightTheme
|
||||
StatusLightTheme { id: lightTheme }
|
||||
StatusDarkTheme { id: darkTheme }
|
||||
|
||||
Binding {
|
||||
target: Theme
|
||||
property: "palette"
|
||||
value: darkModeCheckBox.checked ? darkTheme : lightTheme
|
||||
}
|
||||
}
|
||||
|
||||
HotReloaderControls {
|
||||
id: hotReloaderControls
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
onForceReloadClicked: reloader.forceReload()
|
||||
}
|
||||
|
||||
MenuSeparator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
FilteredPagesList {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
currentPage: root.currentPage
|
||||
model: pagesModel
|
||||
|
||||
onPageSelected: root.currentPage = page
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HotReloaderControls {
|
||||
id: hotReloaderControls
|
||||
Button {
|
||||
Layout.fillWidth: true
|
||||
text: "Open pages directory"
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
onForceReloadClicked: reloader.forceReload()
|
||||
}
|
||||
|
||||
MenuSeparator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
FilteredPagesList {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
currentPage: root.currentPage
|
||||
model: pagesModel
|
||||
|
||||
onPageSelected: root.currentPage = page
|
||||
}
|
||||
onClicked: Qt.openUrlExternally(Qt.resolvedUrl(pagesFolder))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user