mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
make quick switch gesture properly open switcher on end of list
doing a quick task switch gesture towards the end of the list should force open the task switcher (there is nothing to switch to) this was half-done on the left side of the switcher (this behavior is not visible with immediate task reordering, but could be hit if we have different ordering criteria or delayed reordering) and due to superfluous Math.max completely not working on the right side always opening the right-most task instead of opening the switcher
This commit is contained in:
parent
4cec95a3cc
commit
7852b7ad2b
1 changed files with 3 additions and 2 deletions
|
|
@ -156,13 +156,14 @@ FocusScope {
|
|||
let shouldSwitch = false;
|
||||
if (state.xVelocity > 0 && state.wasInActiveTask) {
|
||||
// flick to the right, go to app to the left
|
||||
newIndex = state.currentTaskIndex + 1, tasksCount - 1;
|
||||
newIndex = state.currentTaskIndex + 1;
|
||||
if (newIndex < tasksCount) {
|
||||
// switch only if flick doesn't go over end of list
|
||||
shouldSwitch = true;
|
||||
}
|
||||
} else if (state.xVelocity < 0 && state.wasInActiveTask) {
|
||||
newIndex = Math.max(state.currentTaskIndex - 1, 0);
|
||||
// flick to the left, go to app to the right
|
||||
newIndex = state.currentTaskIndex - 1;
|
||||
if (newIndex >= 0) {
|
||||
// switch only if flick doesn't go over end of list
|
||||
shouldSwitch = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue