forked from Shinonome/dots-hyprland
waffles: taskview: esc to close
This commit is contained in:
@@ -40,7 +40,7 @@ Scope {
|
|||||||
|
|
||||||
WlrLayershell.namespace: "quickshell:wTaskView"
|
WlrLayershell.namespace: "quickshell:wTaskView"
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
// WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -54,13 +54,23 @@ Scope {
|
|||||||
id: taskViewContent
|
id: taskViewContent
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
taskViewContent.forceActiveFocus();
|
||||||
|
}
|
||||||
|
Keys.onPressed: event => {
|
||||||
|
if (event.key === Qt.Key_Escape) {
|
||||||
|
GlobalStates.overviewOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: GlobalStates
|
target: GlobalStates
|
||||||
function onOverviewOpenChanged() {
|
function onOverviewOpenChanged() {
|
||||||
if (!GlobalStates.overviewOpen) taskViewContent.close();
|
if (!GlobalStates.overviewOpen)
|
||||||
|
taskViewContent.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClosed: panelLoader.active = false;
|
onClosed: panelLoader.active = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user