From b510fdcdb58d7d4ab842e81d3e9ae28ca2a1dd3a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 8 Jan 2017 18:53:36 +0200 Subject: [PATCH] clean plasmoid zoom in spesific cases --fixes a small issue when hovering applets too fast sometimes the tasks inside the plasmoid didnt catch up to restore their zoom --- containment/contents/ui/AppletItem.qml | 19 +++++++++++++++++-- containment/contents/ui/main.qml | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/containment/contents/ui/AppletItem.qml b/containment/contents/ui/AppletItem.qml index 0f1b188cb..fa64a2ed8 100644 --- a/containment/contents/ui/AppletItem.qml +++ b/containment/contents/ui/AppletItem.qml @@ -49,7 +49,7 @@ Item { (index === secondLayout.beginIndex)&&(secondLayout.count > 1) //applet is in ending edge property bool endEdge: plasmoid.configuration.panelPosition !== Latte.Dock.Justify ? (index === mainLayout.count - 1)&&(mainLayout.count>1) : - ((index === mainLayout.count - 2)&&(mainLayout.count>2))||((index === secondLayout.beginIndex+secondLayout.count-1)&&(secondLayout.count>1)) + ((index === mainLayout.count - 2)&&(mainLayout.count>2))||((index === secondLayout.beginIndex+secondLayout.count-1)&&(secondLayout.count>1)) @@ -90,6 +90,12 @@ Item { console.log(computeHeight); }*/ + onIndexChanged: { + if (container.nowDock) { + root.latteAppletPos = index; + } + } + /// BEGIN functions function checkIndex(){ index = -1; @@ -174,6 +180,7 @@ Item { if(container.nowDock){ root.nowDock = container.nowDock; root.nowDockContainer = container; + root.latteAppletPos = index; nowDock.nowDockPanel = root; nowDock.forceHidePanel = true; nowDock.updateScale.connect(interceptNowDockUpdateScale); @@ -655,6 +662,14 @@ Item { // currentLayout.updateScale(index-2, 1, 0); // currentLayout.updateScale(index+2, 1, 0); + if (root.nowDock) { + if ((index-1) > root.latteAppletPos ){ + root.nowDock.clearZoom(); + } else if((index+1)=container.index) { + } else if(layoutsContainer.hoveredIndex>container.index) { nowDock.updateScale(root.tasksCount-1, nScale, step); nowDock.updateScale(root.tasksCount-2, 1, 0); } diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index af8467001..cf170d24e 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -69,6 +69,7 @@ DragDrop.DropArea { property int iconSize: (automaticIconSizeBasedSize > 0 && !root.editMode) ? Math.min(automaticIconSizeBasedSize, plasmoid.configuration.iconSize) : plasmoid.configuration.iconSize property int iconStep: 8 + property int latteAppletPos: -1 property int panelEdgeSpacing: iconSize / 3 //FIXME: this is not needed any more probably property int previousAllTasks: -1 //is used to forbit updateAutomaticIconSize when hovering