Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputHandlerKeyNavigation into lp:ubuntu-ui-toolkit/staging
- inputHandlerKeyNavigation
- Merge into staging
Status: | Merged |
---|---|
Approved by: | Zsombor Egri |
Approved revision: | 1818 |
Merged at revision: | 1956 |
Proposed branch: | lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputHandlerKeyNavigation |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Diff against target: |
397 lines (+121/-55) 10 files modified
src/Ubuntu/Components/1.3/InputHandler.qml (+20/-1) src/Ubuntu/Components/1.3/TextArea.qml (+2/-20) src/Ubuntu/Components/1.3/TextField.qml (+2/-11) src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml (+14/-2) src/Ubuntu/Components/plugin/ucstyleditembase.cpp (+14/-18) src/Ubuntu/Components/plugin/ucstyleditembase.h (+1/-1) tests/unit_x11/tst_components/MockKeyboard.qml (+64/-0) tests/unit_x11/tst_components/MockKeyboard13.qml (+1/-1) tests/unit_x11/tst_components/tst_focus.qml (+2/-0) tests/unit_x11/tst_components/tst_textinput_common13.qml (+1/-1) |
To merge this branch: | bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputHandlerKeyNavigation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Zsombor Egri | Approve | ||
Review via email: mp+283049@code.launchpad.net |
Commit message
Handle keyNavigationFocus in InputHandler
Description of the change
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1806
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1807. By Cris Dywan
-
Deduplicate code paths in InputHandler
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1807
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1807
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1808. By Cris Dywan
-
Add focus colors to the palette
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1808
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1808
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1809. By Cris Dywan
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1809
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1809
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1810. By Cris Dywan
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1810
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1810
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1810
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1811. By Zoltan Balogh
-
Sync with staging and resolve conflict on src/Ubuntu/
Components/ plugin/ ucstyleditembas e.h
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1811
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1811
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1811
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1811
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1811
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 1812. By Cris Dywan
-
Drop extra focus/focusText declarations from PaletteValues.qml
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1812
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1812
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1812
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1812
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1812
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 1813. By Cris Dywan
-
Verify keyNavigationFocus after (Shift)Tab in tst_focus
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1813
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1813
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 1814. By Cris Dywan
-
Add MockKeyboard13 to sort out the versioning errors
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1814
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1814
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1814
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1814
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 1815. By Cris Dywan
- 1816. By Cris Dywan
-
Overload focus mechanics to avoid bubbling up of focus from children
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1816
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1816
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1816
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1816
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1816
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Zsombor Egri (zsombi) wrote : | # |
I am not confident that making the property writable is a good way to solve this issue. We must find an other way to solve this issue: what about overriding the key filtering with some attached property, like the Keys QML attached property group does. That one hooks into the key handling and not as a generic event filter, perhaps we could influence the focus key handling through the same logic.
- 1817. By Cris Dywan
-
Keep keyNavigationFocus read-only but inclusive of children
Zsombor Egri (zsombi) wrote : | # |
Ok, this looks much better! Thanks for spending time to find the way!
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1817
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1817
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1817
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1817
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1817
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 1818. By Cris Dywan
-
Restore activeFocusOnPress alias and docs
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1818
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'src/Ubuntu/Components/1.3/InputHandler.qml' |
2 | --- src/Ubuntu/Components/1.3/InputHandler.qml 2016-01-04 09:51:42 +0000 |
3 | +++ src/Ubuntu/Components/1.3/InputHandler.qml 2016-04-25 18:49:14 +0000 |
4 | @@ -16,6 +16,7 @@ |
5 | |
6 | import QtQuick 2.4 |
7 | import Ubuntu.Components 1.3 |
8 | +import Ubuntu.Components.Popups 1.3 |
9 | |
10 | /* |
11 | This component is a unified text selection and scrolling handler for both |
12 | @@ -290,6 +291,16 @@ |
13 | Connections { |
14 | target: main |
15 | ignoreUnknownSignals: true |
16 | + onActiveFocusChanged: { |
17 | + if (!main.activeFocus) { |
18 | + input.focus = false; |
19 | + } |
20 | + } |
21 | + onKeyNavigationFocusChanged: { |
22 | + if (main.keyNavigationFocus) { |
23 | + input.forceActiveFocus(); |
24 | + } |
25 | + } |
26 | onFocusChanged: { |
27 | UbuntuApplication.inputMethod.commit() |
28 | state = (main.focus) ? "" : "inactive"; |
29 | @@ -297,6 +308,10 @@ |
30 | input.forceActiveFocus() |
31 | } |
32 | } |
33 | + onVisibleChanged: { |
34 | + if (!main.visible) |
35 | + main.focus = false; |
36 | + } |
37 | } |
38 | |
39 | // input specific signals |
40 | @@ -311,7 +326,11 @@ |
41 | } |
42 | } |
43 | // make sure we show the OSK |
44 | - onActiveFocusChanged: showInputPanel() |
45 | + onActiveFocusChanged: { |
46 | + if (!input.activeFocus && popover) |
47 | + PopupUtils.close(popover); |
48 | + showInputPanel(); |
49 | + } |
50 | } |
51 | |
52 | // inner or outer Flickable controlling |
53 | |
54 | === modified file 'src/Ubuntu/Components/1.3/TextArea.qml' |
55 | --- src/Ubuntu/Components/1.3/TextArea.qml 2016-04-20 15:00:27 +0000 |
56 | +++ src/Ubuntu/Components/1.3/TextArea.qml 2016-04-25 18:49:14 +0000 |
57 | @@ -103,7 +103,7 @@ |
58 | text input. This property allows to control the highlight separately from |
59 | the focused behavior. |
60 | */ |
61 | - property bool highlighted: activeFocus |
62 | + property bool highlighted |
63 | /*! |
64 | Text that appears when there is no focus and no content in the component |
65 | (hint text). |
66 | @@ -538,13 +538,6 @@ |
67 | */ |
68 | property alias wrapMode:editor.wrapMode |
69 | |
70 | - /*! |
71 | - Whether the TextArea should gain active focus on a mouse press. By default |
72 | - this is set to true. |
73 | - \qmlproperty bool activeFocusOnPress |
74 | - */ |
75 | - property alias activeFocusOnPress: editor.activeFocusOnPress |
76 | - |
77 | // signals |
78 | /*! |
79 | This handler is called when the user clicks on a link embedded in the text. |
80 | @@ -756,15 +749,7 @@ |
81 | } |
82 | |
83 | //internals |
84 | - |
85 | activeFocusOnPress: true |
86 | - activeFocusOnTab: true |
87 | - |
88 | - /*!\internal */ |
89 | - onVisibleChanged: { |
90 | - if (!visible) |
91 | - control.focus = false; |
92 | - } |
93 | |
94 | // Escape should close the context menu even if the menu takes no input focus |
95 | Keys.onEscapePressed: { |
96 | @@ -832,7 +817,7 @@ |
97 | } |
98 | // hint is shown till user types something in the field |
99 | visible: (editor.text == "") && !editor.inputMethodComposing |
100 | - color: theme.palette.normal.base |
101 | + color: theme.palette.normal.baseText |
102 | font: editor.font |
103 | elide: Text.ElideRight |
104 | wrapMode: Text.WordWrap |
105 | @@ -868,14 +853,11 @@ |
106 | objectName: "text_input" |
107 | readOnly: false |
108 | id: editor |
109 | - focus: true |
110 | width: control.contentWidth |
111 | height: Math.max(control.contentHeight, editor.contentHeight) |
112 | wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere |
113 | mouseSelectionMode: TextEdit.SelectWords |
114 | selectByMouse: true |
115 | - activeFocusOnPress: true |
116 | - onActiveFocusChanged: if (!activeFocus && inputHandler.popover) PopupUtils.close(inputHandler.popover) |
117 | cursorDelegate: TextCursor { |
118 | handler: inputHandler |
119 | } |
120 | |
121 | === modified file 'src/Ubuntu/Components/1.3/TextField.qml' |
122 | --- src/Ubuntu/Components/1.3/TextField.qml 2016-04-20 15:00:27 +0000 |
123 | +++ src/Ubuntu/Components/1.3/TextField.qml 2016-04-25 18:49:14 +0000 |
124 | @@ -110,7 +110,7 @@ |
125 | text input. This property allows to control the highlight separately from |
126 | the focused behavior. |
127 | */ |
128 | - property bool highlighted: activeFocus |
129 | + property bool highlighted |
130 | |
131 | /*! |
132 | Text that appears when there is no content in the component. |
133 | @@ -833,14 +833,8 @@ |
134 | |
135 | // internals |
136 | |
137 | + // Overload focus mechanics to avoid bubbling up of focus from children |
138 | activeFocusOnPress: true |
139 | - activeFocusOnTab: true |
140 | - |
141 | - /*! \internal */ |
142 | - onVisibleChanged: { |
143 | - if (!visible) |
144 | - control.focus = false; |
145 | - } |
146 | |
147 | // Escape should close the context menu even if the menu takes no input focus |
148 | Keys.onEscapePressed: { |
149 | @@ -1019,7 +1013,6 @@ |
150 | id: editor |
151 | objectName: "text_input" |
152 | // FocusScope will forward focus to this component |
153 | - focus: true |
154 | anchors.verticalCenter: parent.verticalCenter |
155 | verticalAlignment: TextInput.AlignVCenter |
156 | width: flicker.width |
157 | @@ -1038,8 +1031,6 @@ |
158 | |
159 | // overrides |
160 | selectByMouse: true |
161 | - activeFocusOnPress: true |
162 | - onActiveFocusChanged: if (!activeFocus && inputHandler.popover) PopupUtils.close(inputHandler.popover) |
163 | |
164 | // input selection and navigation handling |
165 | Ubuntu.Mouse.forwardTo: [inputHandler] |
166 | |
167 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml' |
168 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-01-27 15:17:56 +0000 |
169 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-04-25 18:49:14 +0000 |
170 | @@ -35,6 +35,7 @@ |
171 | /*! |
172 | Background fill color |
173 | */ |
174 | + property color borderColor: theme.palette.normal.base |
175 | property color backgroundColor: styledItem.enabled |
176 | ? ((styledItem.activeFocus || styledItem.highlighted) |
177 | ? theme.palette.selected.field |
178 | @@ -58,12 +59,23 @@ |
179 | /*! |
180 | Text input background |
181 | */ |
182 | + FocusShape { |
183 | + } |
184 | + |
185 | property Component background: UbuntuShape { |
186 | property bool error: (styledItem.hasOwnProperty("errorHighlight") && styledItem.errorHighlight && !styledItem.acceptableInput) |
187 | onErrorChanged: (error) ? visuals.errorColor : visuals.backgroundColor; |
188 | - backgroundColor: visuals.backgroundColor |
189 | - anchors.fill: parent |
190 | + backgroundColor: visuals.borderColor |
191 | + aspect: UbuntuShape.Flat |
192 | visible: !styledItem.readOnly |
193 | + anchors.fill: parent |
194 | + |
195 | + UbuntuShape { |
196 | + anchors.fill: parent |
197 | + anchors.margins: parent.visible ? units.gu(0.2) : 0 |
198 | + backgroundColor: visuals.backgroundColor |
199 | + aspect: UbuntuShape.Flat |
200 | + } |
201 | } |
202 | |
203 | Loader { |
204 | |
205 | === modified file 'src/Ubuntu/Components/plugin/ucstyleditembase.cpp' |
206 | --- src/Ubuntu/Components/plugin/ucstyleditembase.cpp 2016-02-29 16:50:41 +0000 |
207 | +++ src/Ubuntu/Components/plugin/ucstyleditembase.cpp 2016-04-25 18:49:14 +0000 |
208 | @@ -42,6 +42,15 @@ |
209 | Q_D(const UCStyledItemBase); |
210 | return d->keyNavigationFocus; |
211 | } |
212 | +void UCStyledItemBase::setKeyNavigationFocus(bool v) |
213 | +{ |
214 | + Q_D(UCStyledItemBase); |
215 | + if (d->keyNavigationFocus == v) |
216 | + return; |
217 | + |
218 | + d->keyNavigationFocus = v; |
219 | + Q_EMIT keyNavigationFocusChanged(); |
220 | +} |
221 | |
222 | bool UCStyledItemBase::activeFocusOnTab2() const |
223 | { |
224 | @@ -532,6 +541,10 @@ |
225 | if (change == ItemParentHasChanged) { |
226 | // update parentItem |
227 | d_func()->oldParentItem = data.item; |
228 | + } else if (change == ItemActiveFocusHasChanged) { |
229 | + // Children may retain focus as if it was the StyledItem itself |
230 | + if (!hasActiveFocus()) |
231 | + setKeyNavigationFocus(false); |
232 | } |
233 | } |
234 | |
235 | @@ -539,15 +552,10 @@ |
236 | { |
237 | QQuickItem::focusInEvent(event); |
238 | |
239 | - Q_D(UCStyledItemBase); |
240 | - if (d->keyNavigationFocus) |
241 | - return; |
242 | - |
243 | switch (event->reason()) { |
244 | case Qt::TabFocusReason: |
245 | case Qt::BacktabFocusReason: |
246 | - d->keyNavigationFocus = true; |
247 | - Q_EMIT keyNavigationFocusChanged(); |
248 | + setKeyNavigationFocus(true); |
249 | break; |
250 | default: |
251 | // Mouse or window focus don't affect keyNavigationFocus status |
252 | @@ -555,18 +563,6 @@ |
253 | } |
254 | } |
255 | |
256 | -void UCStyledItemBase::focusOutEvent(QFocusEvent *event) |
257 | -{ |
258 | - QQuickItem::focusOutEvent(event); |
259 | - |
260 | - Q_D(UCStyledItemBase); |
261 | - if (!d->keyNavigationFocus) |
262 | - return; |
263 | - |
264 | - d->keyNavigationFocus = false; |
265 | - Q_EMIT keyNavigationFocusChanged(); |
266 | -} |
267 | - |
268 | // grab pressed state and focus if it can be |
269 | void UCStyledItemBase::mousePressEvent(QMouseEvent *event) |
270 | { |
271 | |
272 | === modified file 'src/Ubuntu/Components/plugin/ucstyleditembase.h' |
273 | --- src/Ubuntu/Components/plugin/ucstyleditembase.h 2016-01-16 15:52:56 +0000 |
274 | +++ src/Ubuntu/Components/plugin/ucstyleditembase.h 2016-04-25 18:49:14 +0000 |
275 | @@ -77,7 +77,7 @@ |
276 | void componentComplete(); |
277 | void itemChange(ItemChange change, const ItemChangeData &data); |
278 | void focusInEvent(QFocusEvent *key); |
279 | - void focusOutEvent(QFocusEvent *key); |
280 | + void setKeyNavigationFocus(bool value); |
281 | void mousePressEvent(QMouseEvent *event); |
282 | bool childMouseEventFilter(QQuickItem *child, QEvent *event); |
283 | |
284 | |
285 | === added file 'tests/unit_x11/tst_components/MockKeyboard.qml' |
286 | --- tests/unit_x11/tst_components/MockKeyboard.qml 1970-01-01 00:00:00 +0000 |
287 | +++ tests/unit_x11/tst_components/MockKeyboard.qml 2016-04-25 18:49:14 +0000 |
288 | @@ -0,0 +1,64 @@ |
289 | +/* |
290 | + * Copyright 2015 Canonical Ltd. |
291 | + * |
292 | + * This program is free software; you can redistribute it and/or modify |
293 | + * it under the terms of the GNU Lesser General Public License as published by |
294 | + * the Free Software Foundation; version 3. |
295 | + * |
296 | + * This program is distributed in the hope that it will be useful, |
297 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
298 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
299 | + * GNU Lesser General Public License for more details. |
300 | + * |
301 | + * You should have received a copy of the GNU Lesser General Public License |
302 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
303 | + */ |
304 | + |
305 | +import QtQuick 2.4 |
306 | +import Ubuntu.Components 1.2 |
307 | + |
308 | +Object { |
309 | + id: inputMethod |
310 | + function show() { visible = true; } |
311 | + function commit() { } |
312 | + property bool visible: false |
313 | + property rect keyboardRectangle: Qt.rect(0, 0, 0, units.gu(20)) |
314 | + |
315 | + Rectangle { |
316 | + x: parent.x |
317 | + y: parent.height - height |
318 | + width: parent.width |
319 | + height: inputMethod.keyboardRectangle.height |
320 | + visible: inputMethod.visible |
321 | + |
322 | + parent: QuickUtils.rootItem(inputMethod) |
323 | + color: UbuntuColors.silk |
324 | + opacity: 0.5 |
325 | + // Always on top, even modal Dialog overlay |
326 | + z: 100 |
327 | + |
328 | + Flow { |
329 | + anchors.fill: parent |
330 | + anchors.margins: units.dp(2) |
331 | + |
332 | + Repeater { |
333 | + model: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, |
334 | + 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', |
335 | + 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', |
336 | + 'z', 'x', 'c', 'v', ' ', 'b', 'n', 'm', ',', '.' ] |
337 | + |
338 | + Button { |
339 | + text: modelData |
340 | + color: UbuntuColors.blue |
341 | + height: (parent.height - units.dp(2)) / 4 |
342 | + width: (parent.width - units.dp(2)) / 10 |
343 | + } |
344 | + } |
345 | + } |
346 | + |
347 | + MouseArea { |
348 | + anchors.fill: parent |
349 | + onClicked: parent.forceActiveFocus(Qt.MouseFocusReason) |
350 | + } |
351 | + } |
352 | +} |
353 | |
354 | === renamed file 'tests/unit_x11/tst_components/MockKeyboard.qml' => 'tests/unit_x11/tst_components/MockKeyboard13.qml' |
355 | --- tests/unit_x11/tst_components/MockKeyboard.qml 2016-01-13 16:07:58 +0000 |
356 | +++ tests/unit_x11/tst_components/MockKeyboard13.qml 2016-04-25 18:49:14 +0000 |
357 | @@ -15,7 +15,7 @@ |
358 | */ |
359 | |
360 | import QtQuick 2.4 |
361 | -import Ubuntu.Components 1.2 |
362 | +import Ubuntu.Components 1.3 |
363 | |
364 | Object { |
365 | id: inputMethod |
366 | |
367 | === modified file 'tests/unit_x11/tst_components/tst_focus.qml' |
368 | --- tests/unit_x11/tst_components/tst_focus.qml 2016-04-13 16:12:41 +0000 |
369 | +++ tests/unit_x11/tst_components/tst_focus.qml 2016-04-25 18:49:14 +0000 |
370 | @@ -60,6 +60,7 @@ |
371 | id: textFieldSecondaryItem |
372 | height: parent.height |
373 | width: height |
374 | + Component.onCompleted: activeFocusOnTab = false |
375 | } |
376 | } |
377 | TextArea { |
378 | @@ -266,6 +267,7 @@ |
379 | } else { |
380 | verify(data.to.activeFocusOnTab, "Target doesn't take keyboard focus"); |
381 | keyClick(data.key); |
382 | + verify(data.to.keyNavigationFocus, "Target doesn't have keyNavigationFocus"); |
383 | } |
384 | waitForRendering(data.to, 500); |
385 | verify(!data.from.activeFocus, "Source component still keeps focus"); |
386 | |
387 | === modified file 'tests/unit_x11/tst_components/tst_textinput_common13.qml' |
388 | --- tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-03-15 13:26:55 +0000 |
389 | +++ tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-04-25 18:49:14 +0000 |
390 | @@ -131,7 +131,7 @@ |
391 | } |
392 | } |
393 | |
394 | - MockKeyboard { |
395 | + MockKeyboard13 { |
396 | Component.onCompleted: UbuntuApplication.inputMethod = this |
397 | } |
398 |
FAILED: Continuous integration, rev:1806 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-armhf- singlenode/ 70/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/169/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-armhf- singlenode/ 70/rebuild
https:/