Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/tinyText into lp:ubuntu-ui-toolkit/staging
- tinyText
- Merge into staging
Proposed by
Cris Dywan
Status: | Work in progress |
---|---|
Proposed branch: | lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/tinyText |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Diff against target: |
506 lines (+288/-41) (has conflicts) 10 files modified
src/Ubuntu/Components/1.3/InputHandler.qml (+5/-2) src/Ubuntu/Components/1.3/TextArea.qml (+2/-1) src/Ubuntu/Components/1.3/TextArea14.qml (+77/-0) src/Ubuntu/Components/1.3/TextCursor.qml (+6/-30) src/Ubuntu/Components/1.3/TextField.qml (+2/-0) src/Ubuntu/Components/1.3/TextField14.qml (+108/-0) src/Ubuntu/Components/ComponentModule.pro (+2/-0) src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml (+0/-2) src/Ubuntu/Components/qmldir (+4/-2) tests/unit_x11/tst_components/tst_textinput_common13.qml (+82/-4) Text conflict in tests/unit_x11/tst_components/tst_textinput_common13.qml |
To merge this branch: | bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/tinyText |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu SDK team | Pending | ||
Review via email: mp+295710@code.launchpad.net |
Commit message
Tiny Text* components for experimenting
Description of the change
To post a comment you must log in.
Unmerged revisions
- 1980. By Cris Dywan
-
Simplify TextArea14 and add a reference ScrollView/
Flickable/ TextEdit - 1979. By Cris Dywan
-
Tiny Text* components for experimenting
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/Ubuntu/Components/1.3/InputHandler.qml' | |||
2 | --- src/Ubuntu/Components/1.3/InputHandler.qml 2016-05-09 08:12:31 +0000 | |||
3 | +++ src/Ubuntu/Components/1.3/InputHandler.qml 2016-05-25 12:39:37 +0000 | |||
4 | @@ -90,10 +90,13 @@ | |||
5 | 90 | { | 90 | { |
6 | 91 | if (flickable.moving || flickable.flicking) | 91 | if (flickable.moving || flickable.flicking) |
7 | 92 | return; | 92 | return; |
8 | 93 | //flickable.contentX = MathUtils.clamp(flickable.contentX, flickable.originX, flickable.originX + flickable.contentWidth - flickable.width); | ||
9 | 94 | return; | ||
10 | 93 | if (flickable.contentX >= rect.x) | 95 | if (flickable.contentX >= rect.x) |
11 | 94 | flickable.contentX = rect.x; | 96 | flickable.contentX = rect.x; |
14 | 95 | else if (flickable.contentX + flickable.width <= rect.x + rect.width) | 97 | else if (flickable.contentX + flickable.contentWidth <= rect.x + rect.width) |
15 | 96 | flickable.contentX = rect.x + rect.width - flickable.width; | 98 | flickable.contentX = rect.x + rect.width - flickable.contentWidth; |
16 | 99 | return; | ||
17 | 97 | if (flickable.contentY >= rect.y) | 100 | if (flickable.contentY >= rect.y) |
18 | 98 | flickable.contentY = rect.y; | 101 | flickable.contentY = rect.y; |
19 | 99 | else if (flickable.contentY + flickable.height <= rect.y + rect.height) | 102 | else if (flickable.contentY + flickable.height <= rect.y + rect.height) |
20 | 100 | 103 | ||
21 | === modified file 'src/Ubuntu/Components/1.3/TextArea.qml' | |||
22 | --- src/Ubuntu/Components/1.3/TextArea.qml 2016-05-12 16:30:27 +0000 | |||
23 | +++ src/Ubuntu/Components/1.3/TextArea.qml 2016-05-25 12:39:37 +0000 | |||
24 | @@ -884,9 +884,10 @@ | |||
25 | 884 | anchors.topMargin: -internal.frameSpacing | 884 | anchors.topMargin: -internal.frameSpacing |
26 | 885 | anchors.rightMargin: -internal.frameSpacing | 885 | anchors.rightMargin: -internal.frameSpacing |
27 | 886 | anchors.bottomMargin: -internal.frameSpacing | 886 | anchors.bottomMargin: -internal.frameSpacing |
28 | 887 | __alwaysOnScrollbars: true | ||
29 | 887 | Ubuntu.StyleHints { | 888 | Ubuntu.StyleHints { |
30 | 888 | // No background color | 889 | // No background color |
32 | 889 | troughColorSteppersStyle: Qt.rgba(0, 0, 0, 0) | 890 | // troughColorSteppersStyle: Qt.rgba(0, 0, 0, 0) |
33 | 890 | } | 891 | } |
34 | 891 | } | 892 | } |
35 | 892 | 893 | ||
36 | 893 | 894 | ||
37 | === added file 'src/Ubuntu/Components/1.3/TextArea14.qml' | |||
38 | --- src/Ubuntu/Components/1.3/TextArea14.qml 1970-01-01 00:00:00 +0000 | |||
39 | +++ src/Ubuntu/Components/1.3/TextArea14.qml 2016-05-25 12:39:37 +0000 | |||
40 | @@ -0,0 +1,77 @@ | |||
41 | 1 | import QtQuick 2.4 | ||
42 | 2 | import Ubuntu.Components 1.3 as Ubuntu | ||
43 | 3 | |||
44 | 4 | Ubuntu.StyledItem { | ||
45 | 5 | id: main | ||
46 | 6 | implicitWidth: units.gu(30) | ||
47 | 7 | implicitHeight: units.gu(4) * 5 | ||
48 | 8 | |||
49 | 9 | property alias text: input.text | ||
50 | 10 | property string placeholderText //FIXME: placeHolder is a placeHolder for now | ||
51 | 11 | |||
52 | 12 | styleName: "TextAreaStyle" | ||
53 | 13 | Keys.forwardTo: [input] | ||
54 | 14 | // FIXME: property alias activeFocusOnPress: input.activeFocusOnPress | ||
55 | 15 | activeFocusOnPress: true | ||
56 | 16 | |||
57 | 17 | ScrollView { | ||
58 | 18 | anchors.fill: parent | ||
59 | 19 | Flickable { | ||
60 | 20 | id: flickable | ||
61 | 21 | anchors { | ||
62 | 22 | fill: parent | ||
63 | 23 | } | ||
64 | 24 | property real spacing: main.__styleInstance.frameSpacing | ||
65 | 25 | topMargin: spacing | ||
66 | 26 | leftMargin: spacing | ||
67 | 27 | boundsBehavior: Flickable.StopAtBounds | ||
68 | 28 | clip: true | ||
69 | 29 | contentX: -spacing | ||
70 | 30 | contentY: -spacing | ||
71 | 31 | contentWidth: input.paintedWidth + spacing | ||
72 | 32 | contentHeight: input.paintedHeight + spacing | ||
73 | 33 | interactive: contentHeight > height | ||
74 | 34 | flickableDirection: Flickable.VerticalFlick | ||
75 | 35 | |||
76 | 36 | TextEdit { | ||
77 | 37 | id: input | ||
78 | 38 | width: flickable.width - flickable.spacing * 2 | ||
79 | 39 | height: Math.max(flickable.height - flickable.spacing * 2, contentHeight + flickable.spacing * 2) | ||
80 | 40 | wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere | ||
81 | 41 | |||
82 | 42 | color: main.__styleInstance.color | ||
83 | 43 | selectedTextColor: main.__styleInstance.selectedTextColor | ||
84 | 44 | selectionColor: main.__styleInstance.selectionColor | ||
85 | 45 | font.pixelSize: FontUtils.sizeToPixels("medium") | ||
86 | 46 | |||
87 | 47 | // FIXME: WIP | ||
88 | 48 | Ubuntu.Mouse.forwardTo: [main] | ||
89 | 49 | // activeFocusOnPress: false | ||
90 | 50 | onFocusChanged: if (focus) main.forceActiveFocus() | ||
91 | 51 | |||
92 | 52 | Keys.onPressed: cursorVisible = true | ||
93 | 53 | selectByMouse: true | ||
94 | 54 | mouseSelectionMode: TextInput.SelectWords | ||
95 | 55 | cursorDelegate: Component { | ||
96 | 56 | Rectangle { | ||
97 | 57 | color: theme.palette.normal.activity | ||
98 | 58 | width: units.dp(2) | ||
99 | 59 | height: input.cursorRectangle.height | ||
100 | 60 | visible: main.activeFocus | ||
101 | 61 | } | ||
102 | 62 | } | ||
103 | 63 | /* cursorDelegate: TextCursor { | ||
104 | 64 | handler: handler | ||
105 | 65 | } | ||
106 | 66 | |||
107 | 67 | InputHandler { | ||
108 | 68 | id: handler | ||
109 | 69 | anchors.fill: parent | ||
110 | 70 | main: main | ||
111 | 71 | input: input | ||
112 | 72 | flickable: flickable | ||
113 | 73 | } */ | ||
114 | 74 | } | ||
115 | 75 | } | ||
116 | 76 | } | ||
117 | 77 | } | ||
118 | 0 | 78 | ||
119 | === modified file 'src/Ubuntu/Components/1.3/TextCursor.qml' | |||
120 | --- src/Ubuntu/Components/1.3/TextCursor.qml 2015-12-09 19:59:50 +0000 | |||
121 | +++ src/Ubuntu/Components/1.3/TextCursor.qml 2016-05-25 12:39:37 +0000 | |||
122 | @@ -51,21 +51,13 @@ | |||
123 | 51 | } | 51 | } |
124 | 52 | property int absY: { | 52 | property int absY: { |
125 | 53 | // Take parent flickable movement into account | 53 | // Take parent flickable movement into account |
127 | 54 | var flickable = handler.main; | 54 | var flickable = handler.flickable; |
128 | 55 | do { | 55 | do { |
129 | 56 | flickable = flickable.parent; | 56 | flickable = flickable.parent; |
130 | 57 | } while (flickable && !flickable.contentY && flickable != fakeCursor.parent); | 57 | } while (flickable && !flickable.contentY && flickable != fakeCursor.parent); |
131 | 58 | return fakeCursor.parent.mapFromItem(handler.main, cursorItem.x, cursorItem.y).y | 58 | return fakeCursor.parent.mapFromItem(handler.main, cursorItem.x, cursorItem.y).y |
132 | 59 | } | 59 | } |
133 | 60 | 60 | ||
134 | 61 | // Returns "x" or "y" relative to the item handlers are a child of | ||
135 | 62 | function mappedCursorPosition(coordinate) { | ||
136 | 63 | var cpos = cursorItem["abs" + coordinate.toUpperCase()]; | ||
137 | 64 | cpos += handler.frameDistance[coordinate]; | ||
138 | 65 | cpos += handler.input[coordinate]; | ||
139 | 66 | cpos -= handler.flickable["content" + coordinate.toUpperCase()]; | ||
140 | 67 | return cpos; | ||
141 | 68 | } | ||
142 | 69 | /* | 61 | /* |
143 | 70 | The function opens the text input popover setting the text cursor as caller. | 62 | The function opens the text input popover setting the text cursor as caller. |
144 | 71 | */ | 63 | */ |
145 | @@ -158,7 +150,6 @@ | |||
146 | 158 | property Item draggedItem: Item { | 150 | property Item draggedItem: Item { |
147 | 159 | objectName: cursorItem.positionProperty + "_draggeditem" | 151 | objectName: cursorItem.positionProperty + "_draggeditem" |
148 | 160 | width: caret.width + units.gu(2) | 152 | width: caret.width + units.gu(2) |
149 | 161 | onWidthChanged: draggedItem.moveToCaret() | ||
150 | 162 | height: cursorItem.height + caret.height + threshold | 153 | height: cursorItem.height + caret.height + threshold |
151 | 163 | property real threshold: units.gu(4) | 154 | property real threshold: units.gu(4) |
152 | 164 | parent: fakeCursor.parent | 155 | parent: fakeCursor.parent |
153 | @@ -177,12 +168,6 @@ | |||
154 | 177 | preventStealing: true | 168 | preventStealing: true |
155 | 178 | cursorShape: Qt.IBeamCursor | 169 | cursorShape: Qt.IBeamCursor |
156 | 179 | enabled: parent.width && parent.height && parent.visible && !handler.doubleTapInProgress | 170 | enabled: parent.width && parent.height && parent.visible && !handler.doubleTapInProgress |
157 | 180 | onPressedChanged: { | ||
158 | 181 | if (!pressed) { | ||
159 | 182 | // when the dragging ends, reposition the dragger back to caret | ||
160 | 183 | draggedItem.moveToCaret(); | ||
161 | 184 | } | ||
162 | 185 | } | ||
163 | 186 | Ubuntu.Mouse.forwardTo: [dragger] | 171 | Ubuntu.Mouse.forwardTo: [dragger] |
164 | 187 | Ubuntu.Mouse.onClicked: openPopover() | 172 | Ubuntu.Mouse.onClicked: openPopover() |
165 | 188 | Ubuntu.Mouse.onPressAndHold: { | 173 | Ubuntu.Mouse.onPressAndHold: { |
166 | @@ -201,16 +186,9 @@ | |||
167 | 201 | } | 186 | } |
168 | 202 | } | 187 | } |
169 | 203 | 188 | ||
180 | 204 | // aligns the draggedItem to the caret and resets the dragger | 189 | property bool flip: caret.rotation == 180 |
181 | 205 | function moveToCaret() { | 190 | x: fakeCursor.x + (flip ? -caret.width : -draggedItem.width + caret.width) |
182 | 206 | if (!caret) { | 191 | y: fakeCursor.y + caret.y + caret.height - threshold |
173 | 207 | return; | ||
174 | 208 | } | ||
175 | 209 | // The style may render handlers either on top or bottom | ||
176 | 210 | var flip = caret.rotation == 180; | ||
177 | 211 | draggedItem.x = fakeCursor.x + (flip ? -caret.width : -draggedItem.width + caret.width); | ||
178 | 212 | draggedItem.y = fakeCursor.y + caret.y + caret.height - threshold; | ||
179 | 213 | } | ||
183 | 214 | // positions caret to the dragged position | 192 | // positions caret to the dragged position |
184 | 215 | function positionCaret() { | 193 | function positionCaret() { |
185 | 216 | if (dragger.dragActive) { | 194 | if (dragger.dragActive) { |
186 | @@ -303,10 +281,8 @@ | |||
187 | 303 | height: cursorItem.height | 281 | height: cursorItem.height |
188 | 304 | Component.onCompleted: caret.parent = fakeCursor | 282 | Component.onCompleted: caret.parent = fakeCursor |
189 | 305 | 283 | ||
194 | 306 | x: mappedCursorPosition("x") | 284 | x: cursorItem.absX + handler.frameDistance.x + handler.input.x - handler.flickable.contentX |
195 | 307 | y: mappedCursorPosition("y") | 285 | y: cursorItem.absY + handler.frameDistance.y + handler.input.y - handler.flickable.contentY |
192 | 308 | onXChanged: draggedItem.moveToCaret() | ||
193 | 309 | onYChanged: draggedItem.moveToCaret() | ||
196 | 310 | 286 | ||
197 | 311 | // manual clipping: the caret should be visible only while the cursor's | 287 | // manual clipping: the caret should be visible only while the cursor's |
198 | 312 | // top/bottom falls into the text area | 288 | // top/bottom falls into the text area |
199 | 313 | 289 | ||
200 | === modified file 'src/Ubuntu/Components/1.3/TextField.qml' | |||
201 | --- src/Ubuntu/Components/1.3/TextField.qml 2016-05-02 18:27:11 +0000 | |||
202 | +++ src/Ubuntu/Components/1.3/TextField.qml 2016-05-25 12:39:37 +0000 | |||
203 | @@ -999,6 +999,8 @@ | |||
204 | 999 | verticalCenter: parent.verticalCenter | 999 | verticalCenter: parent.verticalCenter |
205 | 1000 | } | 1000 | } |
206 | 1001 | topMargin: internal.spacing | 1001 | topMargin: internal.spacing |
207 | 1002 | leftMargin: internal.spacing | ||
208 | 1003 | rightMargin: internal.spacing | ||
209 | 1002 | bottomMargin: internal.spacing | 1004 | bottomMargin: internal.spacing |
210 | 1003 | // do not allow rebounding | 1005 | // do not allow rebounding |
211 | 1004 | boundsBehavior: Flickable.StopAtBounds | 1006 | boundsBehavior: Flickable.StopAtBounds |
212 | 1005 | 1007 | ||
213 | === added file 'src/Ubuntu/Components/1.3/TextField14.qml' | |||
214 | --- src/Ubuntu/Components/1.3/TextField14.qml 1970-01-01 00:00:00 +0000 | |||
215 | +++ src/Ubuntu/Components/1.3/TextField14.qml 2016-05-25 12:39:37 +0000 | |||
216 | @@ -0,0 +1,108 @@ | |||
217 | 1 | import QtQuick 2.4 | ||
218 | 2 | import Ubuntu.Components 1.3 as Ubuntu | ||
219 | 3 | |||
220 | 4 | Ubuntu.ActionItem { | ||
221 | 5 | id: main | ||
222 | 6 | implicitWidth: units.gu(25) | ||
223 | 7 | implicitHeight: units.gu(4) | ||
224 | 8 | |||
225 | 9 | property alias primaryItem: primary.data | ||
226 | 10 | Item { | ||
227 | 11 | id: primary | ||
228 | 12 | anchors { | ||
229 | 13 | left: parent.left | ||
230 | 14 | leftMargin: flickable.spacing | ||
231 | 15 | } | ||
232 | 16 | height: parent.height | ||
233 | 17 | width: childrenRect.width | ||
234 | 18 | z: 1 | ||
235 | 19 | onChildrenChanged: adjustChildren(primary) | ||
236 | 20 | function adjustChildren(newParent) { | ||
237 | 21 | for (var i = 0; i < children.length; i++) { | ||
238 | 22 | var child = children[i]; | ||
239 | 23 | child.parent = newParent; | ||
240 | 24 | child.anchors.verticalCenter = verticalCenter; | ||
241 | 25 | } | ||
242 | 26 | } | ||
243 | 27 | } | ||
244 | 28 | property alias secondaryItem: secondary.data | ||
245 | 29 | Item { | ||
246 | 30 | id: secondary | ||
247 | 31 | anchors { | ||
248 | 32 | right: parent.right | ||
249 | 33 | rightMargin: flickable.spacing | ||
250 | 34 | } | ||
251 | 35 | height: parent.height | ||
252 | 36 | width: childrenRect.width | ||
253 | 37 | z: 1 | ||
254 | 38 | onChildrenChanged: primary.adjustChildren(secondary) | ||
255 | 39 | } | ||
256 | 40 | property alias echoMode: input.echoMode | ||
257 | 41 | property alias text: input.text | ||
258 | 42 | property string placeholderText //FIXME: placeHolder is a placeHolder for now | ||
259 | 43 | |||
260 | 44 | styleName: "TextFieldStyle" | ||
261 | 45 | Keys.forwardTo: [input] | ||
262 | 46 | // FIXME: property alias activeFocusOnPress: input.activeFocusOnPress | ||
263 | 47 | activeFocusOnPress: true | ||
264 | 48 | |||
265 | 49 | Flickable { | ||
266 | 50 | id: flickable | ||
267 | 51 | anchors { | ||
268 | 52 | left: primary.right | ||
269 | 53 | right: secondary.left | ||
270 | 54 | margins: spacing | ||
271 | 55 | verticalCenter: parent.verticalCenter | ||
272 | 56 | } | ||
273 | 57 | property real spacing: main.__styleInstance.frameSpacing | ||
274 | 58 | topMargin: spacing | ||
275 | 59 | leftMargin: spacing | ||
276 | 60 | rightMargin: spacing | ||
277 | 61 | bottomMargin: spacing | ||
278 | 62 | boundsBehavior: Flickable.StopAtBounds | ||
279 | 63 | clip: true | ||
280 | 64 | contentWidth: input.contentWidth | ||
281 | 65 | contentHeight: input.contentHeight | ||
282 | 66 | height: input.contentHeight | ||
283 | 67 | |||
284 | 68 | TextInput { | ||
285 | 69 | id: input | ||
286 | 70 | width: parent.width | ||
287 | 71 | height: parent.height | ||
288 | 72 | |||
289 | 73 | color: main.__styleInstance.color | ||
290 | 74 | selectedTextColor: main.__styleInstance.selectedTextColor | ||
291 | 75 | selectionColor: main.__styleInstance.selectionColor | ||
292 | 76 | font.pixelSize: FontUtils.sizeToPixels("medium") | ||
293 | 77 | passwordCharacter: "\u2022" | ||
294 | 78 | |||
295 | 79 | // FIXME: WIP | ||
296 | 80 | Ubuntu.Mouse.forwardTo: [main] | ||
297 | 81 | // activeFocusOnPress: false | ||
298 | 82 | onFocusChanged: if (focus) main.forceActiveFocus() | ||
299 | 83 | |||
300 | 84 | Keys.onPressed: cursorVisible = true | ||
301 | 85 | selectByMouse: true | ||
302 | 86 | mouseSelectionMode: TextInput.SelectWords | ||
303 | 87 | cursorDelegate: Component { | ||
304 | 88 | Rectangle { | ||
305 | 89 | color: theme.palette.normal.activity | ||
306 | 90 | width: units.dp(2) | ||
307 | 91 | height: input.cursorRectangle.height | ||
308 | 92 | visible: main.activeFocus | ||
309 | 93 | } | ||
310 | 94 | } | ||
311 | 95 | /* cursorDelegate: TextCursor { | ||
312 | 96 | handler: handler | ||
313 | 97 | } | ||
314 | 98 | |||
315 | 99 | InputHandler { | ||
316 | 100 | id: handler | ||
317 | 101 | anchors.fill: parent | ||
318 | 102 | main: main | ||
319 | 103 | input: input | ||
320 | 104 | flickable: flickable | ||
321 | 105 | } */ | ||
322 | 106 | } | ||
323 | 107 | } | ||
324 | 108 | } | ||
325 | 0 | 109 | ||
326 | === modified file 'src/Ubuntu/Components/ComponentModule.pro' | |||
327 | --- src/Ubuntu/Components/ComponentModule.pro 2016-02-16 11:39:32 +0000 | |||
328 | +++ src/Ubuntu/Components/ComponentModule.pro 2016-05-25 12:39:37 +0000 | |||
329 | @@ -112,8 +112,10 @@ | |||
330 | 112 | 1.3/Tab.qml \ | 112 | 1.3/Tab.qml \ |
331 | 113 | 1.3/Tabs.qml \ | 113 | 1.3/Tabs.qml \ |
332 | 114 | 1.3/TextArea.qml \ | 114 | 1.3/TextArea.qml \ |
333 | 115 | 1.3/TextArea14.qml \ | ||
334 | 115 | 1.3/TextCursor.qml \ | 116 | 1.3/TextCursor.qml \ |
335 | 116 | 1.3/TextField.qml \ | 117 | 1.3/TextField.qml \ |
336 | 118 | 1.3/TextField14.qml \ | ||
337 | 117 | 1.3/TextInputPopover.qml \ | 119 | 1.3/TextInputPopover.qml \ |
338 | 118 | 1.3/Toolbar.qml \ | 120 | 1.3/Toolbar.qml \ |
339 | 119 | 1.3/ToolbarButton.qml \ | 121 | 1.3/ToolbarButton.qml \ |
340 | 120 | 122 | ||
341 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml' | |||
342 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-05-10 12:08:32 +0000 | |||
343 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-05-25 12:39:37 +0000 | |||
344 | @@ -54,8 +54,6 @@ | |||
345 | 54 | anchors.fill: parent | 54 | anchors.fill: parent |
346 | 55 | objectName: "textarea_style" | 55 | objectName: "textarea_style" |
347 | 56 | 56 | ||
348 | 57 | z: -1 | ||
349 | 58 | |||
350 | 59 | /*! | 57 | /*! |
351 | 60 | Text input background | 58 | Text input background |
352 | 61 | */ | 59 | */ |
353 | 62 | 60 | ||
354 | === modified file 'src/Ubuntu/Components/qmldir' | |||
355 | --- src/Ubuntu/Components/qmldir 2016-02-16 11:39:32 +0000 | |||
356 | +++ src/Ubuntu/Components/qmldir 2016-05-25 12:39:37 +0000 | |||
357 | @@ -110,8 +110,10 @@ | |||
358 | 110 | Tabs 1.3 1.3/Tabs.qml | 110 | Tabs 1.3 1.3/Tabs.qml |
359 | 111 | ActivityIndicator 1.3 1.3/ActivityIndicator.qml | 111 | ActivityIndicator 1.3 1.3/ActivityIndicator.qml |
360 | 112 | ProgressBar 1.3 1.3/ProgressBar.qml | 112 | ProgressBar 1.3 1.3/ProgressBar.qml |
363 | 113 | TextField 1.3 1.3/TextField.qml | 113 | # TextField 1.3 1.3/TextField.qml |
364 | 114 | TextArea 1.3 1.3/TextArea.qml | 114 | TextField 1.3 1.3/TextField14.qml |
365 | 115 | # TextArea 1.3 1.3/TextArea.qml | ||
366 | 116 | TextArea 1.3 1.3/TextArea14.qml | ||
367 | 115 | Switch 1.3 1.3/Switch.qml | 117 | Switch 1.3 1.3/Switch.qml |
368 | 116 | CheckBox 1.3 1.3/CheckBox.qml | 118 | CheckBox 1.3 1.3/CheckBox.qml |
369 | 117 | Slider 1.3 1.3/Slider.qml | 119 | Slider 1.3 1.3/Slider.qml |
370 | 118 | 120 | ||
371 | === modified file 'tests/unit_x11/tst_components/tst_textinput_common13.qml' | |||
372 | --- tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-05-11 10:59:50 +0000 | |||
373 | +++ tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-05-25 12:39:37 +0000 | |||
374 | @@ -18,12 +18,17 @@ | |||
375 | 18 | import QtTest 1.0 | 18 | import QtTest 1.0 |
376 | 19 | import Ubuntu.Test 1.3 | 19 | import Ubuntu.Test 1.3 |
377 | 20 | import Ubuntu.Components 1.3 | 20 | import Ubuntu.Components 1.3 |
378 | 21 | import Ubuntu.Components.Private 1.3 | ||
379 | 21 | import Ubuntu.Components.Popups 1.3 | 22 | import Ubuntu.Components.Popups 1.3 |
380 | 22 | 23 | ||
381 | 23 | Item { | 24 | Item { |
382 | 24 | id: testMain | 25 | id: testMain |
383 | 25 | width: units.gu(40) | 26 | width: units.gu(40) |
384 | 27 | <<<<<<< TREE | ||
385 | 26 | height: units.gu(70) | 28 | height: units.gu(70) |
386 | 29 | ======= | ||
387 | 30 | height: units.gu(90) | ||
388 | 31 | >>>>>>> MERGE-SOURCE | ||
389 | 27 | 32 | ||
390 | 28 | Component { | 33 | Component { |
391 | 29 | id: popoverComponent | 34 | id: popoverComponent |
392 | @@ -95,6 +100,8 @@ | |||
393 | 95 | 100 | ||
394 | 96 | TextField { | 101 | TextField { |
395 | 97 | id: textField | 102 | id: textField |
396 | 103 | text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") | ||
397 | 104 | height: units.gu(6) | ||
398 | 98 | } | 105 | } |
399 | 99 | 106 | ||
400 | 100 | FocusScope { | 107 | FocusScope { |
401 | @@ -126,21 +133,32 @@ | |||
402 | 126 | 133 | ||
403 | 127 | TextField { | 134 | TextField { |
404 | 128 | id: customTextField | 135 | id: customTextField |
406 | 129 | text: 'Lorem ipsum dolor sit amet' | 136 | text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") |
407 | 130 | primaryItem: AbstractButton { | 137 | primaryItem: AbstractButton { |
408 | 131 | id: primaryButton | 138 | id: primaryButton |
410 | 132 | height: parent.height | 139 | height: parent.height / 1.7 |
411 | 133 | width: height | 140 | width: height |
412 | 134 | Image { | 141 | Image { |
413 | 135 | anchors.fill: parent | 142 | anchors.fill: parent |
414 | 136 | anchors.margins: units.gu(0.5) | 143 | anchors.margins: units.gu(0.5) |
415 | 137 | source: 'image://theme/torch-on' | 144 | source: 'image://theme/torch-on' |
416 | 138 | } | 145 | } |
417 | 146 | Frame { | ||
418 | 147 | anchors.fill: parent | ||
419 | 148 | anchors.margins: -units.gu(0.46) | ||
420 | 149 | thickness: units.gu(0.21) | ||
421 | 150 | radius: units.gu(1.7) | ||
422 | 151 | color: theme.palette.normal.focus | ||
423 | 152 | visible: parent.keyNavigationFocus | ||
424 | 153 | } | ||
425 | 154 | // FIXME: activeFocusOnTab: true | ||
426 | 155 | Component.onCompleted: activeFocusOnTab = true | ||
427 | 139 | } | 156 | } |
429 | 140 | secondaryItem: AbstractButton { | 157 | secondaryItem: /*Abstract*/Button { |
430 | 141 | id: secondaryButton | 158 | id: secondaryButton |
432 | 142 | height: parent.height | 159 | height: parent.height / 1.7 |
433 | 143 | width: height | 160 | width: height |
434 | 161 | color: activeFocus ? UbuntuColors.orange : UbuntuColors.blue | ||
435 | 144 | Image { | 162 | Image { |
436 | 145 | anchors.fill: parent | 163 | anchors.fill: parent |
437 | 146 | anchors.margins: units.gu(0.5) | 164 | anchors.margins: units.gu(0.5) |
438 | @@ -148,8 +166,68 @@ | |||
439 | 148 | } | 166 | } |
440 | 149 | } | 167 | } |
441 | 150 | } | 168 | } |
442 | 169 | |||
443 | 170 | AbstractButton { | ||
444 | 171 | width: units.gu(10) | ||
445 | 172 | height: units.gu(5) | ||
446 | 173 | Component.onCompleted: activeFocusOnTab = true | ||
447 | 174 | Frame { | ||
448 | 175 | anchors.fill: parent | ||
449 | 176 | anchors.margins: units.gu(0.46) | ||
450 | 177 | thickness: units.gu(0.21) | ||
451 | 178 | radius: units.gu(1.7) | ||
452 | 179 | color: parent.keyNavigationFocus ? theme.palette.normal.focus : theme.palette.normal.foreground | ||
453 | 180 | |||
454 | 181 | AbstractButton { | ||
455 | 182 | anchors.verticalCenter: parent.verticalCenter | ||
456 | 183 | anchors.right: parent.right | ||
457 | 184 | width: height | ||
458 | 185 | height: parent.height / 1.2 | ||
459 | 186 | Component.onCompleted: activeFocusOnTab = true | ||
460 | 187 | Frame { | ||
461 | 188 | anchors.fill: parent | ||
462 | 189 | anchors.margins: units.gu(0.46) | ||
463 | 190 | thickness: units.gu(0.21) | ||
464 | 191 | radius: units.gu(1.7) | ||
465 | 192 | color: parent.keyNavigationFocus ? theme.palette.normal.focus : theme.palette.normal.foreground | ||
466 | 193 | } | ||
467 | 194 | } | ||
468 | 195 | } | ||
469 | 196 | } | ||
470 | 197 | |||
471 | 151 | TextArea { | 198 | TextArea { |
472 | 152 | id: textArea | 199 | id: textArea |
473 | 200 | text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") | ||
474 | 201 | + i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") | ||
475 | 202 | + i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") | ||
476 | 203 | + i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") | ||
477 | 204 | } | ||
478 | 205 | ScrollView { | ||
479 | 206 | width: units.gu(30) | ||
480 | 207 | height: units.gu(12) | ||
481 | 208 | Flickable { | ||
482 | 209 | id: flickable | ||
483 | 210 | anchors.fill: parent | ||
484 | 211 | contentWidth: textInput.paintedWidth | ||
485 | 212 | contentHeight: textInput.paintedHeight | ||
486 | 213 | topMargin: units.gu(2) | ||
487 | 214 | leftMargin: units.gu(2) | ||
488 | 215 | contentX: leftMargin | ||
489 | 216 | contentY: topMargin | ||
490 | 217 | TextEdit { | ||
491 | 218 | id: textInput | ||
492 | 219 | text: textArea.text | ||
493 | 220 | width: flickable.width | ||
494 | 221 | height: flickable.height | ||
495 | 222 | wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere | ||
496 | 223 | } | ||
497 | 224 | Rectangle { | ||
498 | 225 | anchors.fill: parent | ||
499 | 226 | opacity: 0.3 | ||
500 | 227 | color: UbuntuColors.blue // theme.palette.normal.field | ||
501 | 228 | } | ||
502 | 229 | |||
503 | 230 | } | ||
504 | 153 | } | 231 | } |
505 | 154 | TextField { | 232 | TextField { |
506 | 155 | id: password | 233 | id: password |