Verified Commit 1e522274 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/taskmanager: use layoutTimer to update layout

This reduces the glitches caused by layout().

BUG: 431615
FIXED-IN: 5.26
parent fe5b6c88
Pipeline #207263 passed with stage
in 2 minutes and 44 seconds
......@@ -331,7 +331,7 @@ MouseArea {
tasksModel.groupingLauncherUrlBlacklist = plasmoid.configuration.groupingLauncherUrlBlacklist;
}
function onIconSpacingChanged() {
taskList.layout();
layoutTimer.restart();
}
}
......@@ -424,31 +424,27 @@ MouseArea {
onWidthChanged: layoutTimer.restart()
onHeightChanged: layoutTimer.restart()
function layout() {
LayoutManager.layout(taskRepeater);
}
Timer {
id: layoutTimer
interval: 0
interval: PlasmaCore.Units.longDuration // Same as animation
repeat: false
onTriggered: taskList.layout()
onTriggered: LayoutManager.layout(taskRepeater)
}
Repeater {
id: taskRepeater
delegate: Task {}
onItemAdded: taskList.layout()
onItemAdded: layoutTimer.restart()
onItemRemoved: {
if (tasks.containsMouse && index != taskRepeater.count &&
item.winIdList && item.winIdList.length > 0 &&
taskClosedWithMouseMiddleButton.indexOf(item.winIdList[0]) > -1) {
needLayoutRefresh = true;
} else {
taskList.layout();
layoutTimer.restart();
}
taskClosedWithMouseMiddleButton = [];
}
......
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