fix contextmenu blocking parab.effect

pull/2/head
Michail Vourlakos 7 years ago
parent f2f2a469d3
commit b30caca172

@ -774,7 +774,19 @@ PlasmaComponents.ContextMenu {
text: i18n("Add Internal Separator") text: i18n("Add Internal Separator")
onClicked: { 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);
}
}
} }
} }

@ -471,7 +471,7 @@ Item {
//! launchersToBeMoved, new launchers to have been added and must be repositioned //! launchersToBeMoved, new launchers to have been added and must be repositioned
function addLauncherToBeMoved(launcherUrl, toPos) { function addLauncherToBeMoved(launcherUrl, toPos) {
if (!hasLauncherToBeMoved(launcherUrl)) { if (!isLauncherToBeMoved(launcherUrl)) {
launchersToBeMoved.push({launcher: launcherUrl, pos: Math.max(0,toPos)}); launchersToBeMoved.push({launcher: launcherUrl, pos: Math.max(0,toPos)});
//console.log("-add launcher-"); //console.log("-add launcher-");
//printLaunchersToBeMoved() //printLaunchersToBeMoved()
@ -485,7 +485,7 @@ Item {
} }
function moveLauncherToCorrectPos(launcherUrl, from) { function moveLauncherToCorrectPos(launcherUrl, from) {
if (hasLauncherToBeMoved(launcherUrl)) { if (isLauncherToBeMoved(launcherUrl)) {
launchersToBeMovedTimer.from = from; launchersToBeMovedTimer.from = from;
launchersToBeMovedTimer.to = posOfLauncherToBeMoved(launcherUrl); launchersToBeMovedTimer.to = posOfLauncherToBeMoved(launcherUrl);
launchersToBeMovedTimer.launcherUrl = launcherUrl launchersToBeMovedTimer.launcherUrl = launcherUrl
@ -496,7 +496,7 @@ Item {
} }
function removeLauncherToBeMoved(launcherUrl) { function removeLauncherToBeMoved(launcherUrl) {
if (hasLauncherToBeMoved(launcherUrl)) { if (isLauncherToBeMoved(launcherUrl)) {
var sLength = launchersToBeMoved.length; var sLength = launchersToBeMoved.length;
var index = -1; var index = -1;
@ -533,7 +533,7 @@ Item {
return -1; return -1;
} }
function hasLauncherToBeMoved(launcher) { function isLauncherToBeMoved(launcher) {
return (posOfLauncherToBeMoved(launcher) >= 0); return (posOfLauncherToBeMoved(launcher) >= 0);
} }
@ -555,6 +555,10 @@ Item {
latteDock.universalLayoutManager.launchersSignals.moveTask(plasmoid.id, latteDock.launchersGroup, from, to); latteDock.universalLayoutManager.launchersSignals.moveTask(plasmoid.id, latteDock.launchersGroup, from, to);
} }
if (isSeparator(launcherUrl)) {
setSeparator(launcherUrl,to);
}
tasksModel.syncLaunchers(); tasksModel.syncLaunchers();
} }
} }

@ -777,7 +777,7 @@ Item {
if(root.latteDock) if(root.latteDock)
console.log("Plasmoid, checkListHoveredTimer was called, even though it shouldnt..."); console.log("Plasmoid, checkListHoveredTimer was called, even though it shouldnt...");
if (!root.containsMouse()) { if ((latteDock && !latteDock.dockContainsMouse) || !root.containsMouse()) {
if (enableDirectRenderTimer.running) if (enableDirectRenderTimer.running)
enableDirectRenderTimer.stop(); enableDirectRenderTimer.stop();
@ -1488,8 +1488,8 @@ Item {
for(var i=0; i<tasks.length; ++i){ for(var i=0; i<tasks.length; ++i){
var task = tasks[i]; var task = tasks[i];
// console.log("Checking "+i+" - "+task.index+" - "+task.containsMouse);
if(task && task.containsMouse){ if(task && task.containsMouse){
// console.log("Checking "+i+" - "+task.index+" - "+task.containsMouse);
return true; return true;
} }
} }

@ -455,7 +455,7 @@ MouseArea{
if (isSeparator) { if (isSeparator) {
parabolicManager.setSeparator(launcherUrl, itemIndex); parabolicManager.setSeparator(launcherUrl, itemIndex);
if (parabolicManager.hasLauncherToBeMoved(launcherUrl) && itemIndex>=0) { if (parabolicManager.isLauncherToBeMoved(launcherUrl) && itemIndex>=0) {
parabolicManager.moveLauncherToCorrectPos(launcherUrl, itemIndex); parabolicManager.moveLauncherToCorrectPos(launcherUrl, itemIndex);
} }
} else { } else {

Loading…
Cancel
Save