waffles: taskview: esc to close

This commit is contained in:
end-4
2025-12-15 00:31:10 +01:00
parent 70363ab886
commit 60b2225cc6
@@ -40,7 +40,7 @@ Scope {
WlrLayershell.namespace: "quickshell:wTaskView"
WlrLayershell.layer: WlrLayer.Overlay
// WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
color: "transparent"
anchors {
@@ -54,13 +54,23 @@ Scope {
id: taskViewContent
anchors.fill: parent
Component.onCompleted: {
taskViewContent.forceActiveFocus();
}
Keys.onPressed: event => {
if (event.key === Qt.Key_Escape) {
GlobalStates.overviewOpen = false;
}
}
Connections {
target: GlobalStates
function onOverviewOpenChanged() {
if (!GlobalStates.overviewOpen) taskViewContent.close();
if (!GlobalStates.overviewOpen)
taskViewContent.close();
}
}
onClosed: panelLoader.active = false;
onClosed: panelLoader.active = false
}
}
}