sidebar esc to close

This commit is contained in:
end-4
2025-04-14 12:59:52 +02:00
parent ab04d1e10d
commit ab81e79eec
5 changed files with 54 additions and 7 deletions
@@ -21,6 +21,7 @@ Scope {
PanelWindow {
id: sidebarRoot
visible: false
focusable: true
property var modelData
@@ -36,6 +37,12 @@ Scope {
bottom: true
}
HyprlandFocusGrab {
active: sidebarRoot.visible
id: grab
windows: [ sidebarRoot ]
}
// Background
Rectangle {
id: sidebarRightBackground
@@ -45,6 +52,14 @@ Scope {
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
color: Appearance.colors.colLayer0
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
focus: true
Keys.onPressed: {
if (event.key === Qt.Key_Escape) {
sidebarRoot.visible = false;
event.accepted = true; // Prevent further propagation of the event
}
}
}
// Shadow