1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

avoid multiple model creations.

This commit is contained in:
audoban 2017-03-26 21:07:13 -05:00
parent 06394d01ff
commit 601b3933b5

View File

@ -156,19 +156,32 @@ PlasmaExtras.ScrollArea {
width: isGroup ? childrenRect.width : 0
height: isGroup ? childrenRect.height : 0
visible: isGroup
visible: isGroup && parentIndex !== -1
Repeater {
id: groupRepeater
model: DelegateModel {
model: tasksModel
rootIndex: tasksModel.makeModelIndex(parentIndex, -1)
delegate: ToolTipInstance {}
Loader {
id: modelLoader
active: groupTask.visible
sourceComponent: Repeater {
id: groupRepeater
model: DelegateModel {
id: delegateModel
model: parentIndex !== -1 && isGroup ? tasksModel : undefined
rootIndex: tasksModel.makeModelIndex(parentIndex, -1)
delegate: ToolTipInstance {}
}
Component.onCompleted: {
parent = groupTask
}
}
}
function containsMouse(){
for(var i=0; i<children.length-1; ++i){
for(var i=1; i<children.length-1; ++i) {
if(children[i].containsMouse())
return true;
}