controlcenter: fade-out animation on password input dialog close
This commit is contained in:
parent
7c2d49240c
commit
f472be184a
1 changed files with 27 additions and 24 deletions
|
|
@ -29,9 +29,9 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool isClosing: false
|
property bool isClosing: false
|
||||||
visible: session.network.showPasswordDialog && !isClosing
|
visible: session.network.showPasswordDialog || isClosing
|
||||||
enabled: visible
|
enabled: session.network.showPasswordDialog && !isClosing
|
||||||
focus: visible
|
focus: enabled
|
||||||
|
|
||||||
Keys.onEscapePressed: {
|
Keys.onEscapePressed: {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
|
@ -40,14 +40,10 @@ Item {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(0, 0, 0, 0.5)
|
color: Qt.rgba(0, 0, 0, 0.5)
|
||||||
opacity: root.visible && !root.isClosing ? 1 : 0
|
opacity: root.session.network.showPasswordDialog && !root.isClosing ? 1 : 0
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
property: "opacity"
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -66,22 +62,35 @@ Item {
|
||||||
|
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.tPalette.m3surface
|
color: Colours.tPalette.m3surface
|
||||||
opacity: root.visible && !root.isClosing ? 1 : 0
|
opacity: root.session.network.showPasswordDialog && !root.isClosing ? 1 : 0
|
||||||
scale: root.visible && !root.isClosing ? 1 : 0.9
|
scale: root.session.network.showPasswordDialog && !root.isClosing ? 1 : 0.7
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
property: "opacity"
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
|
||||||
|
ParallelAnimation {
|
||||||
|
running: root.isClosing
|
||||||
|
onFinished: {
|
||||||
|
if (root.isClosing) {
|
||||||
|
root.session.network.showPasswordDialog = false;
|
||||||
|
root.isClosing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Anim {
|
Anim {
|
||||||
|
target: dialog
|
||||||
|
property: "opacity"
|
||||||
|
to: 0
|
||||||
|
}
|
||||||
|
Anim {
|
||||||
|
target: dialog
|
||||||
property: "scale"
|
property: "scale"
|
||||||
duration: Appearance.anim.durations.normal
|
to: 0.7
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -441,11 +450,5 @@ Item {
|
||||||
connectButton.connecting = false;
|
connectButton.connecting = false;
|
||||||
connectButton.text = qsTr("Connect");
|
connectButton.text = qsTr("Connect");
|
||||||
connectionMonitor.stop();
|
connectionMonitor.stop();
|
||||||
|
|
||||||
// Wait for fade-out animation to complete before actually hiding
|
|
||||||
Qt.callLater(() => {
|
|
||||||
session.network.showPasswordDialog = false;
|
|
||||||
isClosing = false;
|
|
||||||
}, Appearance.anim.durations.normal);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue