Commit 1ab6ae9a authored by David Edmundson's avatar David Edmundson
Browse files

Revert "Fix tooltip woes"

This reverts commit 24803dc9.

Even though this commit is perfectly sensible it seems to introduce a
crash on startup for Qt 5.10.

Will revert for now, we can revisit later

CCBUG: 382571
CCBUG: 385947
CCBUG: 389469
CCBUG: 388749
parent 6f491642
......@@ -326,7 +326,7 @@ MouseArea {
onContainsMouseChanged: {
if (containsMouse) {
toolTipDelegate.parentTask = task;
toolTipDelegate.rootIndex = tasksModel.makeModelIndex(itemIndex, -1);
toolTipDelegate.parentIndex = itemIndex;
toolTipDelegate.appName = Qt.binding(function() {
return model.AppName;
......
......@@ -33,10 +33,8 @@ import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.taskmanager 0.1 as TaskManager
PlasmaExtras.ScrollArea {
id: toolTipDelegate
property Item parentTask
property var rootIndex
property int parentIndex
property string appName
property int pidParent
......@@ -82,16 +80,14 @@ PlasmaExtras.ScrollArea {
});
}
Component {
id: singleTooltip
Item {
id: contentItem
width: childrenRect.width
height: childrenRect.height
ToolTipInstance {
submodelIndex: toolTipDelegate.rootIndex
visible: !isGroup
}
}
Component {
id: groupToolTip
Grid {
rows: !isVerticalPanel
......@@ -99,28 +95,16 @@ PlasmaExtras.ScrollArea {
flow: isVerticalPanel ? Grid.TopToBottom : Grid.LeftToRight
spacing: units.largeSpacing
visible: isGroup
Repeater {
id: groupRepeater
model: DelegateModel {
model: toolTipDelegate.rootIndex ? tasksModel : null
rootIndex: toolTipDelegate.rootIndex
delegate: ToolTipInstance {
submodelIndex: tasksModel.makeModelIndex(toolTipDelegate.rootIndex.row, index)
}
model: tasksModel
rootIndex: tasksModel.makeModelIndex(parentIndex, -1)
delegate: ToolTipInstance {}
}
}
}
}
Loader {
id: contentItem
active: toolTipDelegate.rootIndex != undefined
asynchronous: true
sourceComponent: isGroup ? groupToolTip : singleTooltip
}
}
......@@ -33,7 +33,7 @@ import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.taskmanager 0.1 as TaskManager
Column {
property var submodelIndex
property var submodelIndex: tasksModel.makeModelIndex(parentIndex, isGroup ? index : -1)
property int flatIndex: isGroup && index != undefined ? index : 0
spacing: units.smallSpacing
......
Supports Markdown
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