quickshell: remove grabFocus, animate close on clock click
Wayland popup protocol prevents re-showing dismissed popups. Remove grabFocus and toggle open/close via clock click only, allowing the slide-up animation to play on close. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
25856f114f
commit
96566d0319
1 changed files with 4 additions and 13 deletions
|
|
@ -518,11 +518,10 @@ in
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (calPopup.visible && !calPopup.closing) {
|
if (calPopup.visible) {
|
||||||
calPopup.closing = true;
|
|
||||||
calPopup.open = false;
|
calPopup.open = false;
|
||||||
calCloseTimer.start();
|
calCloseTimer.start();
|
||||||
} else if (!calPopup.visible) {
|
} else {
|
||||||
calPopup.visible = true;
|
calPopup.visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -531,7 +530,7 @@ in
|
||||||
Timer {
|
Timer {
|
||||||
id: calCloseTimer
|
id: calCloseTimer
|
||||||
interval: 230
|
interval: 230
|
||||||
onTriggered: { calPopup.closing = false; calPopup.visible = false; }
|
onTriggered: calPopup.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -837,12 +836,10 @@ in
|
||||||
anchor.edges: Edges.Top | Edges.Left
|
anchor.edges: Edges.Top | Edges.Left
|
||||||
anchor.gravity: Edges.Bottom | Edges.Right
|
anchor.gravity: Edges.Bottom | Edges.Right
|
||||||
anchor.adjustment: PopupAdjustment.Slide
|
anchor.adjustment: PopupAdjustment.Slide
|
||||||
grabFocus: true
|
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
property bool open: false
|
property bool open: false
|
||||||
property bool closing: false
|
|
||||||
property real fullWidth: calCol.width + 32
|
property real fullWidth: calCol.width + 32
|
||||||
property real fullHeight: calCol.height + 24
|
property real fullHeight: calCol.height + 24
|
||||||
|
|
||||||
|
|
@ -851,13 +848,7 @@ in
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (!closing) open = true;
|
open = true;
|
||||||
} else if (open && !closing) {
|
|
||||||
// grabFocus hid us — re-show and animate closed
|
|
||||||
closing = true;
|
|
||||||
visible = true;
|
|
||||||
open = false;
|
|
||||||
calCloseTimer.start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue