Merge lp:~zsombi/ubuntu-ui-toolkit/focusInComponents into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Cris Dywan
Approved revision: 2104
Merged at revision: 2109
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/focusInComponents
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 227 lines (+80/-7)
14 files modified
src/UbuntuToolkit/ucbottomedgehint.cpp (+3/-0)
src/imports/Components/1.3/Button.qml (+1/-0)
src/imports/Components/1.3/CheckBox.qml (+1/-0)
src/imports/Components/1.3/ComboButton.qml (+1/-0)
src/imports/Components/1.3/Slider.qml (+1/-0)
src/imports/Components/1.3/TextArea.qml (+1/-0)
src/imports/Components/1.3/TextField.qml (+1/-0)
src/imports/Components/Themes/Ambiance/1.3/ActionBarStyle.qml (+1/-0)
src/imports/Components/Themes/Ambiance/1.3/FocusShape.qml (+0/-7)
src/imports/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+1/-0)
src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+1/-0)
src/imports/Components/Themes/Ambiance/1.3/ToolbarStyle.qml (+1/-0)
tests/unit/visual/tst_actionbar.13.qml (+1/-0)
tests/unit/visual/tst_listitem_horizontal_navigation.13.qml (+66/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/focusInComponents
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+305828@code.launchpad.net

Commit message

Move activeFocusOnTab from style into components.

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Looking much less painful than I anticipated. Did try to test all the components thoroughly in case our unit tests weren't succifient, but it seems like there's no regressions (FTR there are bugs, such as Dialog not containing focus while it's open, or BottomEdge having a second ghost focus, or ListItem actions being inaccessible via keyboard, but they can be reproduced in staging)

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/UbuntuToolkit/ucbottomedgehint.cpp'
2--- src/UbuntuToolkit/ucbottomedgehint.cpp 2016-09-09 17:49:07 +0000
3+++ src/UbuntuToolkit/ucbottomedgehint.cpp 2016-09-19 07:25:44 +0000
4@@ -70,6 +70,9 @@
5
6 // accept mouse events
7 q->setAcceptedMouseButtons(Qt::LeftButton);
8+
9+ // set focusOnTab
10+ q->setActiveFocusOnTab(true);
11 }
12
13 /*!
14
15=== modified file 'src/imports/Components/1.3/Button.qml'
16--- src/imports/Components/1.3/Button.qml 2016-05-25 12:48:10 +0000
17+++ src/imports/Components/1.3/Button.qml 2016-09-19 07:25:44 +0000
18@@ -122,4 +122,5 @@
19 property string iconPosition: "left"
20
21 styleName: "ButtonStyle"
22+ activeFocusOnTab: true
23 }
24
25=== modified file 'src/imports/Components/1.3/CheckBox.qml'
26--- src/imports/Components/1.3/CheckBox.qml 2016-05-25 12:48:10 +0000
27+++ src/imports/Components/1.3/CheckBox.qml 2016-09-19 07:25:44 +0000
28@@ -50,4 +50,5 @@
29 onTriggered: checked = !checked
30
31 styleName: "CheckBoxStyle"
32+ activeFocusOnTab: true
33 }
34
35=== modified file 'src/imports/Components/1.3/ComboButton.qml'
36--- src/imports/Components/1.3/ComboButton.qml 2016-09-13 15:01:14 +0000
37+++ src/imports/Components/1.3/ComboButton.qml 2016-09-19 07:25:44 +0000
38@@ -298,6 +298,7 @@
39 default property alias comboList: comboListHolder.data
40
41 styleName: "ComboButtonStyle"
42+ activeFocusOnTab: true
43
44 // update sensing area to report clicks only on the main button area
45 // area excluding dropDown button and combo list
46
47=== modified file 'src/imports/Components/1.3/Slider.qml'
48--- src/imports/Components/1.3/Slider.qml 2016-05-25 12:48:10 +0000
49+++ src/imports/Components/1.3/Slider.qml 2016-09-19 07:25:44 +0000
50@@ -112,6 +112,7 @@
51 onValueChanged: mouseArea.liveValue = slider.value
52
53 activeFocusOnPress: true
54+ activeFocusOnTab: true
55
56 Binding {
57 target: slider
58
59=== modified file 'src/imports/Components/1.3/TextArea.qml'
60--- src/imports/Components/1.3/TextArea.qml 2016-06-21 11:20:14 +0000
61+++ src/imports/Components/1.3/TextArea.qml 2016-09-19 07:25:44 +0000
62@@ -95,6 +95,7 @@
63 id: control
64 implicitWidth: units.gu(30)
65 implicitHeight: (autoSize) ? internal.minimumSize : internal.linesHeight(4)
66+ activeFocusOnTab: true
67
68 // new properties
69 /*!
70
71=== modified file 'src/imports/Components/1.3/TextField.qml'
72--- src/imports/Components/1.3/TextField.qml 2016-06-21 11:20:14 +0000
73+++ src/imports/Components/1.3/TextField.qml 2016-09-19 07:25:44 +0000
74@@ -104,6 +104,7 @@
75
76 implicitWidth: units.gu(25)
77 implicitHeight: units.gu(4)
78+ activeFocusOnTab: true
79 /*!
80 The property presents whether the TextField is highlighted or not. By
81 default the TextField gets highlighted when gets the focus, so can accept
82
83=== modified file 'src/imports/Components/Themes/Ambiance/1.3/ActionBarStyle.qml'
84--- src/imports/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2016-07-14 12:49:23 +0000
85+++ src/imports/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2016-09-19 07:25:44 +0000
86@@ -60,6 +60,7 @@
87 objectName: action.objectName + "_button"
88 height: parent ? parent.height : undefined
89 action: modelData
90+ activeFocusOnTab: true
91 }
92 }
93
94
95=== modified file 'src/imports/Components/Themes/Ambiance/1.3/FocusShape.qml'
96--- src/imports/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-07-14 07:41:06 +0000
97+++ src/imports/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-09-19 07:25:44 +0000
98@@ -35,11 +35,4 @@
99 duration: UbuntuAnimation.FastDuration
100 }
101 }
102-
103- Binding {
104- target: styledItem
105- property: "activeFocusOnTab"
106- value: true
107- when: styledItem
108- }
109 }
110
111=== modified file 'src/imports/Components/Themes/Ambiance/1.3/PageHeadStyle.qml'
112--- src/imports/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-06-09 10:29:56 +0000
113+++ src/imports/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-09-19 07:25:44 +0000
114@@ -437,6 +437,7 @@
115 objectName: action.objectName + "_button"
116 height: parent ? parent.height : undefined
117 action: modelData
118+ activeFocusOnTab: true
119 StyleHints {
120 foregroundColor: headerStyle.buttonColor
121 }
122
123=== modified file 'src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
124--- src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-07-14 13:48:01 +0000
125+++ src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-09-19 07:25:44 +0000
126@@ -97,6 +97,7 @@
127 objectName: action.objectName + "_button"
128 height: internal.titleAreaHeight
129 action: modelData
130+ activeFocusOnTab: true
131 StyleHints {
132 foregroundColor: button.pressed ?
133 pageHeaderStyle.buttons.pressedForegroundColor :
134
135=== modified file 'src/imports/Components/Themes/Ambiance/1.3/ToolbarStyle.qml'
136--- src/imports/Components/Themes/Ambiance/1.3/ToolbarStyle.qml 2015-12-16 10:48:15 +0000
137+++ src/imports/Components/Themes/Ambiance/1.3/ToolbarStyle.qml 2016-09-19 07:25:44 +0000
138@@ -34,5 +34,6 @@
139 height: parent ? parent.height : undefined
140 width: units.gu(4)
141 action: modelData
142+ activeFocusOnTab: true
143 }
144 }
145
146=== modified file 'tests/unit/visual/tst_actionbar.13.qml'
147--- tests/unit/visual/tst_actionbar.13.qml 2016-09-07 14:27:12 +0000
148+++ tests/unit/visual/tst_actionbar.13.qml 2016-09-19 07:25:44 +0000
149@@ -226,6 +226,7 @@
150 styleName: "IconButtonStyle"
151 action: modelData
152 height: greenButtonsBar.height
153+ activeFocusOnTab: true
154 StyleHints {
155 foregroundColor: UbuntuColors.green
156 }
157
158=== added file 'tests/unit/visual/tst_listitem_horizontal_navigation.13.qml'
159--- tests/unit/visual/tst_listitem_horizontal_navigation.13.qml 1970-01-01 00:00:00 +0000
160+++ tests/unit/visual/tst_listitem_horizontal_navigation.13.qml 2016-09-19 07:25:44 +0000
161@@ -0,0 +1,66 @@
162+/*
163+ * Copyright 2016 Canonical Ltd.
164+ *
165+ * This program is free software; you can redistribute it and/or modify
166+ * it under the terms of the GNU Lesser General Public License as published by
167+ * the Free Software Foundation; version 3.
168+ *
169+ * This program is distributed in the hope that it will be useful,
170+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
171+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
172+ * GNU Lesser General Public License for more details.
173+ *
174+ * You should have received a copy of the GNU Lesser General Public License
175+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
176+ */
177+
178+import QtQuick 2.4
179+import QtTest 1.0
180+import Ubuntu.Test 1.3
181+import Ubuntu.Components 1.3
182+import QtQuick.Window 2.1
183+
184+Item {
185+ width: units.gu(40)
186+ height: units.gu(70)
187+
188+ ListView {
189+ id: testView
190+ anchors.fill: parent
191+ model: 10
192+ orientation: ListView.Horizontal
193+ delegate: ListItem {
194+ width: units.gu(5)
195+ height: units.gu(5)
196+ objectName: "listitem" + index
197+ Button {
198+ activeFocusOnTab: false
199+ anchors {
200+ fill: parent
201+ margins: units.gu(1)
202+ }
203+ text: "Button #" + index
204+ }
205+ }
206+ }
207+
208+ UbuntuTestCase {
209+ when: windowShown
210+
211+ function test_navigation_bug1590005_data() {
212+ return [
213+ {tag: "beyond first", index: 0, key: Qt.Key_Left, focusItem: "listitem0"},
214+ {tag: "beyond last", index: 9, key: Qt.Key_Right, focusItem: "listitem9"},
215+ ]
216+ }
217+ function test_navigation_bug1590005(data) {
218+ testView.forceActiveFocus();
219+ testView.currentIndex = data.index;
220+ waitForRendering(testView, 500);
221+
222+ keyClick(data.key);
223+ waitForRendering(testView, 500);
224+ compare(testView.Window.activeFocusItem, findChild(testView, data.focusItem));
225+ }
226+ }
227+}

Subscribers

People subscribed via source and target branches