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
work/usta_fix_ecm_version_check
Michail Vourlakos 3 years ago
parent 21d8728498
commit 3f90a49b55

@ -19,6 +19,7 @@ Item {
readonly property bool isThinTooltipEnabled: parabolicAreaLoader.isThinTooltipEnabled
property real length: root.isHorizontal ? appletItem.width : appletItem.height
property var lastMousePoint: { "x": 0, "y": 0 }
MouseArea {
id: parabolicMouseArea
@ -53,6 +54,9 @@ Item {
}
onParabolicEntered: {
lastMousePoint.x = mouseX;
lastMousePoint.y = mouseY;
if (isThinTooltipEnabled && !(isSeparator || isSpacer || isMarginsAreaSeparator)) {
appletItem.thinTooltip.show(appletItem.tooltipVisualParent, applet.title);
}
@ -81,6 +85,9 @@ Item {
}
onParabolicMove: {
lastMousePoint.x = mouseX;
lastMousePoint.y = mouseY;
if (!appletItem.myView.isShownFully
|| appletItem.originalAppletBehavior
|| !appletItem.parabolicEffectIsSupported
@ -115,6 +122,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;

Loading…
Cancel
Save