gate non-essential animations behind reducedMotion config toggle
This commit is contained in:
parent
446edaab9c
commit
ada611d6c5
8 changed files with 43 additions and 12 deletions
|
|
@ -125,7 +125,7 @@ Item {
|
|||
|
||||
property real _pulse: 0.08
|
||||
SequentialAnimation on _pulse {
|
||||
running: root._hovered
|
||||
running: root._hovered && !S.Theme.reducedMotion
|
||||
loops: Animation.Infinite
|
||||
NumberAnimation {
|
||||
to: 0.22
|
||||
|
|
|
|||
|
|
@ -133,7 +133,12 @@ PanelWindow {
|
|||
}
|
||||
_winVisible = true;
|
||||
hideAnim.stop();
|
||||
showAnim.start();
|
||||
if (S.Theme.reducedMotion) {
|
||||
panelContainer.opacity = 1;
|
||||
panelContainer.y = 0;
|
||||
} else {
|
||||
showAnim.start();
|
||||
}
|
||||
_grace = true;
|
||||
_graceTimer.restart();
|
||||
}
|
||||
|
|
@ -141,7 +146,13 @@ PanelWindow {
|
|||
function dismiss() {
|
||||
_pinned = false;
|
||||
showAnim.stop();
|
||||
hideAnim.start();
|
||||
if (S.Theme.reducedMotion) {
|
||||
_winVisible = false;
|
||||
if (popupMode)
|
||||
dismissed();
|
||||
} else {
|
||||
hideAnim.start();
|
||||
}
|
||||
_grace = false;
|
||||
_graceTimer.stop();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,13 @@ PanelWindow {
|
|||
_heightScale = 1;
|
||||
} else {
|
||||
popupCol._knownIds[modelData.id] = true;
|
||||
slideIn.start();
|
||||
if (S.Theme.reducedMotion) {
|
||||
opacity = 1;
|
||||
x = 0;
|
||||
_heightScale = 1;
|
||||
} else {
|
||||
slideIn.start();
|
||||
}
|
||||
}
|
||||
_entered = true;
|
||||
}
|
||||
|
|
@ -82,7 +88,7 @@ PanelWindow {
|
|||
}
|
||||
|
||||
Behavior on y {
|
||||
enabled: popupItem._entered
|
||||
enabled: popupItem._entered && !S.Theme.reducedMotion
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.OutCubic
|
||||
|
|
@ -123,7 +129,11 @@ PanelWindow {
|
|||
popupItem.modelData.beginDismiss();
|
||||
_fullDismiss = !!full;
|
||||
slideIn.stop();
|
||||
slideOut.start();
|
||||
if (S.Theme.reducedMotion) {
|
||||
full ? S.NotifService.dismiss(modelData.id) : S.NotifService.dismissPopup(modelData.id);
|
||||
} else {
|
||||
slideOut.start();
|
||||
}
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ M.PinnableSection {
|
|||
Connections {
|
||||
target: S.NotifService
|
||||
function onCountChanged() {
|
||||
if (S.NotifService.count > 0)
|
||||
if (S.NotifService.count > 0 && !S.Theme.reducedMotion)
|
||||
popAnim.start();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import QtQuick
|
||||
import "../services" as S
|
||||
|
||||
SequentialAnimation {
|
||||
id: root
|
||||
loops: Animation.Infinite
|
||||
loops: S.Theme.reducedMotion ? 0 : Animation.Infinite
|
||||
|
||||
property real minOpacity: 0.4
|
||||
property int halfDuration: 400
|
||||
|
|
|
|||
|
|
@ -19,10 +19,19 @@ PanelWindow {
|
|||
if (_shown) {
|
||||
_winVisible = true;
|
||||
hideAnim.stop();
|
||||
showAnim.start();
|
||||
if (S.Theme.reducedMotion) {
|
||||
content.opacity = 1;
|
||||
content.y = 0;
|
||||
} else {
|
||||
showAnim.start();
|
||||
}
|
||||
} else {
|
||||
showAnim.stop();
|
||||
hideAnim.start();
|
||||
if (S.Theme.reducedMotion) {
|
||||
_winVisible = false;
|
||||
} else {
|
||||
hideAnim.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue