From 3a347754ea927b09314d9c064b26ef41f5742623 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 12 May 2020 19:50:40 +0300 Subject: [PATCH] fix one pixel glitch for parabolic effect --finally after two years I found why there was a glitch when the parabolic effect was hovering from Task into an applet and vice versa. Tasks were rounding their size before exposing it to container. Now this is fixed. --Drag a task animation is now improved to be a little more responsive and to inform also its mask requirements to animations --- plasmoid/package/contents/ui/main.qml | 9 ++++++--- plasmoid/package/contents/ui/task/IconItem.qml | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 9816e4ff9..1739892fa 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -211,8 +211,11 @@ Item { } } - property int tasksHeight: mouseHandler.height - property int tasksWidth: mouseHandler.width + //! Real properties are need in order for parabolic effect to be 1px precise perfect. + //! This way moving from Tasks to Applets and vice versa is pretty stable when hovering with parabolic effect. + property real tasksHeight: mouseHandler.height + property real tasksWidth: mouseHandler.width + //updated from Binding property int alignment @@ -1132,7 +1135,7 @@ Item { visible: root.dragAreaEnabled - property int maxSize: ((parabolic.local.lastIndex>=0 || windowPreviewIsShown || animations.hasThicknessAnimation) && !root.dragSource) ? + property int maxSize: (parabolic.local.lastIndex>=0 || windowPreviewIsShown || animations.hasThicknessAnimation) ? (parabolic.factor.maxZoom * metrics.totals.thickness) + metrics.margin.screenEdge : metrics.totals.thickness + metrics.margin.screenEdge diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 3aaf1bf05..cdc0d80da 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -657,6 +657,8 @@ Item{ //////////// Transitions ////////////// + readonly property string draggingNeedThicknessEvent: taskIcon + "_dragging" + transitions: [ Transition{ id: isDraggedTransition @@ -666,8 +668,8 @@ Item{ SequentialAnimation{ ScriptAction{ script: { + taskItem.animations.needThickness.addEvent(draggingNeedThicknessEvent); taskItem.inBlockingAnimation = true; - taskItem.parabolic.startRestoreZoomTimer(); taskItem.parabolic.setDirectRenderingEnabled(false); } } @@ -675,8 +677,8 @@ Item{ PropertyAnimation { target: wrapper property: "mScale" - to: 1 + ((taskItem.parabolic.factor.zoom - 1) / 3) - duration: isDraggedTransition.speed / 2 + to: 1 + duration: taskItem.parabolic.factor.zoom === 1 ? 0 : (isDraggedTransition.speed*1.2) easing.type: Easing.OutQuad } @@ -705,11 +707,19 @@ Item{ easing.type: Easing.OutQuad } } + + ScriptAction{ + script: { + taskItem.animations.needThickness.removeEvent(draggingNeedThicknessEvent); + } + } } onRunningChanged: { if(running){ taskItem.animationStarted(); + } else { + taskItem.animations.needThickness.removeEvent(draggingNeedThicknessEvent); } } },