Merge lp:~stolowski/unity-2d/hud-a11-focus-fixes into lp:unity-2d

Proposed by Paweł Stołowski
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1075
Merged at revision: 1075
Proposed branch: lp:~stolowski/unity-2d/hud-a11-focus-fixes
Merge into: lp:unity-2d
Diff against target: 83 lines (+17/-5)
3 files modified
shell/common/SearchEntry.qml (+9/-2)
shell/hud/Hud.qml (+3/-0)
tests/manual-tests/hud.txt (+5/-3)
To merge this branch: bzr merge lp:~stolowski/unity-2d/hud-a11-focus-fixes
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Gerry Boland Pending
Review via email: mp+102524@code.launchpad.net

Commit message

[hud] Force active focus on Search entry whenever a key is pressed. Force active focus on results list on Up/Down keys.

Description of the change

[hud] Force active focus on Search entry whenever a key is pressed. Force active focus on results list on Up/Down keys.
UNBLOCK

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

We loose the blinking cursor on the text entry by doing this. Can you investigate how to fix it?

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

The blinking cursor is lost after i press down arrow, sorry for the incomplete information

1071. By Paweł Stołowski

Added forceCursorVisible property to SearchEntry to make it possible to
force cursor visibility in Hud even if text entry doesn't have focus (i.e.
results list has focus).

1072. By Paweł Stołowski

Added forceTextInputFocus function to force search entry focus from Hud, instead of
forcing in unconditional in SearchEntry code.

Revision history for this message
Albert Astals Cid (aacid) wrote :

There is still the problem, after i first type something in the hud, the first entry in the result list gets selected, but it's not spoken out loud by orca

review: Needs Fixing
1073. By Paweł Stołowski

Force focus on resultList in onCurrentChanged signal handler - makes Orca read
the 1st result item. Call forceTextInputFocus from SearchEntry.

1074. By Paweł Stołowski

Added anyKeypressGivesFocus property (defaults to false) to SearchEntry, it is enabled for Hud.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Approved! the focus hopping is a bit hacky but works well and can't think of something better

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Actually, can you please add a manual test?

Revision history for this message
Albert Astals Cid (aacid) :
review: Needs Fixing
1075. By Paweł Stołowski

Updated hud test case.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Good stuff :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/common/SearchEntry.qml'
2--- shell/common/SearchEntry.qml 2012-04-02 16:18:24 +0000
3+++ shell/common/SearchEntry.qml 2012-04-19 15:06:22 +0000
4@@ -26,6 +26,8 @@
5 property string searchQuery
6 property string placeHolderText: ""
7 property bool active: false
8+ property alias forceCursorVisible: searchInput.forceCursorVisible
9+ property alias anyKeypressGivesFocus: searchInput.anyKeypressGivesFocus
10
11 signal activateFirstResult
12
13@@ -84,6 +86,8 @@
14
15 TextInput {
16 id: searchInput
17+ property bool forceCursorVisible: false
18+ property bool anyKeypressGivesFocus: false
19
20 Accessible.name: searchInstructions.text
21 Accessible.role: Accessible.EditableText
22@@ -110,6 +114,9 @@
23 }
24
25 Keys.onPressed: {
26+ if (anyKeypressGivesFocus) {
27+ forceActiveFocus();
28+ }
29 if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter) {
30 activateFirstResult()
31 event.accepted = true;
32@@ -135,9 +142,9 @@
33 anchors.topMargin: 2
34 anchors.bottomMargin: 2
35 width: 1
36- visible: parent.activeFocus && timerShowCursor
37+ visible: (customCursor.parent.forceCursorVisible || parent.activeFocus) && timerShowCursor
38 Timer {
39- interval: 800; running: customCursor.parent.activeFocus; repeat: true
40+ interval: 800; running: (customCursor.parent.forceCursorVisible || customCursor.parent.activeFocus); repeat: true
41 onTriggered: {
42 interval = interval == 800 ? 400 : 800
43 customCursor.timerShowCursor = !customCursor.timerShowCursor
44
45=== modified file 'shell/hud/Hud.qml'
46--- shell/hud/Hud.qml 2012-04-16 15:14:34 +0000
47+++ shell/hud/Hud.qml 2012-04-19 15:06:22 +0000
48@@ -199,6 +199,8 @@
49 SearchEntry {
50 id: searchEntry
51 focus: true
52+ forceCursorVisible: true
53+ anyKeypressGivesFocus: true
54
55 anchors.top: parent.top
56 anchors.left: parent.left
57@@ -251,6 +253,7 @@
58 }
59
60 onCurrentItemChanged: {
61+ resultList.forceActiveFocus();
62 if (currentItem != null && count > 0) {
63 appIcon = "image://icons/" + (currentItem.icon ? currentItem.icon : "unknown")
64 } else {
65
66=== modified file 'tests/manual-tests/hud.txt'
67--- tests/manual-tests/hud.txt 2012-04-16 15:14:34 +0000
68+++ tests/manual-tests/hud.txt 2012-04-19 15:06:22 +0000
69@@ -12,9 +12,11 @@
70 * Enable Accessibility and Orca speech output
71 * Tap Alt key
72 * Enter a few characters
73- * Use arrow keys to navigate up/down through the options returned
74-
75---> Check Orca speaks the contents of the results
76+--> Check that Orca speaks the contents of the first highlighted item
77+ * Use Up/Down keys to navigate through the options returned and Left/Right to move over search query
78+--> Check that Orca speaks the contents of the results as they are browsed with Up/Down
79+--> Check that cursor keeps blinking in the search entry.
80+--> Check that Orca speaks search query letters as you move the caret Left/Right
81
82 ----
83 * Go into ccsm

Subscribers

People subscribed via source and target branches