mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 02:04:45 +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() {
|
function activateApp() {
|
||||||
|
taskSwitcherState.wasInActiveTask = false;
|
||||||
taskSwitcher.activateWindow(model.index);
|
taskSwitcher.activateWindow(model.index);
|
||||||
}
|
}
|
||||||
//END functions
|
//END functions
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,14 @@ Item {
|
||||||
oldTasksCount = tasksCount;
|
oldTasksCount = tasksCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: reorderTimer
|
||||||
|
|
||||||
|
interval: 5000
|
||||||
|
|
||||||
|
onTriggered: tasksModel.taskReorderingEnabled = true
|
||||||
|
}
|
||||||
|
|
||||||
//BEGIN functions
|
//BEGIN functions
|
||||||
|
|
||||||
function show(animation) {
|
function show(animation) {
|
||||||
|
|
@ -83,6 +91,9 @@ Item {
|
||||||
taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0;
|
taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0;
|
||||||
taskSwitcherState.currentlyBeingOpened = true;
|
taskSwitcherState.currentlyBeingOpened = true;
|
||||||
|
|
||||||
|
reorderTimer.stop();
|
||||||
|
tasksModel.taskReorderingEnabled = false;
|
||||||
|
|
||||||
// skip to first active task
|
// skip to first active task
|
||||||
if (taskSwitcherState.wasInActiveTask) {
|
if (taskSwitcherState.wasInActiveTask) {
|
||||||
taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row);
|
taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row);
|
||||||
|
|
@ -140,6 +151,12 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
instantHide();
|
instantHide();
|
||||||
|
|
||||||
|
if (taskSwitcherState.wasInActiveTask) {
|
||||||
|
reorderTimer.restart();
|
||||||
|
} else {
|
||||||
|
tasksModel.taskReorderingEnabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function minimizeAll() {
|
function minimizeAll() {
|
||||||
|
|
@ -156,6 +173,7 @@ Item {
|
||||||
easing.type: Easing.InOutQuad
|
easing.type: Easing.InOutQuad
|
||||||
onFinished: {
|
onFinished: {
|
||||||
root.visible = false;
|
root.visible = false;
|
||||||
|
tasksModel.taskReorderingEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue