improve code for enable/disable checkRestoreZoom

pull/2/head
Michail Vourlakos 7 years ago
parent cb6d7bda74
commit 5b3c00ff8c

@ -564,6 +564,10 @@ Item {
onEntered: {
//AppletIndetifier.reconsiderAppletIconItem();
if (containsMouse && !container.lockZoom && container.canBeHovered){
root.stopCheckRestoreZoomTimer();
}
if (restoreAnimation.running) {
restoreAnimation.stop();
}
@ -613,7 +617,7 @@ Item {
root.hideTooltipLabel();
if (root.zoomFactor>1){
checkRestoreZoom.start();
root.startCheckRestoreZoomTimer();
}
}

@ -1112,6 +1112,10 @@ DragDrop.DropArea {
checkRestoreZoom.start();
}
function stopCheckRestoreZoomTimer(){
checkRestoreZoom.stop();
}
function setGlobalDirectRender(value) {
if (latteApplet && latteApplet.waitingLaunchers.length > 0)
return;
@ -1308,11 +1312,10 @@ DragDrop.DropArea {
ignoreUnknownSignals : true
onContainsMouseChanged: {
if (dock.visibility.containsMouse) {
if (checkRestoreZoom.running)
checkRestoreZoom.stop();
if (mouseInHoverableArea()) {
stopCheckRestoreZoomTimer();
} else {
checkRestoreZoom.start();
startCheckRestoreZoomTimer();
}
}
}
@ -1465,11 +1468,14 @@ DragDrop.DropArea {
id: rootMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered: {
initializeHoveredIndexes();
if(!root.editMode)
checkRestoreZoom.start();
onContainsMouseChanged: {
if (mouseInHoverableArea()) {
stopCheckRestoreZoomTimer();
} else {
initializeHoveredIndexes();
startCheckRestoreZoomTimer()
}
}
}
@ -1580,9 +1586,6 @@ DragDrop.DropArea {
return;
if (!mouseInHoverableArea()) {
if (enableDirectRenderTimer.running)
enableDirectRenderTimer.stop();
setGlobalDirectRender(false);
root.initializeHoveredIndexes();
root.clearZoom();
@ -1594,27 +1597,6 @@ DragDrop.DropArea {
}
}
//this timer adds a delay into enabling direct rendering...
//it gives the time to neighbour tasks to complete their animation
//during first hovering phase
Timer {
id: enableDirectRenderTimer
interval: 0 //checkRestoreZoom.interval + 20 //4 * root.durationTime * units.shortDuration
onTriggered: {
/* if (latteApplet && latteApplet.waitingLaunchers.length > 0)
return;
if (dock.visibility.containsMouse && !rootMouseArea.containsMouse && mouseInCanBeHoveredApplet()){
setGlobalDirectRender(true);
}
if (root.debugModeTimers) {
console.log("containment timer: enableDirectRenderTimer called...");
}*/
}
}
//this is a delayer to update mask area, it is used in cases
//that animations can not catch up with animations signals
//e.g. the automaicIconSize case

@ -1621,11 +1621,23 @@ Item {
}
}
function startCheckRestoreZoomTimer() {
function startCheckRestoreZoomTimer(duration) {
if (latteDock) {
latteDock.startCheckRestoreZoomTimer();
} else {
checkListHovered.startNormal();
if (duration > 0) {
checkListHovered.startDuration(duration);
} else {
checkListHovered.startNormal();
}
}
}
function stopCheckRestoreZoomTimer() {
if (latteDock) {
latteDock.stopCheckRestoreZoomTimer();
} else {
checkListHovered.stop();
}
}

@ -504,6 +504,8 @@ MouseArea{
if (root.editMode)
return;
root.stopCheckRestoreZoomTimer();
if (restoreAnimation.running) {
restoreAnimation.stop();
}
@ -525,9 +527,6 @@ MouseArea{
icList.hoveredIndex = index;
}
if(!root.latteDock)
checkListHovered.stop();
if (root.latteDock && (!root.showPreviews || (root.showPreviews && isLauncher))){
root.latteDock.showTooltipLabel(mainItemContainer, model.AppName);
}
@ -588,8 +587,7 @@ MouseArea{
if (root.editMode || (inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation||inMimicParabolicAnimation)))
return;
if(!root.latteDock)
checkListHovered.stop();
root.stopCheckRestoreZoomTimer();
if (root.latteDock && root.latteDock.isHalfShown) {
return;
@ -784,8 +782,9 @@ MouseArea{
pressed = false;
if(!inAnimation && !root.latteDock)
checkListHovered.startDuration(3*units.longDuration);
if(!inAnimation) {
startCheckRestoreZoomTimer(3*units.longDuration);
}
}
onWheel: {
@ -845,7 +844,6 @@ MouseArea{
function animationEnded(){
// console.log("Animation ended: " + index);
inAnimation = false;
// checkListHovered.startDuration(3*units.longDuration);
}
function clearZoom(){

Loading…
Cancel
Save