taskswitcher: add delay for tasks reordering

This commit is contained in:
Yari Polla 2022-04-29 01:39:29 +02:00 committed by Devin Lin
parent 8f1289139f
commit 02bc67af81
2 changed files with 19 additions and 0 deletions

View file

@ -46,6 +46,7 @@ Item {
}
function activateApp() {
taskSwitcherState.wasInActiveTask = false;
taskSwitcher.activateWindow(model.index);
}
//END functions

View file

@ -73,6 +73,14 @@ Item {
oldTasksCount = tasksCount;
}
Timer {
id: reorderTimer
interval: 5000
onTriggered: tasksModel.taskReorderingEnabled = true
}
//BEGIN functions
function show(animation) {
@ -83,6 +91,9 @@ Item {
taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0;
taskSwitcherState.currentlyBeingOpened = true;
reorderTimer.stop();
tasksModel.taskReorderingEnabled = false;
// skip to first active task
if (taskSwitcherState.wasInActiveTask) {
taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row);
@ -140,6 +151,12 @@ Item {
}
instantHide();
if (taskSwitcherState.wasInActiveTask) {
reorderTimer.restart();
} else {
tasksModel.taskReorderingEnabled = true;
}
}
function minimizeAll() {
@ -156,6 +173,7 @@ Item {
easing.type: Easing.InOutQuad
onFinished: {
root.visible = false;
tasksModel.taskReorderingEnabled = true;
}
}