picker: non interactive during close anim

This commit is contained in:
2 * r + 2 * t 2025-06-19 15:04:09 +10:00
parent 53cea2beb3
commit 44fefc11b2
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,5 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import Quickshell
import Quickshell.Wayland
@ -8,6 +10,7 @@ Scope {
id: root
property bool freeze
property bool closing
Variants {
model: Quickshell.screens
@ -21,13 +24,18 @@ Scope {
name: "area-picker"
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.keyboardFocus: root.closing ? WlrKeyboardFocus.None : WlrKeyboardFocus.Exclusive
mask: root.closing ? empty : null
anchors.top: true
anchors.bottom: true
anchors.left: true
anchors.right: true
Region {
id: empty
}
Picker {
loader: root
screen: win.modelData
@ -41,11 +49,13 @@ Scope {
function open(): void {
root.freeze = false;
root.closing = false;
root.activeAsync = true;
}
function openFreeze(): void {
root.freeze = true;
root.closing = false;
root.activeAsync = true;
}
}
@ -55,6 +65,7 @@ Scope {
description: "Open screenshot tool"
onPressed: {
root.freeze = false;
root.closing = false;
root.activeAsync = true;
}
}
@ -64,6 +75,7 @@ Scope {
description: "Open screenshot tool (freeze mode)"
onPressed: {
root.freeze = true;
root.closing = false;
root.activeAsync = true;
}
}

View file

@ -94,6 +94,11 @@ MouseArea {
SequentialAnimation {
id: closeAnim
PropertyAction {
target: root.loader
property: "closing"
value: true
}
ParallelAnimation {
Anim {
target: root