From b30caca1728e3ddce4ebbe3e5705d3d515de7bc5 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Nov 2017 16:07:36 +0200 Subject: [PATCH] fix contextmenu blocking parab.effect --- plasmoid/package/contents/ui/ContextMenu.qml | 14 +++++++++++++- plasmoid/package/contents/ui/ParabolicManager.qml | 12 ++++++++---- plasmoid/package/contents/ui/main.qml | 4 ++-- plasmoid/package/contents/ui/task/TaskDelegate.qml | 2 +- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/plasmoid/package/contents/ui/ContextMenu.qml b/plasmoid/package/contents/ui/ContextMenu.qml index 31a7d56cc..1868cd0fc 100644 --- a/plasmoid/package/contents/ui/ContextMenu.qml +++ b/plasmoid/package/contents/ui/ContextMenu.qml @@ -774,7 +774,19 @@ PlasmaComponents.ContextMenu { text: i18n("Add Internal Separator") onClicked: { - root.addSeparator(visualParent.itemIndex); + var pos=visualParent.itemIndex; + + var separatorName = parabolicManager.freeAvailableSeparatorName(); + + if (separatorName !== "") { + parabolicManager.addLauncherToBeMoved(separatorName, Math.max(0,pos)); + + if (latteDock && latteDock.launchersGroup >= Latte.Dock.LayoutLaunchers) { + latteDock.universalLayoutManager.launchersSignals.addLauncher(latteDock.launchersGroup, separatorName); + } else { + tasksModel.requestAddLauncher(separatorName); + } + } } } diff --git a/plasmoid/package/contents/ui/ParabolicManager.qml b/plasmoid/package/contents/ui/ParabolicManager.qml index 142f799de..54d2949b1 100644 --- a/plasmoid/package/contents/ui/ParabolicManager.qml +++ b/plasmoid/package/contents/ui/ParabolicManager.qml @@ -471,7 +471,7 @@ Item { //! launchersToBeMoved, new launchers to have been added and must be repositioned function addLauncherToBeMoved(launcherUrl, toPos) { - if (!hasLauncherToBeMoved(launcherUrl)) { + if (!isLauncherToBeMoved(launcherUrl)) { launchersToBeMoved.push({launcher: launcherUrl, pos: Math.max(0,toPos)}); //console.log("-add launcher-"); //printLaunchersToBeMoved() @@ -485,7 +485,7 @@ Item { } function moveLauncherToCorrectPos(launcherUrl, from) { - if (hasLauncherToBeMoved(launcherUrl)) { + if (isLauncherToBeMoved(launcherUrl)) { launchersToBeMovedTimer.from = from; launchersToBeMovedTimer.to = posOfLauncherToBeMoved(launcherUrl); launchersToBeMovedTimer.launcherUrl = launcherUrl @@ -496,7 +496,7 @@ Item { } function removeLauncherToBeMoved(launcherUrl) { - if (hasLauncherToBeMoved(launcherUrl)) { + if (isLauncherToBeMoved(launcherUrl)) { var sLength = launchersToBeMoved.length; var index = -1; @@ -533,7 +533,7 @@ Item { return -1; } - function hasLauncherToBeMoved(launcher) { + function isLauncherToBeMoved(launcher) { return (posOfLauncherToBeMoved(launcher) >= 0); } @@ -555,6 +555,10 @@ Item { latteDock.universalLayoutManager.launchersSignals.moveTask(plasmoid.id, latteDock.launchersGroup, from, to); } + if (isSeparator(launcherUrl)) { + setSeparator(launcherUrl,to); + } + tasksModel.syncLaunchers(); } } diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 44d4caa69..dd08ceefd 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -777,7 +777,7 @@ Item { if(root.latteDock) console.log("Plasmoid, checkListHoveredTimer was called, even though it shouldnt..."); - if (!root.containsMouse()) { + if ((latteDock && !latteDock.dockContainsMouse) || !root.containsMouse()) { if (enableDirectRenderTimer.running) enableDirectRenderTimer.stop(); @@ -1488,8 +1488,8 @@ Item { for(var i=0; i=0) { + if (parabolicManager.isLauncherToBeMoved(launcherUrl) && itemIndex>=0) { parabolicManager.moveLauncherToCorrectPos(launcherUrl, itemIndex); } } else {