Index: applets/taskmanager/package/contents/ui/Task.qml =================================================================== --- applets/taskmanager/package/contents/ui/Task.qml +++ applets/taskmanager/package/contents/ui/Task.qml @@ -75,8 +75,10 @@ if (inPopup) { forceActiveFocus() } + tasks.taskMouseEntered(itemIndex); } else { pressed = false; + tasks.taskMouseLeft(itemIndex); } if (model.IsWindow === true) { @@ -159,6 +161,32 @@ : tasksModel.makeModelIndex(index)); } + function showToolTip() { + toolTipDelegate.parentIndex = itemIndex; + + toolTipDelegate.windows = Qt.binding(function() { + return model.LegacyWinIdList; + }); + toolTipDelegate.mainText = Qt.binding(function() { + return model.display; + }); + toolTipDelegate.icon = Qt.binding(function() { + return model.decoration; + }); + toolTipDelegate.subText = Qt.binding(function() { + return model.IsLauncher === true ? model.GenericName : toolTip.generateSubText(model); + }); + toolTipDelegate.launcherUrl = Qt.binding(function() { + return model.LauncherUrlWithoutIcon; + }); + + toolTip.showToolTip(); + } + + function hideToolTip() { + toolTip.hideToolTip(); + } + Component { id: taskInitComponent @@ -213,29 +241,16 @@ active: !inPopup && !groupDialog.visible && plasmoid.configuration.showToolTips interactive: true + autoShowHide: false location: plasmoid.location mainItem: toolTipDelegate - onContainsMouseChanged: { - if (containsMouse) { - toolTipDelegate.parentIndex = itemIndex; - - toolTipDelegate.windows = Qt.binding(function() { - return model.LegacyWinIdList; - }); - toolTipDelegate.mainText = Qt.binding(function() { - return model.display; - }); - toolTipDelegate.icon = Qt.binding(function() { - return model.decoration; - }); - toolTipDelegate.subText = Qt.binding(function() { - return model.IsLauncher === true ? model.GenericName : toolTip.generateSubText(model); - }); - toolTipDelegate.launcherUrl = Qt.binding(function() { - return model.LauncherUrlWithoutIcon; - }); + onToolTipWindowContainsMouseChanged: { + if (toolTipWindowContainsMouse) { + tasks.taskMouseEntered(itemIndex); + } else { + tasks.taskMouseLeft(itemIndex); } } Index: applets/taskmanager/package/contents/ui/main.qml =================================================================== --- applets/taskmanager/package/contents/ui/main.qml +++ applets/taskmanager/package/contents/ui/main.qml @@ -36,6 +36,8 @@ property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical) property bool iconsOnly: (plasmoid.pluginName == "org.kde.plasma.icontasks") + property QtObject currentToolTipTask: null; + property QtObject futureToolTipTask: null; property QtObject contextMenuComponent: Qt.createComponent("ContextMenu.qml"); @@ -395,6 +397,46 @@ return menu; } + Timer { + id: toolTipShowTimer + + interval: 300 + repeat: false + + onTriggered: { + currentToolTipTask = futureToolTipTask; + currentToolTipTask.showToolTip(); + } + } + + Timer { + id: toolTipHideTimer + + interval: 300 + repeat: false + + onTriggered: { + currentToolTipTask.hideToolTip(); + currentToolTipTask = null; + } + } + + function taskMouseEntered(itemIndex) { + var task = taskRepeater.itemAt(itemIndex); + toolTipHideTimer.stop(); + toolTipShowTimer.stop(); + + if(task != currentToolTipTask) { + futureToolTipTask = task; + toolTipShowTimer.start(); + } + } + + function taskMouseLeft(itemIndex) { + toolTipShowTimer.stop(); + toolTipHideTimer.restart(); + } + Component.onCompleted: { tasks.requestLayout.connect(layoutTimer.restart); tasks.requestLayout.connect(iconGeometryTimer.restart);