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();
setLayout(DesktopGridConfig::layoutMode());
setAnimationDuration(animationTime(200));
setAnimationDuration(animationTime(400));
for (const ElectricBorder &border : qAsConst(m_borderActivate)) {
effects->unreserveElectricBorder(border, this);

View file

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

View file

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

View file

@ -161,28 +161,28 @@ Rectangle {
enabled: !container.effect.gestureInProgress
NumberAnimation {
duration: container.effect.animationDuration
easing.type: Easing.InOutCubic
easing.type: Easing.OutCubic
}
}
Behavior on y {
enabled: !container.effect.gestureInProgress
NumberAnimation {
duration: container.effect.animationDuration
easing.type: Easing.InOutCubic
easing.type: Easing.OutCubic
}
}
Behavior on scale {
enabled: !container.effect.gestureInProgress
NumberAnimation {
duration: container.effect.animationDuration
easing.type: Easing.InOutCubic
easing.type: Easing.OutCubic
}
}
Behavior on panelOpacity {
enabled: !container.effect.gestureInProgress
NumberAnimation {
duration: container.effect.animationDuration
easing.type: Easing.InOutCubic
easing.type: Easing.OutCubic
}
}
@ -304,7 +304,7 @@ Rectangle {
enabled: !container.effect.gestureInProgress
NumberAnimation {
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();
setLayout(OverviewConfig::layoutMode());
setAnimationDuration(animationTime(200));
setAnimationDuration(animationTime(400));
setBlurBackground(OverviewConfig::blurBackground());
for (const ElectricBorder &border : qAsConst(m_borderActivate)) {

View file

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

View file

@ -274,7 +274,7 @@ Item {
NumberAnimation {
duration: thumb.windowHeap.animationDuration
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 organized: false
readonly property int animationDuration: PlasmaCore.Units.longDuration
function start() {
animationEnabled = true;
organized = true;
@ -34,7 +32,7 @@ Item {
organized = false;
}
Keys.onEscapePressed: effect.deactivate(animationDuration);
Keys.onEscapePressed: effect.deactivate(container.effect.animationDuration);
Keys.priority: Keys.AfterItem
Keys.forwardTo: searchField
@ -72,7 +70,7 @@ Item {
layer.effect: FastBlur {
radius: container.organized ? 64 : 0
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
TapHandler {
onTapped: effect.deactivate(animationDuration);
onTapped: effect.deactivate(container.effect.animationDuration);
}
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
focus: true
padding: PlasmaCore.Units.largeSpacing
animationDuration: container.animationDuration
animationDuration: container.effect.animationDuration
animationEnabled: container.animationEnabled
organized: container.organized
showOnly: {
@ -186,7 +184,7 @@ Item {
opacity: 1 - downGestureProgress
onDownGestureTriggered: client.closeWindow()
}
onActivated: effect.deactivate(animationDuration);
onActivated: effect.deactivate(container.effect.animationDuration);
}
}
PlasmaExtras.PlaceholderMessage {
@ -214,7 +212,7 @@ Item {
opacity: (model.client.hidden || container.organized) ? 0 : 1
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)
{
WindowViewConfig::self()->read();
setAnimationDuration(animationTime(200));
setAnimationDuration(animationTime(400));
setLayout(WindowViewConfig::layoutMode());
for (ElectricBorder border : qAsConst(m_borderActivate)) {

View file

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