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 { Rectangle {
id: root id: root
focus: true
color: Colors.barBg color: Colors.barBg
radius: Config.cfg.appearance.rounding radius: Config.cfg.appearance.rounding
Keys.onEscapePressed: event => {
win.visible = false;
event.accepted = true;
}
implicitWidth: audioLayout.implicitWidth + 10 implicitWidth: audioLayout.implicitWidth + 10
implicitHeight: audioLayout.implicitHeight + 10 implicitHeight: audioLayout.implicitHeight + 10

View file

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

View file

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