aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Drawer.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/Drawer.qml')
-rw-r--r--desktop/Drawer.qml16
1 files changed, 13 insertions, 3 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml
index 7855823..2151547 100644
--- a/desktop/Drawer.qml
+++ b/desktop/Drawer.qml
@@ -21,6 +21,11 @@ Scope {
// The modules the drawer hosts, in grid order. Set from shell.qml.
property list<QtObject> modules
+ // The settings window, set from shell.qml. A page that lives there is
+ // handed to it rather than shown here (the user page opens git).
+ // Not named `settings`, shell.qml's id for it (it would bind to itself).
+ property var settingsWindow: null
+
// Waybar runs on this screen and the launcher sits at its left end, so
// the drawer belongs here. Falls back to the first screen when this
// monitor is not connected, so the drawer is never invisible.
@@ -62,6 +67,11 @@ Scope {
}
function show(name) {
+ if (root.settingsWindow && root.modules.some(m => m.name === name && m.settings)) {
+ root.close();
+ root.settingsWindow.show(name);
+ return;
+ }
// Deep-linking to a page must leave the history view, or both loaders
// stay active and the later-declared history loader paints on top.
root.history = false;
@@ -69,12 +79,12 @@ Scope {
root.open = true;
}
- // One step out: history, then a page (to its module's `up`, the grid by
- // default), then the drawer itself. Escape, the mouse's back button and
+ // One step out: history, then a page (to the grid), then the drawer
+ // itself. Escape, the mouse's back button and
// a page's back arrow.
function back() {
if (root.history) root.history = false;
- else if (root.page) root.page = root.current?.up ?? "";
+ else if (root.page) root.page = "";
else root.close();
}