diff options
Diffstat (limited to 'desktop/Drawer.qml')
| -rw-r--r-- | desktop/Drawer.qml | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml index 3a862ba..b39da1f 100644 --- a/desktop/Drawer.qml +++ b/desktop/Drawer.qml @@ -30,8 +30,8 @@ Scope { // Which module's page is showing. Empty means the grid. property string page: "" - // Set by NotificationList's History button. Task 5 reads this to show the - // history view; nothing consumes it yet. + // Set by NotificationList's History button and read by the history view + // loader below; reset when the drawer closes. property bool history: false // The balloons read this to stand down while the drawer holds the space. @@ -70,6 +70,7 @@ Scope { // Reset to the grid: a panel that reopens somewhere unexpected is // worse than one extra click. root.page = ""; + root.history = false; } function toggle(name) { @@ -129,7 +130,8 @@ Scope { // to it. focus: true Keys.onEscapePressed: { - if (root.page) root.page = ""; + if (root.history) root.history = false; + else if (root.page) root.page = ""; else root.close(); } @@ -141,7 +143,7 @@ Scope { Item { anchors.fill: parent anchors.margins: 16 - visible: root.page === "" + visible: root.page === "" && !root.history // The notification engine's space. The live queue lists // here while the drawer is open; the balloons stand down @@ -215,6 +217,22 @@ Scope { } Behavior on opacity { NumberAnimation { duration: 160 } } } + + // --- history view --- + + Loader { + id: historyLoader + anchors.fill: parent + anchors.margins: 16 + active: root.history + sourceComponent: Component { + Page { + title: "History" + NotificationHistory { width: parent.width } + } + } + onLoaded: if (item && item.back) item.back.connect(() => root.history = false) + } } } } |
