app animations independent of plasma durations

--plasma durations can mess up the Latte animations
experience a lot. We now use our own set animations
durations which are independent of what the user
chose for plasma animations speed.

BUG:418883
pull/12/head
Michail Vourlakos 5 years ago
parent 5bdb8a683d
commit 1c88a97c55

@ -43,7 +43,7 @@ Item{
readonly property bool isShown: (solidBackground.opacity > 0) || (overlayedBackground.opacity > 0)
property int animationTime: 6*root.durationTime*units.shortDuration
property int animationTime: 6*root.durationTime*root.shortDuration
property int screenEdgeMargin: root.screenEdgeMarginEnabled ? root.localScreenEdgeMargin - shadowsSvgItem.screenEdgeShadow : 0

@ -51,7 +51,7 @@ Item{
property int maskFloatedGap: maskIsFloating ? Math.max(0, root.localScreenEdgeMargin - root.panelShadow) : 0
property int animationSpeed: Latte.WindowSystem.compositingActive ?
(editModeVisual.inEditMode ? editModeVisual.speed * 0.8 : root.appliedDurationTime * 1.4 * units.longDuration) : 0
(editModeVisual.inEditMode ? editModeVisual.speed * 0.8 : root.appliedDurationTime * 1.62 * root.longDuration) : 0
property bool inLocationAnimation: latteView && latteView.positioner && latteView.positioner.inLocationAnimation
property bool inSlidingIn: false //necessary because of its init structure
@ -977,7 +977,7 @@ Item{
property: "slideOffset"
to: plasmoid.configuration.screenEdgeMargin
duration: manager.animationSpeed
easing.type: Easing.OutQuad
easing.type: Easing.InQuad
}
}

@ -155,7 +155,7 @@ Item {
readonly property bool isSquare: communicator.overlayLatteIconIsActive
readonly property bool supportsScreenEdgeMargin: communicator.supportsScreenEdgeMargin
property int animationTime: appliedDurationTime * (1.2 *units.shortDuration)
property int animationTime: appliedDurationTime * (1.2 *root.shortDuration)
property int hoveredIndex: layoutsContainer.hoveredIndex
property int index: -1
property int maxWidth: root.isHorizontal ? root.height : root.width
@ -293,7 +293,7 @@ Item {
NumberAnimation {
id: translAnim
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.InOutQuad
target: translation
properties: "x,y"
@ -1209,7 +1209,7 @@ Item {
target: wrapper.clickedEffect
property: "brightness"
to: -0.35
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.OutQuad
}
}
@ -1218,7 +1218,7 @@ Item {
target: wrapper.clickedEffect
property: "brightness"
to: 0
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.OutQuad
}
}

@ -681,7 +681,7 @@ Item{
visible: !indicators.info.providesHoveredAnimation
Behavior on opacity {
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
}

@ -235,7 +235,7 @@ MouseArea {
Timer {
id: hideTimer
interval: units.longDuration * 2
interval: root.longDuration * 2
onTriggered: {
if (!tooltipMouseArea.containsMouse) {
tooltip.visible = false;
@ -364,7 +364,7 @@ MouseArea {
enabled: !configurationArea.pressed
NumberAnimation {
id: xAnim
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.InOutQuad
}
}
@ -372,27 +372,27 @@ MouseArea {
id: yAnim
enabled: !configurationArea.pressed
NumberAnimation {
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.InOutQuad
}
}
Behavior on width {
enabled: !configurationArea.pressed
NumberAnimation {
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.InOutQuad
}
}
Behavior on height {
enabled: !configurationArea.pressed
NumberAnimation {
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.InOutQuad
}
}
Behavior on opacity {
NumberAnimation {
duration: units.longDuration
duration: root.longDuration
easing.type: Easing.InOutQuad
}
}

@ -41,7 +41,7 @@ Item{
readonly property int settingsThickness: settingsOverlay.thickness
property int speed: Latte.WindowSystem.compositingActive ? root.appliedDurationTime*3.6*units.longDuration : 10
property int speed: Latte.WindowSystem.compositingActive ? root.appliedDurationTime*3.6*root.longDuration : 10
property int thickness: visibilityManager.thicknessEditMode + root.editShadow
property int rootThickness: visibilityManager.thicknessZoomOriginal + root.editShadow //- visibilityManager.thicknessEditMode
property int editLength: root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - root.maxIconSize/4 : root.width)://root.maxLength) :

@ -261,7 +261,7 @@ Item {
property int animationsNeedThickness: 0 // animations need thickness, e.g. bouncing animation
readonly property bool thickAnimated: animationsNeedBothAxis>0 || animationsNeedThickness>0
property int animationTime: durationTime*2.8*units.longDuration
property int animationTime: durationTime*2.8*root.longDuration
property int appletsNeedWindowsTracking: 0
@ -565,10 +565,13 @@ Item {
property bool animationWindowAddedInGroup: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowAddedInGroup
property bool animationWindowRemovedFromGroup: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowRemovedFromGroup
readonly property int shortDuration: Latte.WindowSystem.shortDuration
readonly property int longDuration: Latte.WindowSystem.longDuration
property real appliedDurationTime: animationsEnabled ? durationTime : animationsSpeed2
readonly property real animationsSpeed1: root.plasma518 ? 0.65 : 1.65
readonly property real animationsSpeed2: root.plasma518 ? 1.00 : 2.00
readonly property real animationsSpeed3: root.plasma518 ? 1.35 : 2.35
readonly property real animationsSpeed1: 0.75
readonly property real animationsSpeed2: 1.00
readonly property real animationsSpeed3: 1.15
property real durationTime: {
if (!animationsEnabled || plasmoid.configuration.durationTime === 0) {
@ -1930,7 +1933,7 @@ Item {
//! zoom-in animations will have ended.
Timer{
id:directRenderDelayerForEnteringTimer
interval: 3.2 * root.durationTime * units.shortDuration
interval: 3.2 * root.durationTime * root.shortDuration
}
//this is a delayer to update mask area, it is used in cases

@ -113,7 +113,7 @@ LatteComponents.IndicatorItem{
size: root.size
glow3D: glow3D
animation: Math.max(1.65*3*units.longDuration,indicator.durationTime*3*units.longDuration)
animation: Math.max(1.65*3*Latte.WindowSystem.longDuration,indicator.durationTime*3*Latte.WindowSystem.longDuration)
location: plasmoid.location
glowOpacity: root.glowOpacity
contrastColor: indicator.shadowColor
@ -134,7 +134,7 @@ LatteComponents.IndicatorItem{
property int stateWidth: indicator.isGroup ? root.width - secondPoint.width : root.width - spacer.width
property int stateHeight: indicator.isGroup ? root.height - secondPoint.height : root.height - spacer.height
property int animationTime: indicator.durationTime* (0.7*units.longDuration)
property int animationTime: indicator.durationTime* (0.7*Latte.WindowSystem.longDuration)
property bool isActive: indicator.hasActive || indicator.isActive
@ -228,7 +228,7 @@ LatteComponents.IndicatorItem{
size: root.size
glow3D: glow3D
animation: Math.max(1.65*3*units.longDuration,indicator.durationTime*3*units.longDuration)
animation: Math.max(1.65*3*Latte.WindowSystem.longDuration,indicator.durationTime*3*Latte.WindowSystem.longDuration)
location: plasmoid.location
glowOpacity: root.glowOpacity
contrastColor: indicator.shadowColor

@ -33,6 +33,9 @@
// X11
#include <KWindowSystem>
#define LONGDURATION 240
#define SHORTDURATION 40
namespace Latte {
QuickWindowSystem::QuickWindowSystem(QObject *parent)
@ -70,6 +73,16 @@ bool QuickWindowSystem::isPlatformWayland() const
return KWindowSystem::isPlatformWayland();
}
uint QuickWindowSystem::shortDuration() const
{
return SHORTDURATION;
}
uint QuickWindowSystem::longDuration() const
{
return LONGDURATION;
}
uint QuickWindowSystem::frameworksVersion() const
{
return Plasma::version();

@ -39,6 +39,9 @@ class QuickWindowSystem final : public QObject
Q_PROPERTY(bool compositingActive READ compositingActive NOTIFY compositingChanged FINAL)
Q_PROPERTY(bool isPlatformWayland READ isPlatformWayland NOTIFY isPlatformWaylandChanged FINAL)
Q_PROPERTY(uint shortDuration READ shortDuration NOTIFY shortDurationChanged)
Q_PROPERTY(uint longDuration READ longDuration NOTIFY longDurationChanged)
Q_PROPERTY(uint frameworksVersion READ frameworksVersion NOTIFY frameworksVersionChanged)
Q_PROPERTY(uint plasmaDesktopVersion READ plasmaDesktopVersion NOTIFY plasmaDesktopVersionChanged)
@ -49,6 +52,9 @@ public:
bool compositingActive() const;
bool isPlatformWayland() const;
uint shortDuration() const;
uint longDuration() const;
uint frameworksVersion() const;
uint plasmaDesktopVersion();
@ -59,7 +65,9 @@ signals:
void compositingChanged();
void frameworksVersionChanged();
void isPlatformWaylandChanged();
void longDurationChanged();
void plasmaDesktopVersionChanged();
void shortDurationChanged();
private:
void loadPlasmaDesktopVersion();

@ -108,7 +108,7 @@ LatteComponents.IndicatorItem{
size: root.size
glow3D: glow3D
animation: Math.max(1.65*3*units.longDuration,indicator.durationTime*3*units.longDuration)
animation: Math.max(1.65*3*root.longDuration,indicator.durationTime*3*root.longDuration)
location: plasmoid.location
glowOpacity: root.glowOpacity
contrastColor: indicator.shadowColor
@ -129,7 +129,7 @@ LatteComponents.IndicatorItem{
property int stateWidth: indicator.isGroup ? root.width - secondPoint.width : root.width - spacer.width
property int stateHeight: indicator.isGroup ? root.height - secondPoint.height : root.width - spacer.height
property int animationTime: indicator.durationTime* (0.7*units.longDuration)
property int animationTime: indicator.durationTime* (0.7*root.longDuration)
property bool isActive: indicator.hasActive || indicator.isActive
@ -223,7 +223,7 @@ LatteComponents.IndicatorItem{
size: root.size
glow3D: glow3D
animation: Math.max(1.65*3*units.longDuration,indicator.durationTime*3*units.longDuration)
animation: Math.max(1.65*3*root.longDuration,indicator.durationTime*3*root.longDuration)
location: plasmoid.location
glowOpacity: root.glowOpacity
contrastColor: indicator.shadowColor

@ -245,6 +245,9 @@ Item {
readonly property real animationsSpeed2: plasma518 ? 1.00 : 2.00
readonly property int shortDuration: latteView ? latteView.shortDuration : Latte.WindowSystem.shortDuration
readonly property int longDuration: latteView ? latteView.longDuration : Latte.WindowSystem.longDuration
property real appliedDurationTime: animationsEnabled ? durationTime : animationsSpeed2
property real durationTime: latteView ? latteView.durationTime : plasmoid.configuration.durationTime
property real zoomFactor: latteView ? latteView.zoomFactor : ( 1 + (plasmoid.configuration.zoomLevel / 20) )
@ -642,7 +645,7 @@ Item {
Timer{
id: delayWindowRemovalTimer
//this is the animation time needed in order for tasks to restore their zoom first
interval: 7 * (root.durationTime * units.shortDuration)
interval: 7 * (root.durationTime * root.shortDuration)
property var modelIndex
@ -989,7 +992,7 @@ Item {
repeat:false;
interval: 120
property int normalInterval: Math.max(120, 2 * (root.durationTime * 1.2 * units.shortDuration) + 50)
property int normalInterval: Math.max(120, 2 * (root.durationTime * 1.2 * root.shortDuration) + 50)
onTriggered: {
if(root.latteView)
@ -1027,7 +1030,7 @@ Item {
//! zoom-in animations will have ended.
Timer{
id:directRenderDelayerForEnteringTimer
interval: 3.2 * root.durationTime * units.shortDuration
interval: 3.2 * root.durationTime * root.shortDuration
}
//this timer restores the draggingPhase flag to false
@ -1066,7 +1069,7 @@ Item {
property int smallSize: Math.max(0.10 * root.iconSize, 16)
Behavior on opacity{
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
/// plasmoid's default panel
@ -1083,7 +1086,7 @@ Item {
verticalTileMode: BorderImage.Stretch
Behavior on opacity{
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
}
@ -1129,7 +1132,7 @@ Item {
plasmoid.configuration.panelSize + belower.width
Behavior on opacity{
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
@ -1262,7 +1265,7 @@ Item {
//more of a trouble
moveDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: root.durationTime*units.longDuration; easing.type: Easing.Linear }
NumberAnimation { properties: "x,y"; duration: root.durationTime*root.longDuration; easing.type: Easing.Linear }
}
///this transition can not be used with dragging !!!! I breaks

@ -254,7 +254,7 @@ Item{
to: "*"
enabled: !fastRestoreAnimation.running && !taskItem.inMimicParabolicAnimation
AnchorAnimation { duration: 1.5*root.durationTime*units.longDuration }
AnchorAnimation { duration: 1.5*root.durationTime*root.longDuration }
}
]
} //IconImageBuffer
@ -296,7 +296,7 @@ Item{
property bool showAudio: (root.showAudioBadge && taskItem.hasAudioStream && taskItem.playingAudio && !taskItem.isSeparator) && !shortcutBadge.active
Behavior on activateProgress {
NumberAnimation { duration: root.durationTime*2*units.longDuration }
NumberAnimation { duration: root.durationTime*2*root.longDuration }
}
sourceComponent: Item{
@ -564,7 +564,7 @@ Item{
contrast: 0.1
Behavior on opacity {
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
}
@ -661,7 +661,7 @@ Item{
Transition{
id: isDraggedTransition
to: "isDragged"
property int speed: root.durationTime*units.longDuration
property int speed: root.durationTime*root.longDuration
SequentialAnimation{
ScriptAction{
@ -730,7 +730,7 @@ Item{
id: defaultTransition
from: "isDragged"
to: "*"
property int speed: root.durationTime*units.longDuration
property int speed: root.durationTime*root.longDuration
SequentialAnimation{
ScriptAction{

@ -125,7 +125,7 @@ MouseArea{
property bool pressed: false
property bool wheelIsBlocked: false
property int animationTime: (animationsEnabled ? root.durationTime : 2) * (1.2 *units.shortDuration)
property int animationTime: (animationsEnabled ? root.durationTime : 2) * (1.2 *root.shortDuration)
property int badgeIndicator: 0 //it is used from external apps
property int hoveredIndex: icList.hoveredIndex
property int itemIndex: index
@ -226,7 +226,7 @@ MouseArea{
Behavior on opacity {
// NumberAnimation { duration: (IsStartup || (IsLauncher) ) ? 0 : 400 }
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
Loader{
@ -288,7 +288,7 @@ MouseArea{
property real opacityN: isSeparator && root.contextMenu && root.contextMenu.visualParent === taskItem ? 1 : 0
Behavior on opacityN {
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
sourceComponent: Rectangle{
@ -331,7 +331,7 @@ MouseArea{
property bool forceHiddenState: false
Behavior on opacity {
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
function updateForceHiddenState() {
@ -418,7 +418,7 @@ MouseArea{
opacity: separatorItem.forceHiddenState ? 0 : 0.4
Behavior on opacity {
NumberAnimation { duration: root.durationTime*units.longDuration }
NumberAnimation { duration: root.durationTime*root.longDuration }
}
sourceComponent: DropShadow{
@ -879,7 +879,7 @@ MouseArea{
pressed = false;
if(!inAnimation) {
startCheckRestoreZoomTimer(3*units.longDuration);
startCheckRestoreZoomTimer(3*root.longDuration);
}
}
@ -1637,7 +1637,7 @@ MouseArea{
//I will blacklist google-chrome as I have not found any other case for this bug
//to appear, but even this way there are cases that still appears...
property int mainDelay: (AppId == "google-chrome") ? 0 : 2*root.durationTime*showWindowAnimation.speed
property int windowDelay: taskItem.isStartup ? 3*root.durationTime*units.longDuration : mainDelay
property int windowDelay: taskItem.isStartup ? 3*root.durationTime*root.longDuration : mainDelay
Component {
id: delayShowWindow

@ -27,7 +27,7 @@ SequentialAnimation{
id: clickedAnimation
property bool pressed: taskItem.pressed
property int speed: root.durationTime*units.longDuration
property int speed: root.durationTime*root.longDuration
property real maxMScale: Math.max(1,root.zoomFactor - (root.zoomFactor - 1) / 2)
ParallelAnimation{
@ -77,7 +77,7 @@ SequentialAnimation{
if( !taskItem.isDragged){
//taskItem.animationEnded();
if(!root.latteView)
checkListHovered.startDuration(6*units.longDuration);
checkListHovered.startDuration(6*root.longDuration);
}
}
}

@ -28,7 +28,7 @@ SequentialAnimation{
id:launcherAnimation
property bool launchedAlready: false
property int speed: root.durationTime * 0.9 * units.longDuration
property int speed: root.durationTime * 0.9 * root.longDuration
SequentialAnimation{
ScriptAction {

@ -28,7 +28,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
SequentialAnimation{
id:newWindowAnimation
property int speed: root.appliedDurationTime*1.2*units.longDuration
property int speed: root.appliedDurationTime*1.2*root.longDuration
property bool isDemandingAttention: taskItem.inAttention
property bool containsMouse: taskItem.containsMouse
property bool needsThicknessSent: false //flag to check if the signal for thickness was sent

@ -109,7 +109,7 @@ SequentialAnimation {
duration: taskItem.inBouncingAnimation && !taskItem.isSeparator? 4*launcherSpeedStep + 50 : 0
easing.type: Easing.InQuad
property int launcherSpeedStep: root.durationTime * 0.8 * units.longDuration
property int launcherSpeedStep: root.durationTime * 0.8 * root.longDuration
}
//end of ghost animation

@ -114,7 +114,7 @@ Item{
ParallelAnimation{
id: componentRemoveAnimation
property int speed: 2*root.appliedDurationTime*units.longDuration
property int speed: 2*root.appliedDurationTime*root.longDuration
property Item removingItem: parent
property int toPoint: 0

@ -27,7 +27,7 @@ import org.kde.latte 0.2 as Latte
///item's added Animation
SequentialAnimation{
id:showWindowAnimation
property int speed: root.animationNewWindowSliding ? root.appliedDurationTime* (1.2*units.longDuration) : 0
property int speed: root.animationNewWindowSliding ? root.appliedDurationTime* (1.2*root.longDuration) : 0
property bool animationSent: false
//Ghost animation that acts as a delayer, in order to fix #342

@ -209,7 +209,7 @@ Flickable{
Behavior on contentX {
NumberAnimation {
id: horizontalAnimation
duration: root.durationTime*1.7*units.longDuration
duration: root.durationTime*1.7*root.longDuration
easing.type: Easing.OutQuad
}
}
@ -217,7 +217,7 @@ Flickable{
Behavior on contentY {
NumberAnimation {
id: verticalAnimation
duration: root.durationTime*1.7*units.longDuration
duration: root.durationTime*1.7*root.longDuration
easing.type: Easing.OutQuad
}
}

Loading…
Cancel
Save