diff --git a/plasmoid/contents/ui/ToolTipDelegate2.qml b/plasmoid/contents/ui/ToolTipDelegate2.qml index 4ac1e2ac4..e9471cb4a 100644 --- a/plasmoid/contents/ui/ToolTipDelegate2.qml +++ b/plasmoid/contents/ui/ToolTipDelegate2.qml @@ -80,35 +80,8 @@ PlasmaExtras.ScrollArea { return isVerticalPanel ? contentItem.height > viewport.height : contentItem.width > viewport.width }); } - - MouseArea { - id: contentItem - width: childrenRect.width - height: childrenRect.height - - hoverEnabled: true - - onContainsMouseChanged: { - checkMouseInside(); - } - - function checkMouseInside(){ - var isInside = containsMouse || childrenContainMouse(); - if (isInside){ - root.disableRestoreZoom = true; - checkListHovered.stop(); - toolTipDelegate.currentItem = parentIndex; - } - else{ - root.disableRestoreZoom = false; - toolTipDelegate.currentItem = -1; - checkListHovered.restart(); - } - } - - function childrenContainMouse() { - return singleTask.containsMouse() || groupTask.containsMouse(); - } + Item{ + anchors.fill: contentItem DropArea { id: dropMainArea @@ -135,58 +108,88 @@ PlasmaExtras.ScrollArea { } } - ToolTipInstance { - id: singleTask - visible: !isGroup - } + MouseArea { + id: contentItem + width: childrenRect.width + height: childrenRect.height - Grid { - id: groupTask - rows: !isVerticalPanel - columns: isVerticalPanel - flow: isVerticalPanel ? Grid.TopToBottom : Grid.LeftToRight - spacing: units.largeSpacing - - visible: isGroup - - Repeater { - id: groupRepeater - model: DelegateModel { - model: tasksModel - rootIndex: tasksModel.makeModelIndex(parentIndex, -1) - delegate: ToolTipInstance {} - } + hoverEnabled: true + + onContainsMouseChanged: { + checkMouseInside(); } - function containsMouse(){ - for(var i=0; i=choords.x) && (x<=choords.x+task.width) - && (y>=choords.y) && (y<=choords.y+task.height)){ - return task; + function childAtPos(x, y){ + var tasks = groupTask.children; + + for(var i=0; i=choords.x) && (x<=choords.x+task.width) + && (y>=choords.y) && (y<=choords.y+task.height)){ + return task; + } } - } - return null; + return null; + } } } }