File 0008-Fix-regressions-in-keyboard-based-subdialog-nav.patch of Package plasma5-desktop.openSUSE_13.2_Update
From 2d4e72d82a278ca9cd7c8e231714fed3ef57f7a1 Mon Sep 17 00:00:00 2001
From: Eike Hein <hein@kde.org>
Date: Wed, 1 Apr 2015 19:47:32 +0200
Subject: [PATCH 08/11] Fix regressions in keyboard-based subdialog nav.
---
.../package/contents/ui/FullRepresentation.qml | 4 +++
.../kicker/package/contents/ui/ItemListView.qml | 30 ++++++++++++++++++++--
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/applets/kicker/package/contents/ui/FullRepresentation.qml b/applets/kicker/package/contents/ui/FullRepresentation.qml
index db53030c130924f606fdfe998c5485027e6c6ffe..254a03efbf7451a03f111ce037df60680441b5ef 100644
--- a/applets/kicker/package/contents/ui/FullRepresentation.qml
+++ b/applets/kicker/package/contents/ui/FullRepresentation.qml
@@ -385,7 +385,9 @@ FocusScope {
Keys.onPressed: {
if (event.key == Qt.Key_Up) {
if (rootList.visible) {
+ rootList.showChildDialogs = false;
rootList.currentIndex = rootList.model.count - 1;
+ rootList.showChildDialogs = true;
}
if (runnerColumns.visible) {
@@ -393,7 +395,9 @@ FocusScope {
}
} else if (event.key == Qt.Key_Down) {
if (rootList.visible) {
+ rootList.showChildDialogs = false;
rootList.currentIndex = 0;
+ rootList.showChildDialogs = true;
}
if (runnerColumns.visible) {
diff --git a/applets/kicker/package/contents/ui/ItemListView.qml b/applets/kicker/package/contents/ui/ItemListView.qml
index d3b299f9ec2b67480b5a74a7fdf54eabe7c0158d..d335a048b9487ecbe60b011b80f65188445cf3bf 100644
--- a/applets/kicker/package/contents/ui/ItemListView.qml
+++ b/applets/kicker/package/contents/ui/ItemListView.qml
@@ -43,6 +43,7 @@ FocusScope {
property alias currentIndex: listView.currentIndex
property alias keyNavigationWraps: listView.keyNavigationWraps
+ property alias showChildDialogs: listView.showChildDialogs
property alias model: listView.model
property alias containsMouse: listener.containsMouse
property alias resetOnExitDelay: resetIndexTimer.interval
@@ -54,6 +55,8 @@ FocusScope {
Timer {
id: dialogSpawnTimer
+ property bool focusOnSpawn: false
+
interval: 70
repeat: false
@@ -82,6 +85,12 @@ FocusScope {
windowSystem.forceActive(childDialog.mainItem);
childDialog.mainItem.focus = true;
+
+ if (focusOnSpawn) {
+ childDialog.mainItem.showChildDialogs = false;
+ childDialog.mainItem.currentIndex = 0;
+ childDialog.mainItem.showChildDialogs = true;
+ }
}
}
@@ -124,6 +133,7 @@ FocusScope {
ListView {
id: listView
+ property bool showChildDialogs: true
property int eligibleWidth: width
currentIndex: -1
@@ -163,7 +173,10 @@ FocusScope {
return;
}
- dialogSpawnTimer.restart();
+ if (showChildDialogs) {
+ dialogSpawnTimer.focusOnSpawn = true;
+ dialogSpawnTimer.restart();
+ }
} else if (childDialog != null) {
childDialog.visible = false;
childDialog.delayedDestroy();
@@ -172,10 +185,23 @@ FocusScope {
}
Keys.onPressed: {
- if (event.key == Qt.Key_Right && childDialog != null) {
+ if (event.key == Qt.Key_Up) {
+ event.accepted = true;
+ showChildDialogs = false;
+ decrementCurrentIndex();
+ showChildDialogs = true;
+ } else if (event.key == Qt.Key_Down) {
+ event.accepted = true;
+ showChildDialogs = false;
+ incrementCurrentIndex();
+ showChildDialogs = true;
+ } else if (event.key == Qt.Key_Right && childDialog != null) {
windowSystem.forceActive(childDialog.mainItem);
childDialog.mainItem.focus = true;
childDialog.mainItem.currentIndex = 0;
+ } else if (event.key == Qt.Key_Right && childDialog == null) {
+ dialogSpawnTimer.focusOnSpawn = true;
+ dialogSpawnTimer.restart();
} else if (event.key == Qt.Key_Left && dialog != null) {
dialog.destroy();
} else if (event.key == Qt.Key_Escape) {
--
2.3.4