From cecb2005eac0551338bd21fe0a1e823254bca9d9 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 6 Mar 2022 11:56:25 +0200 Subject: [PATCH] applet:use last mouse event after dock slide-in --this way the parabolic effect works nicely after the dock slides-in. In the past there was a chance that even though mouse was hovering an parabolicable applet the parabolic effect was not started because parabolic event was rejected because the dock was not fully shown yet --- .../contents/ui/applet/ParabolicArea.qml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/containment/package/contents/ui/applet/ParabolicArea.qml b/containment/package/contents/ui/applet/ParabolicArea.qml index d5bf19a6a..3cffe567e 100644 --- a/containment/package/contents/ui/applet/ParabolicArea.qml +++ b/containment/package/contents/ui/applet/ParabolicArea.qml @@ -19,6 +19,7 @@ Item { readonly property bool isThinTooltipEnabled: parabolicAreaLoader.isThinTooltipEnabled property real center: (root.isHorizontal ? appletItem.width : appletItem.height) / 2 + property var lastMousePoint: { "x": 0, "y": 0 } MouseArea { id: parabolicMouseArea @@ -43,6 +44,9 @@ Item { } onParabolicEntered: { + lastMousePoint.x = mouseX; + lastMousePoint.y = mouseY; + if (isThinTooltipEnabled && !(isSeparator || isSpacer || isMarginsAreaSeparator)) { appletItem.thinTooltip.show(appletItem.tooltipVisualParent, applet.title); } @@ -71,6 +75,9 @@ Item { } onParabolicMove: { + lastMousePoint.x = mouseX; + lastMousePoint.y = mouseY; + if (!appletItem.myView.isShownFully || appletItem.originalAppletBehavior || !appletItem.parabolicEffectIsSupported @@ -105,6 +112,20 @@ Item { } } + Connections{ + target: appletItem.myView + + //! During dock sliding-in because the parabolic effect isnt trigerred + //! immediately but we wait first the dock to go to its final normal + //! place we might miss the activation of the parabolic effect. + //! By catching that signal we are trying to solve this. + onIsShownFullyChanged: { + if (appletItem.myView.isShownFully && _parabolicArea.containsMouse) { + _parabolicArea.parabolicMove(_parabolicArea.lastMousePoint.x, _parabolicArea.lastMousePoint.y); + } + } + } + function calculateParabolicScales(currentMousePosition){ if (parabolic.factor.zoom===1 || parabolic.restoreZoomIsBlocked) { return;