diff --git a/plasmoid/contents/ui/MouseHandler.qml b/plasmoid/contents/ui/MouseHandler.qml index 75cc0fdbf..02d2d2967 100644 --- a/plasmoid/contents/ui/MouseHandler.qml +++ b/plasmoid/contents/ui/MouseHandler.qml @@ -144,9 +144,8 @@ Item { activationTimer.stop(); } - if (hoveredItem && windowsPreviewDlg.visible && toolTipDelegate.currentItem !== hoveredItem.itemIndex ) { - windowsPreviewDlg.hide(); - toolTipDelegate.currentItem=-1; + if (hoveredItem && windowsPreviewDlg.visible && toolTipDelegate.parentIndex !== hoveredItem.itemIndex ) { + windowsPreviewDlg.hide(6); } } @@ -188,7 +187,7 @@ Item { // groupDialog.visible = true; } else if (parent.hoveredItem.m.IsLauncher !== true) { if(windowsPreviewDlg.visible && toolTipDelegate.currentItem !==parent.hoveredItem.itemIndex ) { - windowsPreviewDlg.hide(); + windowsPreviewDlg.hide(5); toolTipDelegate.currentItem=-1; } diff --git a/plasmoid/contents/ui/TaskDelegate.qml b/plasmoid/contents/ui/TaskDelegate.qml index 6b9bfc221..ca29bfe8a 100644 --- a/plasmoid/contents/ui/TaskDelegate.qml +++ b/plasmoid/contents/ui/TaskDelegate.qml @@ -502,8 +502,7 @@ MouseArea{ ///////////////// Mouse Area Events /////////////////// onEntered: { if ((icList.hoveredIndex !== itemIndex) && isLauncher && windowsPreviewDlg.visible) { - windowsPreviewDlg.hide(); - toolTipDelegate.currentItem = -1; + windowsPreviewDlg.hide(1); } checkListHovered.stop(); @@ -623,7 +622,7 @@ MouseArea{ onPressed: { if (windowSystem.compositingActive) { - windowsPreviewDlg.hide(); + windowsPreviewDlg.hide(2); } if ((mouse.button == Qt.LeftButton)||(mouse.button == Qt.MidButton)) { @@ -678,10 +677,10 @@ MouseArea{ root.presentWindows(model.LegacyWinIdList); } else { if ((windowsPreviewDlg.visualParent === mainItemContainer)&&(windowsPreviewDlg.visible)) { - windowsPreviewDlg.hide(); + windowsPreviewDlg.hide(3); } else { preparePreviewWindow(false); - windowsPreviewDlg.show(); + windowsPreviewDlg.show(mainItemContainer); } } } else { @@ -875,7 +874,7 @@ MouseArea{ function slotShowPreviewForTasks(group) { if (group === mainItemContainer) { preparePreviewWindow(true); - windowsPreviewDlg.show(); + windowsPreviewDlg.show(mainItemContainer); } } @@ -1036,11 +1035,10 @@ MouseArea{ repeat: false onTriggered: { - if(mainItemContainer.containsMouse && toolTipDelegate.parentTask !== mainItemContainer){ + if(mainItemContainer.containsMouse && windowsPreviewDlg.activeItem !== mainItemContainer){ //console.log("Hovered Timer...."); mainItemContainer.preparePreviewWindow(false); - windowsPreviewDlg.show(); - //windowsPreviewDlg.visible = true; + windowsPreviewDlg.show(mainItemContainer); } hoveredTimer.destroy(); diff --git a/plasmoid/contents/ui/ToolTipDelegate2.qml b/plasmoid/contents/ui/ToolTipDelegate2.qml index 104bb90f0..cb4b79acc 100644 --- a/plasmoid/contents/ui/ToolTipDelegate2.qml +++ b/plasmoid/contents/ui/ToolTipDelegate2.qml @@ -36,6 +36,7 @@ import org.kde.taskmanager 0.1 as TaskManager PlasmaExtras.ScrollArea { + id: mainToolTip property Item parentTask property int parentIndex @@ -52,6 +53,8 @@ PlasmaExtras.ScrollArea { property bool isLauncher property bool isMinimizedParent + property bool containsMouse: false + // Needed for generateSubtext() property string displayParent property string genericName @@ -121,15 +124,15 @@ PlasmaExtras.ScrollArea { } function checkMouseInside(){ - var isInside = containsMouse || childrenContainMouse(); + var isInside = containsMouse || childrenContainMouse() || parentTask.containsMouse; if (isInside){ root.disableRestoreZoom = true; + mainToolTip.containsMouse = true; checkListHovered.stop(); - toolTipDelegate.currentItem = parentIndex; } else{ root.disableRestoreZoom = false; - toolTipDelegate.currentItem = -1; + mainToolTip.containsMouse = false; checkListHovered.restart(); } } diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 0f5300228..74b4c6a23 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -194,8 +194,6 @@ Item { ToolTipDelegate2 { id: toolTipDelegate visible: false - - property int currentItem: -1 } ////BEGIN interfaces @@ -215,57 +213,55 @@ Item { property Item activeItem: null - function hide(){ + function hide(debug){ + //console.log("on hide event called: "+debug); + if (latteDock) { //it is used to unblock dock hiding root.signalDraggingState(false); } - //console.log("on hide event called..."); - visible = false; - activeItem = null; - initializePreviewComponent.createObject(windowsPreviewDlg); + windowsPreviewDlg.activeItem = null; + toolTipDelegate.parentTask = null; + toolTipDelegate.parentIndex = -1; + toolTipDelegate.windows = []; + toolTipDelegate.isGroup = false; + visible = false; } - function show(){ + function show(taskItem){ //console.log("preview show called..."); - if (activeItem !== toolTipDelegate.parentTask) { - //used to initialize windows previews buffers - visible = false; - - var tasks = icList.contentItem.children; + if (!activeItem || (activeItem !== taskItem)) { + //console.log("preview show called: accepted..."); - for(var i=0; i