From ce06af0e8acb6a85c37cb6e7171fb1203f84b8c7 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sat, 30 Apr 2022 11:07:07 -0400 Subject: [PATCH] Fix some animations not following setting --- .../quicksettings/QuickSettingsFullDelegate.qml | 2 +- .../QuickSettingsMinimizedDelegate.qml | 2 +- .../mobileshell/qml/homescreen/HomeScreen.qml | 15 +++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml index 64da5aba..b2bf3972 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml @@ -24,7 +24,7 @@ QuickSettingsDelegate { iconItem: icon // scale animation on press - zoomScale: mouseArea.pressed ? 0.9 : 1 + zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 background: Rectangle { anchors.fill: parent diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml index 3859c8f7..49162b72 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml @@ -22,7 +22,7 @@ QuickSettingsDelegate { iconItem: icon // scale animation on press - zoomScale: mouseArea.pressed ? 0.9 : 1 + zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 background: Rectangle { radius: PlasmaCore.Units.smallSpacing diff --git a/components/mobileshell/qml/homescreen/HomeScreen.qml b/components/mobileshell/qml/homescreen/HomeScreen.qml index 6460b5d9..6cc4ab08 100644 --- a/components/mobileshell/qml/homescreen/HomeScreen.qml +++ b/components/mobileshell/qml/homescreen/HomeScreen.qml @@ -114,27 +114,30 @@ Item { Component.onCompleted: zoomIn() function zoomIn() { + // don't use check animationsEnabled here, so we ensure the scale and opacity is always 1 when disabled scaleAnim.to = 1; scaleAnim.restart(); opacityAnim.to = 1; opacityAnim.restart(); } function zoomOut() { - scaleAnim.to = 0.8; - scaleAnim.restart(); - opacityAnim.to = 0; - opacityAnim.restart(); + if (MobileShell.MobileShellSettings.animationsEnabled) { + scaleAnim.to = 0.8; + scaleAnim.restart(); + opacityAnim.to = 0; + opacityAnim.restart(); + } } NumberAnimation on opacity { id: opacityAnim - duration: 300 + duration: MobileShell.MobileShellSettings.animationsEnabled ? 300 : 0 running: false } NumberAnimation on zoomScale { id: scaleAnim - duration: 600 + duration: MobileShell.MobileShellSettings.animationsEnabled ? 600 : 0 running: false easing.type: Easing.OutExpo }