improvements to parabolic effect

--issue #852, improve how the two states of zoom-in
and directRendering are indetified and triggered.
The initialization of hovering indexes now is
trigerred only for window mouse out events.
pull/2/head
Michail Vourlakos 7 years ago
parent 036bccb6bd
commit 8cf6f49bb9

@ -550,19 +550,22 @@ Item {
root.showTooltipLabel(container, applet.title);
if (lockZoom || !canBeHovered) {
return;
//console.log("entered applet:" + layoutsContainer.hoveredIndex);
if ((wrapper.zoomScale>=root.midZoomFactor) && (layoutsContainer.hoveredIndex !== -1)
&& !enableDirectRenderTimer.running && !root.globalDirectRender) {
root.setGlobalDirectRender(true);
enableDirectRenderTimer.start();
}
layoutsContainer.hoveredIndex = index;
if (root.isHalfShown || (root.latteApplet && root.latteApplet.noTasksInAnimation>0)) {
if (lockZoom || !canBeHovered) {
return;
}
if ((wrapper.zoomScale>=root.midZoomFactor) && !enableDirectRenderTimer.running && !root.globalDirectRender) {
root.setGlobalDirectRender(true);
enableDirectRenderTimer.start();
if (root.isHalfShown || (root.latteApplet && root.latteApplet.noTasksInAnimation>0)) {
return;
}
if (root.isHorizontal){

@ -446,6 +446,12 @@ DragDrop.DropArea {
}
}
onDockContainsMouseChanged: {
if (!dockContainsMouse) {
initializeHoveredIndexes();
}
}
onDragEnter: {
if (plasmoid.immutable) {
event.ignore();
@ -875,8 +881,8 @@ DragDrop.DropArea {
}
function clearZoom(){
layoutsContainer.currentSpot = -1000;
layoutsContainer.hoveredIndex = -1;
//layoutsContainer.currentSpot = -1000;
//layoutsContainer.hoveredIndex = -1;
if (latteApplet){
latteApplet.clearZoom();
@ -931,6 +937,13 @@ DragDrop.DropArea {
return splitters;
}
function initializeHoveredIndexes() {
layoutsContainer.hoveredIndex = -1;
layoutsContainer.currentSpot = -1000;
if (latteApplet) {
latteApplet.initializeHoveredIndex();
}
}
function mouseInCanBeHoveredApplet(){
if (latteApplet && latteApplet.containsMouse())
@ -1248,7 +1261,7 @@ DragDrop.DropArea {
if (!dock.contextMenuIsShown) {
checkRestoreZoom.start();
} else {
root.globalDirectRender = false;
root.setGlobalDirectRender(false);
}
}
}
@ -1414,6 +1427,8 @@ DragDrop.DropArea {
anchors.fill: parent
hoverEnabled: true
onEntered: {
initializeHoveredIndexes();
if(!root.editMode)
checkRestoreZoom.start();
}
@ -1507,8 +1522,7 @@ DragDrop.DropArea {
//Timer to check if the mouse is still outside the dock in order to restore zooms to 1.0
Timer{
id:checkRestoreZoom
repeat:false;
interval: 150;
interval: 25
onTriggered: {
if (latteApplet && (latteApplet.previewContainsMouse() || latteApplet.contextMenu))
@ -1539,13 +1553,14 @@ DragDrop.DropArea {
//during first hovering phase
Timer {
id: enableDirectRenderTimer
interval: 4 * root.durationTime * units.shortDuration
interval: checkRestoreZoom.interval //4 * root.durationTime * units.shortDuration
onTriggered: {
if (latteApplet && latteApplet.waitingLaunchers.length > 0)
return;
if (dock.visibility.containsMouse)
root.globalDirectRender = true;
if (dock.visibility.containsMouse && !rootMouseArea.containsMouse){
setGlobalDirectRender(true);
}
if (root.debugModeTimers) {
console.log("containment timer: enableDirectRenderTimer called...");

@ -289,6 +289,11 @@ Item {
}
/////
function initializeHoveredIndex() {
icList.hoveredIndex = -1;
icList.currentSpot = -1000;
}
function launchersDropped(urls){
mouseHandler.urlsDroppedOnArea(urls);
}
@ -796,8 +801,7 @@ Item {
icList.directRender = false;
if(root.latteDock) {
root.latteDock.globalDirectRender = false;
root.latteDock.clearZoom();
root.latteDock.startEnableDirectRenderTimer();
}
root.clearZoom();
@ -1563,8 +1567,9 @@ Item {
if (!previewContainsMouse())
windowsPreviewDlg.hide(4);
icList.currentSpot = -1000;
icList.hoveredIndex = -1;
if (!latteDock) {
initializeHoveredIndex();
}
root.clearZoomSignal();
}
@ -1591,7 +1596,7 @@ Item {
function startEnableDirectRenderTimer() {
if (latteDock) {
latteDock.setGlobalDirectRender(true);
// latteDock.setGlobalDirectRender(true);
latteDock.startEnableDirectRenderTimer();
} else {
enableDirectRenderTimer.start();

@ -493,6 +493,15 @@ MouseArea{
if (root.editMode)
return;
// console.log("entered task:" + icList.hoveredIndex);
if ((wrapper.mScale>=root.midZoomFactor) && (icList.hoveredIndex!==-1 || icList.hoveredIndex===index)
&& !root.directRenderTimerIsRunning && !root.globalDirectRender) {
root.startEnableDirectRenderTimer();
}
icList.hoveredIndex = index;
if ((icList.hoveredIndex !== itemIndex) && isLauncher && windowsPreviewDlg.visible) {
windowsPreviewDlg.hide(1);
}
@ -504,16 +513,11 @@ MouseArea{
return;
}
if ((wrapper.mScale>=root.midZoomFactor) && !root.directRenderTimerIsRunning && !root.globalDirectRender) {
root.startEnableDirectRenderTimer();
}
if (root.latteDock && (!root.showPreviews || (root.showPreviews && isLauncher))){
root.latteDock.showTooltipLabel(mainItemContainer, model.AppName);
}
if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){
icList.hoveredIndex = index;
if (inAttentionAnimation) {
var subSpacerScale = (root.zoomFactor-1)/2;
hiddenSpacerLeft.nScale = subSpacerScale;
@ -567,12 +571,12 @@ MouseArea{
}
if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && hoverEnabled){
icList.hoveredIndex = index;
if( ((wrapper.mScale == 1 || wrapper.mScale === root.zoomFactor) && !root.globalDirectRender) || root.globalDirectRender) {
if(root.dragSource == null){
if (icList.orientation == Qt.Horizontal){
var step = Math.abs(icList.currentSpot-mouse.x);
if (step >= root.animationStep){
icList.hoveredIndex = index;
icList.currentSpot = mouse.x;
wrapper.calculateScales(mouse.x);
@ -581,7 +585,6 @@ MouseArea{
else{
var step = Math.abs(icList.currentSpot-mouse.y);
if (step >= root.animationStep){
icList.hoveredIndex = index;
icList.currentSpot = mouse.y;
wrapper.calculateScales(mouse.y);

Loading…
Cancel
Save