mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 09:48:50 +00:00
[dialer] Simplify the showing logic of the main ConditionalLoader
This commit is contained in:
parent
b3af84b4a6
commit
e528b41780
1 changed files with 12 additions and 6 deletions
|
|
@ -153,10 +153,13 @@ ApplicationWindow {
|
||||||
//BEGIN UI
|
//BEGIN UI
|
||||||
PlasmaExtras.ConditionalLoader {
|
PlasmaExtras.ConditionalLoader {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
when: root.visible && dialerUtils.callState == "idle"
|
|
||||||
|
property bool shouldShow: root.visible && (dialerUtils.callState == "idle" || dialerUtils.callState == "failed")
|
||||||
|
|
||||||
|
when: shouldShow
|
||||||
source: Qt.resolvedUrl("Dialer/DialPage.qml")
|
source: Qt.resolvedUrl("Dialer/DialPage.qml")
|
||||||
z: dialerUtils.callState == "idle" ? 2 : 0
|
z: shouldShow ? 2 : 0
|
||||||
opacity: dialerUtils.callState == "idle" ? 1 : 0
|
opacity: shouldShow ? 1 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
OpacityAnimator {
|
OpacityAnimator {
|
||||||
duration: units.shortDuration
|
duration: units.shortDuration
|
||||||
|
|
@ -167,10 +170,13 @@ ApplicationWindow {
|
||||||
|
|
||||||
PlasmaExtras.ConditionalLoader {
|
PlasmaExtras.ConditionalLoader {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
when: dialerUtils.callState != "idle"
|
|
||||||
|
property bool shouldShow: dialerUtils.callState != "idle" && dialerUtils.callState != "failed"
|
||||||
|
|
||||||
|
when: shouldShow
|
||||||
source: Qt.resolvedUrl("Call/CallPage.qml")
|
source: Qt.resolvedUrl("Call/CallPage.qml")
|
||||||
opacity: dialerUtils.callState != "idle" ? 1 : 0
|
opacity: shouldShow ? 1 : 0
|
||||||
z: dialerUtils.callState != "idle" ? 2 : 0
|
z: shouldShow ? 2 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
OpacityAnimator {
|
OpacityAnimator {
|
||||||
duration: units.shortDuration
|
duration: units.shortDuration
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue