From 177be0c79a9c32331e972fbcbf4182e40eea0fc3 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 4 Mar 2021 08:59:52 -0700 Subject: [PATCH] Use more standard durations CCBUG: 433948 Note that this also makes the busy indicator stop spinning at all when the user has disabled animations. Instead it just shows a static image. --- src/declarativeimports/plasmacomponents3/BusyIndicator.qml | 6 +++++- src/declarativeimports/plasmacomponents3/Dialog.qml | 4 ++-- src/declarativeimports/plasmacomponents3/Menu.qml | 4 ++-- src/declarativeimports/plasmacomponents3/Popup.qml | 4 ++-- src/declarativeimports/plasmacomponents3/ProgressBar.qml | 4 ++-- src/declarativeimports/plasmastyle/BusyIndicatorStyle.qml | 6 +++++- src/declarativeimports/plasmastyle/ButtonStyle.qml | 4 ++-- src/declarativeimports/plasmastyle/ComboBoxStyle.qml | 4 ++-- src/declarativeimports/plasmastyle/ProgressBarStyle.qml | 4 ++-- src/declarativeimports/plasmastyle/ToolButtonStyle.qml | 4 ++-- 10 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/declarativeimports/plasmacomponents3/BusyIndicator.qml b/src/declarativeimports/plasmacomponents3/BusyIndicator.qml index 6321d88cf..dc2c433b5 100644 --- a/src/declarativeimports/plasmacomponents3/BusyIndicator.qml +++ b/src/declarativeimports/plasmacomponents3/BusyIndicator.qml @@ -60,9 +60,13 @@ T.BusyIndicator { id: rotationAnimator from: 0 to: 360 + // Not using a standard duration value because we don't want the + // animation to spin faster or slower based on the user's animation + // scaling preferences; it doesn't make sense in this context duration: 2000 loops: Animation.Infinite - running: visible && (control.running || baseItem.opacity > 0) + // Don't want it to animate at all if the user has disabled animations + running: visible && (control.running || baseItem.opacity > 0) && PlasmaCore.Units.longDuration > 1; } } } diff --git a/src/declarativeimports/plasmacomponents3/Dialog.qml b/src/declarativeimports/plasmacomponents3/Dialog.qml index f9b1a9c41..61908ecdb 100644 --- a/src/declarativeimports/plasmacomponents3/Dialog.qml +++ b/src/declarativeimports/plasmacomponents3/Dialog.qml @@ -30,7 +30,7 @@ T.Dialog { from: 0 to: 1 easing.type: Easing.InOutQuad - duration: 250 + duration: PlasmaCore.Units.longDuration } } @@ -40,7 +40,7 @@ T.Dialog { from: 1 to: 0 easing.type: Easing.InOutQuad - duration: 250 + duration: PlasmaCore.Units.longDuration } } diff --git a/src/declarativeimports/plasmacomponents3/Menu.qml b/src/declarativeimports/plasmacomponents3/Menu.qml index d4804293b..a1678bef6 100644 --- a/src/declarativeimports/plasmacomponents3/Menu.qml +++ b/src/declarativeimports/plasmacomponents3/Menu.qml @@ -72,7 +72,7 @@ T.Menu { from: 0 to: 1 easing.type: Easing.InOutQuad - duration: 150 + duration: PlasmaCore.Units.shortDuration } } @@ -82,7 +82,7 @@ T.Menu { from: 1 to: 0 easing.type: Easing.InOutQuad - duration: 150 + duration: PlasmaCore.Units.shortDuration } } diff --git a/src/declarativeimports/plasmacomponents3/Popup.qml b/src/declarativeimports/plasmacomponents3/Popup.qml index 868d1971b..eafba8704 100644 --- a/src/declarativeimports/plasmacomponents3/Popup.qml +++ b/src/declarativeimports/plasmacomponents3/Popup.qml @@ -30,7 +30,7 @@ T.Popup { from: 0 to: 1 easing.type: Easing.InOutQuad - duration: 250 + duration: PlasmaCore.Units.longDuration } } @@ -40,7 +40,7 @@ T.Popup { from: 1 to: 0 easing.type: Easing.InOutQuad - duration: 250 + duration: PlasmaCore.Units.longDuration } } diff --git a/src/declarativeimports/plasmacomponents3/ProgressBar.qml b/src/declarativeimports/plasmacomponents3/ProgressBar.qml index 0bef7b9cf..684f095e1 100644 --- a/src/declarativeimports/plasmacomponents3/ProgressBar.qml +++ b/src/declarativeimports/plasmacomponents3/ProgressBar.qml @@ -45,7 +45,7 @@ T.ProgressBar { PropertyAnimation { target: indicator property: "x" - duration: 800 + duration: PlasmaCore.Units.veryLongDuration * 2 to: control.width - indicator.width onToChanged: { //the animation won't update the boundaries automatically @@ -57,7 +57,7 @@ T.ProgressBar { PropertyAnimation { target: indicator property: "x" - duration: 800 + duration: PlasmaCore.Units.veryLongDuration * 2 to: 0 } } diff --git a/src/declarativeimports/plasmastyle/BusyIndicatorStyle.qml b/src/declarativeimports/plasmastyle/BusyIndicatorStyle.qml index 2babe9946..a16b5035f 100644 --- a/src/declarativeimports/plasmastyle/BusyIndicatorStyle.qml +++ b/src/declarativeimports/plasmastyle/BusyIndicatorStyle.qml @@ -35,8 +35,12 @@ BusyIndicatorStyle { id: rotationAnimator from: 0 to: 360 + // Not using a standard duration value because we don't want the + // animation to spin faster or slower based on the user's animation + // scaling preferences; it doesn't make sense in this context duration: 2000 - running: control.running && control.visible && control.opacity > 0; + // Don't want it to animate at all if the user has disabled animations + running: control.running && control.visible && control.opacity > 0 && PlasmaCore.Units.longDuration > 1; loops: Animation.Infinite } } diff --git a/src/declarativeimports/plasmastyle/ButtonStyle.qml b/src/declarativeimports/plasmastyle/ButtonStyle.qml index 7cf5f72ea..34612713f 100644 --- a/src/declarativeimports/plasmastyle/ButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ButtonStyle.qml @@ -155,8 +155,8 @@ QtQuickControlStyle.ButtonStyle { to: "normal" //Cross fade from pressed to normal ParallelAnimation { - NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: 100 } - NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: 100 } + NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: PlasmaCore.Units.shortDuration } + NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: PlasmaCore.Units.shortDuration } } } ] diff --git a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml index 13b0e8fe9..0934d9828 100644 --- a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml @@ -93,8 +93,8 @@ QtQuickControlStyle.ComboBoxStyle { to: "normal" //Cross fade from pressed to normal ParallelAnimation { - NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: 100 } - NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: 100 } + NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: PlasmaCore.Units.shortDuration } + NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: PlasmaCore.Units.shortDuration } } } ] diff --git a/src/declarativeimports/plasmastyle/ProgressBarStyle.qml b/src/declarativeimports/plasmastyle/ProgressBarStyle.qml index 96bd308a7..f0223db4f 100644 --- a/src/declarativeimports/plasmastyle/ProgressBarStyle.qml +++ b/src/declarativeimports/plasmastyle/ProgressBarStyle.qml @@ -74,7 +74,7 @@ ProgressBarStyle { PropertyAnimation { target: progressSvg property: "x" - duration: 800 + duration: PlasmaCore.Units.veryLongDuration * 2 // The progress Item's width might be left over from the previous state // so we use the control.width/height directly instead to: control.width - units.gridUnit * 2 @@ -88,7 +88,7 @@ ProgressBarStyle { PropertyAnimation { target: progressSvg property: "x" - duration: 800 + duration: PlasmaCore.Units.veryLongDuration * 2 to: 0 } } diff --git a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml index b83d34975..5810cf394 100644 --- a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml @@ -390,8 +390,8 @@ QtQuickControlStyle.ButtonStyle { Transition { //Cross fade from pressed to normal ParallelAnimation { - NumberAnimation { target: surfaceNormal; property: "opacity"; duration: 100 } - NumberAnimation { target: surfacePressed; property: "opacity"; duration: 100 } + NumberAnimation { target: surfaceNormal; property: "opacity"; duration: PlasmaCore.Units.shortDuration } + NumberAnimation { target: surfacePressed; property: "opacity"; duration: PlasmaCore.Units.shortDuration } } } ]