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

View file

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