aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Drawer.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/Drawer.qml')
-rw-r--r--desktop/Drawer.qml20
1 files changed, 10 insertions, 10 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml
index 368f249..f3b8e6d 100644
--- a/desktop/Drawer.qml
+++ b/desktop/Drawer.qml
@@ -41,7 +41,7 @@ Scope {
}
function show(name) {
- root.page = name ?? "";
+ root.page = root.modules.some(m => m.name === name) ? name : "";
root.open = true;
}
@@ -94,15 +94,6 @@ Scope {
// Keys reach a focused item, never the window: setting
// keyboardFocus above is necessary but not sufficient, and
// Keys.onEscapePressed on a PanelWindow never fires. See AGENTS.md.
- Item {
- anchors.fill: parent
- focus: true
- Keys.onEscapePressed: {
- if (root.page) root.page = "";
- else root.close();
- }
- }
-
Rectangle {
id: panel
anchors { top: parent.top; left: parent.left; bottom: parent.bottom }
@@ -113,6 +104,15 @@ Scope {
border.width: 1
border.color: Qt.alpha(Theme.text, 0.12)
+ // The panel is that focused item. As the ancestor of the page
+ // content, a key pressed in any focused descendant bubbles up
+ // to it.
+ focus: true
+ Keys.onEscapePressed: {
+ if (root.page) root.page = "";
+ else root.close();
+ }
+
// Clicks on the panel must not reach the catcher behind it.
MouseArea { anchors.fill: parent }