summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2017-01-26 15:17:26 +0100
committerKai Uwe Broulik <[email protected]>2017-01-26 15:17:26 +0100
commit9d66f0bc8ff8c2510445661e92abddcf4ff43e5e (patch)
treec6c9312e06f870fa601f6cb39769976a840b5e62
parent74ac222ad43505c7f924929c23f6832d1adaab1f (diff)
[Task Manager] Focus last item when pressing up with no active item
This way when opening a group with no active window, we start at the bottom of the list and work our way up, makes it consistent with virtually any other list. Especially since when we start at the top, the next key press would wrap around anyway. Differential Revision: https://phabricator.kde.org/D4292
-rw-r--r--applets/taskmanager/package/contents/ui/GroupDialog.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/applets/taskmanager/package/contents/ui/GroupDialog.qml b/applets/taskmanager/package/contents/ui/GroupDialog.qml
index 14950cf..cbb3fa6 100644
--- a/applets/taskmanager/package/contents/ui/GroupDialog.qml
+++ b/applets/taskmanager/package/contents/ui/GroupDialog.qml
@@ -148,9 +148,10 @@ PlasmaCore.Dialog {
Keys.onUpPressed: {
var currentIndex = groupRepeater.currentIndex();
- // In doubt focus the first item
+ // In doubt focus the last item, so we start at the bottom when user
+ // initially presses up.
if (currentIndex === -1) {
- selectTask(groupRepeater.itemAt(0));
+ selectTask(groupRepeater.itemAt(groupRepeater.count - 1));
return;
}