mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
Fix some animations not following setting
This commit is contained in:
parent
a18313b447
commit
ce06af0e8a
3 changed files with 11 additions and 8 deletions
|
|
@ -24,7 +24,7 @@ QuickSettingsDelegate {
|
||||||
iconItem: icon
|
iconItem: icon
|
||||||
|
|
||||||
// scale animation on press
|
// scale animation on press
|
||||||
zoomScale: mouseArea.pressed ? 0.9 : 1
|
zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ QuickSettingsDelegate {
|
||||||
iconItem: icon
|
iconItem: icon
|
||||||
|
|
||||||
// scale animation on press
|
// scale animation on press
|
||||||
zoomScale: mouseArea.pressed ? 0.9 : 1
|
zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
radius: PlasmaCore.Units.smallSpacing
|
radius: PlasmaCore.Units.smallSpacing
|
||||||
|
|
|
||||||
|
|
@ -114,27 +114,30 @@ Item {
|
||||||
Component.onCompleted: zoomIn()
|
Component.onCompleted: zoomIn()
|
||||||
|
|
||||||
function 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.to = 1;
|
||||||
scaleAnim.restart();
|
scaleAnim.restart();
|
||||||
opacityAnim.to = 1;
|
opacityAnim.to = 1;
|
||||||
opacityAnim.restart();
|
opacityAnim.restart();
|
||||||
}
|
}
|
||||||
function zoomOut() {
|
function zoomOut() {
|
||||||
|
if (MobileShell.MobileShellSettings.animationsEnabled) {
|
||||||
scaleAnim.to = 0.8;
|
scaleAnim.to = 0.8;
|
||||||
scaleAnim.restart();
|
scaleAnim.restart();
|
||||||
opacityAnim.to = 0;
|
opacityAnim.to = 0;
|
||||||
opacityAnim.restart();
|
opacityAnim.restart();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NumberAnimation on opacity {
|
NumberAnimation on opacity {
|
||||||
id: opacityAnim
|
id: opacityAnim
|
||||||
duration: 300
|
duration: MobileShell.MobileShellSettings.animationsEnabled ? 300 : 0
|
||||||
running: false
|
running: false
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation on zoomScale {
|
NumberAnimation on zoomScale {
|
||||||
id: scaleAnim
|
id: scaleAnim
|
||||||
duration: 600
|
duration: MobileShell.MobileShellSettings.animationsEnabled ? 600 : 0
|
||||||
running: false
|
running: false
|
||||||
easing.type: Easing.OutExpo
|
easing.type: Easing.OutExpo
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue