diff --git a/containment/contents/ui/DebugWindow.qml b/containment/contents/ui/DebugWindow.qml index 187164bc8..f9aff63ab 100644 --- a/containment/contents/ui/DebugWindow.qml +++ b/containment/contents/ui/DebugWindow.qml @@ -115,16 +115,11 @@ Window{ } Text{ - text: "Block Hiding (flag)"+space + text: "Actions Block Hiding "+space } Text{ - text: { - if (dock.visibility.blockHiding) - return "Yes"; - else - return "No"; - } + text: root.actionsBlockHiding } Text{ diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index a9f1b3d12..577466e71 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -65,6 +65,7 @@ DragDrop.DropArea { property bool smallAutomaticIconJumps: true property bool useThemePanel: noApplets === 0 ? true : plasmoid.configuration.useThemePanel + property int actionsBlockHiding: 0 //actions that block hiding property int animationsNeedBothAxis:0 //animations need space in both axes, e.g zooming a task property int animationsNeedLength: 0 // animations need length, e.g. adding a task @@ -458,7 +459,7 @@ DragDrop.DropArea { latteApplet.signalAnimationsNeedBothAxis.connect(slotAnimationsNeedBothAxis); latteApplet.signalAnimationsNeedLength.connect(slotAnimationsNeedLength); latteApplet.signalAnimationsNeedThickness.connect(slotAnimationsNeedThickness); - latteApplet.signalDraggingState.connect(slotDisableHiding); + latteApplet.signalActionsBlockHiding.connect(slotActionsBlockHiding); } } @@ -882,12 +883,23 @@ DragDrop.DropArea { //this is used when dragging a task in order to not hide the dock //and also by the menu appearing from tasks for the same reason - function slotDisableHiding(value) { - if (root.editMode) { + function slotActionsBlockHiding(step) { + //if (root.editMode) { + // return; + // } + + if ((step === 0) || (!dock)) { return; } - dock.visibility.blockHiding = value; + actionsBlockHiding = Math.max(actionsBlockHiding + step, 0); + + if (actionsBlockHiding > 0){ + dock.visibility.blockHiding = true; + } else { + if (!root.editMode) + dock.visibility.blockHiding = false; + } } function updateAutomaticIconSize() { diff --git a/plasmoid/contents/ui/ContextMenu.qml b/plasmoid/contents/ui/ContextMenu.qml index 79b812aae..481383420 100644 --- a/plasmoid/contents/ui/ContextMenu.qml +++ b/plasmoid/contents/ui/ContextMenu.qml @@ -62,7 +62,8 @@ PlasmaComponents.ContextMenu { function show() { //trying to use the dragging mechanism in order to not hide the dock root.disableRestoreZoom = true; - root.signalDraggingState(true); + root.signalActionsBlockHiding(1); + //root.signalDraggingState(true); loadDynamicLaunchActions(visualParent.m.LauncherUrlWithoutIcon); // backend.ungrabMouse(visualParent); openRelative(); @@ -206,7 +207,8 @@ PlasmaComponents.ContextMenu { Component.onDestruction: { backend.ungrabMouse(visualParent); - root.signalDraggingState(false); + root.signalActionsBlockHiding(-1); + //root.signalDraggingState(false); root.disableRestoreZoom = false; checkListHovered.startDuration(100); } diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 5ba343025..562613fa5 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -130,10 +130,11 @@ Item { signal mouseWasEntered(int delegateIndex, bool value); signal presentWindows(variant winIds); signal requestLayout; + signal signalActionsBlockHiding(int value); signal signalAnimationsNeedBothAxis(int value); signal signalAnimationsNeedLength(int value); signal signalAnimationsNeedThickness(int value); - signal signalDraggingState(bool value); + //signal signalDraggingState(bool value); signal showPreviewForTasks(QtObject group); //trigger updating scaling of neighbour delegates of zoomed delegate signal updateScale(int delegateIndex, real newScale, real step) @@ -181,11 +182,13 @@ Item { onDragSourceChanged: { if (dragSource == null) { root.draggingFinished(); - root.signalDraggingState(false); + root.signalActionsBlockHiding(-1); + //root.signalDraggingState(false); tasksModel.syncLaunchers(); } else { - root.signalDraggingState(true); + root.signalActionsBlockHiding(1); + //root.signalDraggingState(true); } } @@ -211,14 +214,17 @@ Item { mainItem: toolTipDelegate visible: false + property bool signalSent: false property Item activeItem: null function hide(debug){ //console.log("on hide event called: "+debug); - if (latteDock) { + if (latteDock && signalSent) { //it is used to unblock dock hiding - root.signalDraggingState(false); + root.signalActionsBlockHiding(-1); + signalSent = false; + //root.signalDraggingState(false); } windowsPreviewDlg.activeItem = null; @@ -244,9 +250,11 @@ Item { activeItem = taskItem; toolTipDelegate.parentTask = taskItem; - if (latteDock) { + if (latteDock && !signalSent) { //it is used to block dock hiding - root.signalDraggingState(true); + root.signalActionsBlockHiding(1); + signalSent = true; + //root.signalDraggingState(true); } //small delay to show in order to not mess up with the buffers clearing