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

@ -12,13 +12,8 @@ import QtQuick.Controls
Rectangle {
id: root
focus: true
color: Colors.barBg
radius: Config.cfg.appearance.rounding
Keys.onEscapePressed: event => {
win.visible = false;
event.accepted = true;
}
implicitWidth: audioLayout.implicitWidth + 10
implicitHeight: audioLayout.implicitHeight + 10

View file

@ -11,7 +11,6 @@ Rectangle {
color: "transparent"
Rectangle {
id: container
focus: true
anchors.fill: parent
color: Colors.base02
radius: Config.cfg.appearance.rounding

View file

@ -34,9 +34,9 @@ Variants {
event.accepted = true;
}
VolPopup {
z: 1
id: volPopup
property bool shown: WidgetTracker.current === "volume"
z: 1
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
}
}
}
}