diff options
Diffstat (limited to 'desktop')
| -rw-r--r-- | desktop/Drawer.qml | 16 | ||||
| -rw-r--r-- | desktop/Module.qml | 4 | ||||
| -rw-r--r-- | desktop/Page.qml | 3 |
3 files changed, 16 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, diff --git a/desktop/Module.qml b/desktop/Module.qml index 2ce2939..50b4235 100644 --- a/desktop/Module.qml +++ b/desktop/Module.qml @@ -42,6 +42,10 @@ QtObject { // some other way: the user page opens from the drawer's header row. property bool tiled: true + // The page back() returns to from this module's page. Empty is the grid. + // The git page sets "user", the page it is opened from. + property string up: "" + // Rendered inside the tile, below the icon: a short state line. Null for // a tile that says nothing beyond its label. property Component tileContent: null diff --git a/desktop/Page.qml b/desktop/Page.qml index cb717e8..8365c51 100644 --- a/desktop/Page.qml +++ b/desktop/Page.qml @@ -23,6 +23,9 @@ Item { // Closes the whole drawer, for a page whose action is finished once done // (the clipboard copies and gets out of the way). signal dismiss + // Opens another module's page by name, for a page that links to one (the + // user page opens the git page). + signal go(string name) Item { id: header |
