aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Drawer.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-16 11:18:31 +0200
committerDanilo M. <danix@danix.xyz>2026-10-16 11:18:31 +0200
commit31a6293e982e212ea5136659dcccce271fe37be1 (patch)
treea4e013f5a3298f5af0c7bcea001637423cdc2eac /desktop/Drawer.qml
parentb81fe900056e4c14738d4ceb4e2dfe80ae2e4bff (diff)
downloadquickshell-31a6293e982e212ea5136659dcccce271fe37be1.tar.gz
quickshell-31a6293e982e212ea5136659dcccce271fe37be1.zip
feat(desktop): pages can open other pages and step back to them
Page gains go(name), wired to the drawer's show(). Module gains up, the page back() returns to, empty for the grid as before. The back arrow now calls back() instead of clearing the page itself, so the arrow, Escape and the mouse's back button agree. For the git page, opened from the user page. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Drawer.qml')
-rw-r--r--desktop/Drawer.qml16
1 files changed, 9 insertions, 7 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml
index 27b90fc..7855823 100644
--- a/desktop/Drawer.qml
+++ b/desktop/Drawer.qml
@@ -69,11 +69,12 @@ Scope {
root.open = true;
}
- // One step out: history, then a page, then the drawer itself. Escape
- // and the mouse's back button.
+ // 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
+ // a page's back arrow.
function back() {
if (root.history) root.history = false;
- else if (root.page) root.page = "";
+ else if (root.page) root.page = root.current?.up ?? "";
else root.close();
}
@@ -238,12 +239,13 @@ Scope {
active: root.current !== null
sourceComponent: root.current?.page ?? null
- // The Page's back arrow returns to the grid. Without this
- // the header button is inert, since the page only emits
- // `back` and does not know who hosts it.
+ // The Page's back arrow steps out as Escape does. Without
+ // this the header button is inert, since the page only
+ // emits `back` and does not know who hosts it.
onLoaded: {
- if (item && item.back) item.back.connect(() => root.page = "");
+ if (item && item.back) item.back.connect(root.back);
if (item && item.dismiss) item.dismiss.connect(root.close);
+ if (item && item.go) item.go.connect(root.show);
}
// The page header shows the module's tile glyph. A Binding,