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
pull/27/head
Michail Vourlakos 3 years ago
parent aec752e722
commit cecb2005ea

@ -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;

Loading…
Cancel
Save