add animations to popup
This commit is contained in:
parent
f9acf2fe0f
commit
077e0bf4d5
3 changed files with 21 additions and 15 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ Variants {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
}
|
}
|
||||||
VolPopup {
|
VolPopup {
|
||||||
z: 1
|
|
||||||
id: volPopup
|
id: volPopup
|
||||||
property bool shown: WidgetTracker.current === "volume"
|
z: 1
|
||||||
|
property bool shown: root.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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue