effects: Improve animation durations and easing curves in Windowheap-based effects

This commit doubles the animation durations for WindowHeap-based effects
(Overview, Present Windows, and Desktop Grid) and uses the OutCubic easing
curve for their opening and closing animations. This makes them feel smoother
and more comfortable.

BUG: 455521
BUG: 448538
FIXED-IN: 5.26
This commit is contained in:
Blake Sperling 2022-08-09 23:54:44 +00:00 committed by Nate Graham
parent 9f41620b77
commit 1a475a73de
10 changed files with 21 additions and 23 deletions

View file

@ -98,7 +98,7 @@ void DesktopGridEffect::reconfigure(ReconfigureFlags)
{ {
DesktopGridConfig::self()->read(); DesktopGridConfig::self()->read();
setLayout(DesktopGridConfig::layoutMode()); setLayout(DesktopGridConfig::layoutMode());
setAnimationDuration(animationTime(200)); setAnimationDuration(animationTime(400));
for (const ElectricBorder &border : qAsConst(m_borderActivate)) { for (const ElectricBorder &border : qAsConst(m_borderActivate)) {
effects->unreserveElectricBorder(border, this); effects->unreserveElectricBorder(border, this);

View file

@ -108,7 +108,7 @@ private:
QList<ElectricBorder> m_borderActivate; QList<ElectricBorder> m_borderActivate;
QList<ElectricBorder> m_touchBorderActivate; QList<ElectricBorder> m_touchBorderActivate;
Status m_status = Status::Inactive; Status m_status = Status::Inactive;
int m_animationDuration = 200; int m_animationDuration = 400;
int m_layout = 1; int m_layout = 1;
bool m_gestureInProgress = false; bool m_gestureInProgress = false;
}; };

View file

@ -138,7 +138,7 @@ FocusScope {
XAnimator { XAnimator {
id: xAnim id: xAnim
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
Behavior on y { Behavior on y {
@ -146,7 +146,7 @@ FocusScope {
YAnimator { YAnimator {
id: yAnim id: yAnim
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
} }

View file

@ -161,28 +161,28 @@ Rectangle {
enabled: !container.effect.gestureInProgress enabled: !container.effect.gestureInProgress
NumberAnimation { NumberAnimation {
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
Behavior on y { Behavior on y {
enabled: !container.effect.gestureInProgress enabled: !container.effect.gestureInProgress
NumberAnimation { NumberAnimation {
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
Behavior on scale { Behavior on scale {
enabled: !container.effect.gestureInProgress enabled: !container.effect.gestureInProgress
NumberAnimation { NumberAnimation {
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
Behavior on panelOpacity { Behavior on panelOpacity {
enabled: !container.effect.gestureInProgress enabled: !container.effect.gestureInProgress
NumberAnimation { NumberAnimation {
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
@ -304,7 +304,7 @@ Rectangle {
enabled: !container.effect.gestureInProgress enabled: !container.effect.gestureInProgress
NumberAnimation { NumberAnimation {
duration: container.effect.animationDuration duration: container.effect.animationDuration
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }
} }

View file

@ -93,7 +93,7 @@ void OverviewEffect::reconfigure(ReconfigureFlags)
{ {
OverviewConfig::self()->read(); OverviewConfig::self()->read();
setLayout(OverviewConfig::layoutMode()); setLayout(OverviewConfig::layoutMode());
setAnimationDuration(animationTime(200)); setAnimationDuration(animationTime(400));
setBlurBackground(OverviewConfig::blurBackground()); setBlurBackground(OverviewConfig::blurBackground());
for (const ElectricBorder &border : qAsConst(m_borderActivate)) { for (const ElectricBorder &border : qAsConst(m_borderActivate)) {

View file

@ -87,7 +87,7 @@ private:
qreal m_partialActivationFactor = 0; qreal m_partialActivationFactor = 0;
bool m_blurBackground = false; bool m_blurBackground = false;
Status m_status = Status::Inactive; Status m_status = Status::Inactive;
int m_animationDuration = 200; int m_animationDuration = 400;
int m_layout = 1; int m_layout = 1;
bool m_gestureInProgress = false; bool m_gestureInProgress = false;
}; };

View file

@ -274,7 +274,7 @@ Item {
NumberAnimation { NumberAnimation {
duration: thumb.windowHeap.animationDuration duration: thumb.windowHeap.animationDuration
properties: "x, y, width, height, opacity" properties: "x, y, width, height, opacity"
easing.type: Easing.InOutCubic easing.type: Easing.OutCubic
} }
} }

View file

@ -23,8 +23,6 @@ Item {
property bool animationEnabled: false property bool animationEnabled: false
property bool organized: false property bool organized: false
readonly property int animationDuration: PlasmaCore.Units.longDuration
function start() { function start() {
animationEnabled = true; animationEnabled = true;
organized = true; organized = true;
@ -34,7 +32,7 @@ Item {
organized = false; organized = false;
} }
Keys.onEscapePressed: effect.deactivate(animationDuration); Keys.onEscapePressed: effect.deactivate(container.effect.animationDuration);
Keys.priority: Keys.AfterItem Keys.priority: Keys.AfterItem
Keys.forwardTo: searchField Keys.forwardTo: searchField
@ -72,7 +70,7 @@ Item {
layer.effect: FastBlur { layer.effect: FastBlur {
radius: container.organized ? 64 : 0 radius: container.organized ? 64 : 0
Behavior on radius { Behavior on radius {
NumberAnimation { duration: container.animationDuration; easing.type: Easing.OutCubic } NumberAnimation { duration: container.effect.animationDuration; easing.type: Easing.OutCubic }
} }
} }
} }
@ -83,11 +81,11 @@ Item {
opacity: container.organized ? 0.75 : 0 opacity: container.organized ? 0.75 : 0
TapHandler { TapHandler {
onTapped: effect.deactivate(animationDuration); onTapped: effect.deactivate(container.effect.animationDuration);
} }
Behavior on opacity { Behavior on opacity {
OpacityAnimator { duration: animationDuration; easing.type: Easing.OutCubic } OpacityAnimator { duration: container.effect.animationDuration; easing.type: Easing.OutCubic }
} }
} }
@ -143,7 +141,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
focus: true focus: true
padding: PlasmaCore.Units.largeSpacing padding: PlasmaCore.Units.largeSpacing
animationDuration: container.animationDuration animationDuration: container.effect.animationDuration
animationEnabled: container.animationEnabled animationEnabled: container.animationEnabled
organized: container.organized organized: container.organized
showOnly: { showOnly: {
@ -186,7 +184,7 @@ Item {
opacity: 1 - downGestureProgress opacity: 1 - downGestureProgress
onDownGestureTriggered: client.closeWindow() onDownGestureTriggered: client.closeWindow()
} }
onActivated: effect.deactivate(animationDuration); onActivated: effect.deactivate(container.effect.animationDuration);
} }
} }
PlasmaExtras.PlaceholderMessage { PlasmaExtras.PlaceholderMessage {
@ -214,7 +212,7 @@ Item {
opacity: (model.client.hidden || container.organized) ? 0 : 1 opacity: (model.client.hidden || container.organized) ? 0 : 1
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: animationDuration; easing.type: Easing.OutCubic } NumberAnimation { duration: container.effect.animationDuration; easing.type: Easing.OutCubic }
} }
} }
} }

View file

@ -185,7 +185,7 @@ int WindowViewEffect::requestedEffectChainPosition() const
void WindowViewEffect::reconfigure(ReconfigureFlags) void WindowViewEffect::reconfigure(ReconfigureFlags)
{ {
WindowViewConfig::self()->read(); WindowViewConfig::self()->read();
setAnimationDuration(animationTime(200)); setAnimationDuration(animationTime(400));
setLayout(WindowViewConfig::layoutMode()); setLayout(WindowViewConfig::layoutMode());
for (ElectricBorder border : qAsConst(m_borderActivate)) { for (ElectricBorder border : qAsConst(m_borderActivate)) {

View file

@ -120,7 +120,7 @@ private:
Status m_status = Status::Inactive; Status m_status = Status::Inactive;
qreal m_partialActivationFactor = 0; qreal m_partialActivationFactor = 0;
PresentWindowsMode m_mode; PresentWindowsMode m_mode;
int m_animationDuration = 200; int m_animationDuration = 400;
int m_layout = 1; int m_layout = 1;
bool m_gestureInProgress = false; bool m_gestureInProgress = false;
}; };