mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
taskswitcher: add delay for tasks reordering
This commit is contained in:
parent
8f1289139f
commit
02bc67af81
2 changed files with 19 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ Item {
|
|||
}
|
||||
|
||||
function activateApp() {
|
||||
taskSwitcherState.wasInActiveTask = false;
|
||||
taskSwitcher.activateWindow(model.index);
|
||||
}
|
||||
//END functions
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue