From d15b84319cd69c4ec427e7ce9c941edc97660e7c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 6 May 2017 11:50:49 +0300 Subject: [PATCH] fix directRenderAnimationTime --use a small duration of 20ms for the directRenderAnimationTime in order to add a bit more smoothness in the parabolic animation when directRender is activated --- containment/contents/ui/AppletItem.qml | 27 ++++++-------------------- containment/contents/ui/main.qml | 2 +- plasmoid/contents/ui/TaskDelegate.qml | 27 ++++++-------------------- plasmoid/contents/ui/main.qml | 2 +- 4 files changed, 14 insertions(+), 44 deletions(-) diff --git a/containment/contents/ui/AppletItem.qml b/containment/contents/ui/AppletItem.qml index a24f66263..9fdf62541 100644 --- a/containment/contents/ui/AppletItem.qml +++ b/containment/contents/ui/AppletItem.qml @@ -326,13 +326,8 @@ Item { property real nScale: 0 Behavior on nScale { - enabled: !root.globalDirectRender - NumberAnimation { duration: 3*container.animationTime } - } - - Behavior on nScale { - enabled: root.globalDirectRender - NumberAnimation { duration: root.directRenderAnimationTime } + NumberAnimation { duration: root.globalDirectRender ? + root.directRenderAnimationTime : 3*container.animationTime } } Loader{ @@ -837,13 +832,8 @@ Item { } Behavior on zoomScale { - enabled: !root.globalDirectRender - NumberAnimation { duration: 3*container.animationTime } - } - - Behavior on zoomScale { - enabled: root.globalDirectRender - NumberAnimation { duration: root.directRenderAnimationTime } + NumberAnimation { duration: root.globalDirectRender ? + root.directRenderAnimationTime : 3*container.animationTime } } //!this is used in order to update the index when the signal is for the internal latte plasmoid @@ -1023,13 +1013,8 @@ Item { property real nScale: 0 Behavior on nScale { - enabled: !root.globalDirectRender - NumberAnimation { duration: 3*container.animationTime } - } - - Behavior on nScale { - enabled: root.globalDirectRender - NumberAnimation { duration: root.directRenderAnimationTime } + NumberAnimation { duration: root.globalDirectRender ? + root.directRenderAnimationTime : 3*container.animationTime } } Loader{ diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index b1d833ea4..39fe0daf8 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -48,7 +48,7 @@ DragDrop.DropArea { property bool debugMode: Qt.application.arguments.indexOf("--graphics")>=0 property bool globalDirectRender: false //it is used as a globalDirectRender for all elements in the dock property bool directRenderTimerIsRunning: enableDirectRenderTimer.running - property int directRenderAnimationTime: 0 + property int directRenderAnimationTime: 20 property bool addLaunchersMessage: false property bool addLaunchersInTaskManager: plasmoid.configuration.addLaunchersInTaskManager diff --git a/plasmoid/contents/ui/TaskDelegate.qml b/plasmoid/contents/ui/TaskDelegate.qml index bb51ca556..a635bf0a0 100644 --- a/plasmoid/contents/ui/TaskDelegate.qml +++ b/plasmoid/contents/ui/TaskDelegate.qml @@ -272,13 +272,8 @@ MouseArea{ property real nScale: 0 Behavior on nScale { - enabled: !root.globalDirectRender - NumberAnimation { duration: 3 * mainItemContainer.animationTime } - } - - Behavior on nScale { - enabled: root.globalDirectRender - NumberAnimation { duration: root.directRenderAnimationTime } + NumberAnimation { duration: root.globalDirectRender ? + root.directRenderAnimationTime : 3 * mainItemContainer.animationTime } } /* Rectangle{ @@ -394,13 +389,8 @@ MouseArea{ }*/ Behavior on mScale { - enabled: !root.globalDirectRender - NumberAnimation { duration: 3 * mainItemContainer.animationTime } - } - - Behavior on mScale { - enabled: root.globalDirectRender - NumberAnimation { duration: root.directRenderAnimationTime } + NumberAnimation { duration: root.globalDirectRender ? + root.directRenderAnimationTime : 3 * mainItemContainer.animationTime } } Flow{ @@ -630,13 +620,8 @@ MouseArea{ property real nScale: 0 Behavior on nScale { - enabled: !root.globalDirectRender - NumberAnimation { duration: 3 * mainItemContainer.animationTime } - } - - Behavior on nScale { - enabled: root.globalDirectRender - NumberAnimation { duration: root.directRenderAnimationTime } + NumberAnimation { duration: root.globalDirectRender ? + root.directRenderAnimationTime : 3 * mainItemContainer.animationTime } } /* Rectangle{ diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 9947aacac..42f664d78 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -143,7 +143,7 @@ Item { property bool smartLaunchersEnabled: latteDock ? latteDock.smartLaunchersEnabled : plasmoid.configuration.smartLaunchersEnabled property bool threeColorsWindows: latteDock ? latteDock.threeColorsWindows : plasmoid.configuration.threeColorsWindows - property int directRenderAnimationTime: latteDock ? latteDock.directRenderAnimationTime : 0 + property int directRenderAnimationTime: latteDock ? latteDock.directRenderAnimationTime : 20 property int dockHoveredIndex : latteDock ? latteDock.hoveredIndex : -1 property int iconMargin: latteDock ? latteDock.iconMargin : 0.12*iconSize property int iconSize: latteDock ? latteDock.iconSize : Math.max(plasmoid.configuration.iconSize, 16)