Commit 9e1a0670 authored by Fushan Wen's avatar Fushan Wen Committed by Nate Graham
Browse files

taskmanager: Show highlight before ToolTipInstance starts loading for grouped tooltips

For grouped tooltips, if there are many windows in a group, it could
take a long time before all ToolTipInstances are loaded.

Show highlight before ToolTipInstance starts loading to make user feel
less unresponsive.

Note: Will not work when a tooltip is already visible (move directly
from a task to a grouped task)

CCBUG: 433907


(cherry picked from commit 818b1b29)
parent 27e5f4e4
......@@ -338,6 +338,7 @@ MouseArea {
// Only assign different values to mainItem to avoid unnecessary reevaluation
if (mainItem.parentTask !== task) {
mainItem.parentTask = task;
mainItem.isLoaderActive = false;
}
let rootIndex = tasksModel.makeModelIndex(itemIndex, -1);
......@@ -394,6 +395,9 @@ MouseArea {
});
}
}
// For grouped tooltips, show highlight before ToolTipInstance starts loading to make user feel less unresponsive
onAboutToShow: if (mainItem.isGroup) mainItem.isLoaderActive = active
}
}
......
......@@ -30,6 +30,7 @@ PlasmaComponents3.ScrollView {
property string appName
property int pidParent
property bool isGroup
property bool isLoaderActive: false
property var windows
readonly property bool isWin: windows !== undefined
......@@ -104,8 +105,12 @@ PlasmaComponents3.ScrollView {
rootIndex: toolTipDelegate.rootIndex
delegate: ToolTipInstance {
submodelIndex: tasksModel.makeModelIndex(toolTipDelegate.rootIndex.row, index)
delegate: Loader {
active: toolTipDelegate.isLoaderActive
asynchronous: true
sourceComponent: ToolTipInstance {
submodelIndex: tasksModel.makeModelIndex(toolTipDelegate.rootIndex.row, index)
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment