add animations to popup

This commit is contained in:
lucy 2026-08-28 18:16:05 +02:00
commit 077e0bf4d5
3 changed files with 21 additions and 15 deletions

View file

@ -28,15 +28,15 @@ Variants {
WlrLayershell.keyboardFocus: shown ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
Item {
anchors.fill: parent
focus: true
focus: true
Keys.onEscapePressed: event => {
WidgetTracker.close();
event.accepted = true;
}
VolPopup {
id: volPopup
z: 1
id: volPopup
property bool shown: WidgetTracker.current === "volume"
property bool shown: root.shown && WidgetTracker.current === "volume"
opacity: shown ? 1 : 0
visible: opacity > 0
anchors.right: parent.right
@ -60,19 +60,31 @@ Variants {
}
}
WallPicker {
id: wallpapers
z: 1
property bool shown: root.shown && WidgetTracker.current === "wallpapers"
opacity: shown ? 1 : 0
visible: opacity > 0
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 20
implicitWidth: 1000
implicitHeight: 200
visible: WidgetTracker.current === "wallpapers"
Behavior on visible {
PropertyAnimation {
duration: 350
easing.type: Easing.InOutBack
easing.overshoot: 1.2
Behavior on opacity {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
transform: Translate {
y: wallpapers.shown ? 0 : 12
Behavior on y {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
}