Merge lp:~bzoltan/ubuntu-ui-toolkit/test_1 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh
Status: Superseded
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/test_1
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 2837 lines (+1049/-284)
66 files modified
apicheck/apicheck.cpp (+10/-0)
components.api (+53/-51)
debian/control (+9/-0)
debian/libubuntugestures5-private-dev.install (+3/-0)
documentation/ubuntu-components.qdoc (+1/-1)
documentation/ubuntu-ui-toolkit-common.qdocconf (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Buttons.qml (+2/-2)
examples/ubuntu-ui-toolkit-gallery/Label.qml (+6/-6)
examples/ubuntu-ui-toolkit-gallery/MainPage.qml (+17/-27)
examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml (+7/-3)
src/Ubuntu/Components/1.2/TextField.qml (+1/-1)
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+1/-0)
src/Ubuntu/Components/1.3/AppHeader.qml (+5/-0)
src/Ubuntu/Components/1.3/MainView.qml (+3/-20)
src/Ubuntu/Components/1.3/TextField.qml (+19/-1)
src/Ubuntu/Components/1.3/UbuntuListView.qml (+178/-9)
src/Ubuntu/Components/1.3/UbuntuListView11.qdoc (+0/-38)
src/Ubuntu/Components/ComponentModule.pro (+0/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+9/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml (+4/-2)
src/Ubuntu/Components/plugin/plugin.cpp (+3/-1)
src/Ubuntu/Components/plugin/plugin.pri (+1/-4)
src/Ubuntu/Components/plugin/quickutils.cpp (+2/-1)
src/Ubuntu/Components/plugin/quickutils.h (+7/-0)
src/Ubuntu/Components/plugin/ucaction.cpp (+114/-16)
src/Ubuntu/Components/plugin/ucaction.h (+8/-1)
src/Ubuntu/Components/plugin/ucbottomedge.cpp (+1/-1)
src/Ubuntu/Components/plugin/ucbottomedgehint.cpp (+1/-1)
src/Ubuntu/Components/plugin/ucfontutils.h (+6/-6)
src/Ubuntu/Components/plugin/ucqquickimageextension.cpp (+11/-5)
src/Ubuntu/Components/plugin/ucscalingimageprovider.cpp (+3/-1)
src/Ubuntu/Components/qmldir (+1/-1)
src/Ubuntu/Test/plugin/plugin.pri (+2/-1)
src/Ubuntu/Test/plugin/uctestextras.cpp (+18/-0)
src/Ubuntu/Test/plugin/uctestextras.h (+2/-0)
src/Ubuntu/UbuntuGestures/UbuntuGestures.pro (+6/-0)
src/Ubuntu/UbuntuGestures/damper.cpp (+1/-1)
src/Ubuntu/UbuntuGestures/ucswipearea.cpp (+8/-8)
src/Ubuntu/UbuntuGestures/ucswipearea_p.h (+2/-3)
src/Ubuntu/UbuntuGestures/ucswipearea_p_p.h (+7/-6)
tests/api/Extinct/Animals/AnimalModule.pro (+1/-1)
tests/api/Extinct/Animals/plugin/plugin.cpp (+2/-0)
tests/api/Extinct/Animals/plugin/plugin.pri (+2/-0)
tests/api/Extinct/Animals/plugin/tarpan.cpp (+59/-0)
tests/api/Extinct/Animals/plugin/tarpan.h (+46/-0)
tests/api/Extinct/Animals/qmldir (+1/-1)
tests/api/components.api (+11/-8)
tests/autopilot/ubuntuuitoolkit/__init__.py (+2/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py (+3/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py (+4/-0)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py (+1/-1)
tests/uitk_test_plan.sh (+2/-0)
tests/unit/plugin_dependency.pri (+1/-1)
tests/unit/runtest.sh (+1/-1)
tests/unit/tst_components/tst_fontutils.qml (+13/-14)
tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp (+1/-1)
tests/unit_x11/tst_bottomedge/tst_bottomedge.pro (+1/-1)
tests/unit_x11/tst_components/battery-100-charging.svg (+25/-0)
tests/unit_x11/tst_components/shape.svg (+77/-0)
tests/unit_x11/tst_components/tst_imageprovider.qml (+29/-4)
tests/unit_x11/tst_components/tst_scrollbar.qml (+67/-25)
tests/unit_x11/tst_components/tst_shortcuts.qml (+58/-0)
tests/unit_x11/tst_components/tst_ubuntulistview13.qml (+105/-0)
tests/unit_x11/tst_swipearea/tst_swipearea.cpp (+2/-2)
tests/unit_x11/tst_swipearea/tst_swipearea.pro (+1/-1)
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/test_1
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+281905@code.launchpad.net

This proposal has been superseded by a proposal from 2016-01-07.

Commit message

test 1

Description of the change

test 1

To post a comment you must log in.

Unmerged revisions

1799. By Zoltan Balogh

test Jenkins

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apicheck/apicheck.cpp'
2--- apicheck/apicheck.cpp 2015-12-02 09:22:28 +0000
3+++ apicheck/apicheck.cpp 2016-01-07 17:36:33 +0000
4@@ -484,6 +484,10 @@
5 writeMetaContent(&object, mainMeta, &knownAttributes);
6
7 object["namespace"] = nameSpace;
8+ // The QML class name derived from the filename is used by AP.
9+ QString className(QFileInfo(filename).baseName());
10+ if (typeName != className)
11+ object["className"] = className;
12 json->insert(id, object);
13 }
14
15@@ -552,6 +556,10 @@
16 return;
17 }
18
19+ // The C++ class is used by AP.
20+ QString className(meta->className());
21+ if (!(isSingleton || isUncreatable || exportStrings.empty()))
22+ object["className"] = className;
23 json->insert(id, object);
24 }
25
26@@ -1102,6 +1110,8 @@
27 QString signature(exports);
28 if (object.contains("namespace"))
29 signature = object.take("namespace").toString() + "." + signature;
30+ if (object.contains("className"))
31+ signature += " " + object.take("className").toString();
32 QString prototype(object.take("prototype").toString());
33 if (!prototype.isEmpty())
34 signature += ": " + convertToId(prototype);
35
36=== modified file 'components.api'
37--- components.api 2015-12-17 09:15:45 +0000
38+++ components.api 2016-01-07 17:36:33 +0000
39@@ -3,12 +3,12 @@
40 signal clicked()
41 signal pressAndHold()
42 property bool pressed
43-Ubuntu.Components.AbstractButton 1.3: ActionItem
44+Ubuntu.Components.AbstractButton 1.3 UCAbstractButton: ActionItem
45 readonly property bool hovered
46 signal clicked()
47 signal pressAndHold()
48 readonly property bool pressed
49-Ubuntu.Components.Action 1.3 1.0 0.1: QtObject
50+Ubuntu.Components.Action 1.3 1.0 0.1 UCAction: QtObject
51 property string description
52 property bool enabled
53 property string iconName
54@@ -40,12 +40,12 @@
55 property string overflowIconName
56 property url overflowIconSource
57 property string overflowText
58-Ubuntu.Components.ActionContext 1.0 0.1: QtObject
59+Ubuntu.Components.ActionContext 1.0 0.1 UCActionContext: QtObject
60 default property list<Action> actions
61 property bool active
62 function addAction(Action action)
63 function removeAction(Action action)
64-Ubuntu.Components.ActionItem 1.0 0.1: StyledItem
65+Ubuntu.Components.ActionItem 1.0 0.1 UCActionItem: StyledItem
66 property Action action
67 property string iconName
68 property url iconSource
69@@ -59,7 +59,7 @@
70 Ubuntu.Components.ActionList 1.3: QtObject
71 property list<Action> actions
72 default property list<Action> children
73-Ubuntu.Components.ActionManager 1.0 0.1: QtObject
74+Ubuntu.Components.ActionManager 1.0 0.1 UCActionManager: QtObject
75 default property list<Action> actions
76 readonly property ActionContext globalContext
77 property list<ActionContext> localContexts
78@@ -90,7 +90,7 @@
79 function var removePages(var page)
80 property Page primaryPage
81 property var primaryPageSource
82-Ubuntu.Components.Alarm 1.0 0.1: QtObject
83+Ubuntu.Components.Alarm 1.0 0.1 UCAlarm: QtObject
84 property QDateTime date
85 property DaysOfWeek daysOfWeek
86 property bool enabled
87@@ -144,17 +144,17 @@
88 Fail
89 InProgress
90 Ready
91-Ubuntu.Components.AlarmModel 1.0 0.1: QAbstractListModel
92+Ubuntu.Components.AlarmModel 1.0 0.1 UCAlarmModel: QAbstractListModel
93 readonly property int count
94 function refresh() 1.0
95 function UCAlarm* get(int index)
96-Ubuntu.Components.Argument 1.0 0.1: QtObject
97+Ubuntu.Components.Argument 1.0 0.1 UCArgument: QtObject
98 property string help
99 function var at(int i)
100 property string name
101 property bool required
102 property QStringList valueNames
103-Ubuntu.Components.Arguments 1.0 0.1: QtObject
104+Ubuntu.Components.Arguments 1.0 0.1 UCArguments: QtObject
105 default property list<Argument> arguments
106 property Argument defaultArgument
107 readonly property bool error
108@@ -175,7 +175,7 @@
109 property var icon
110 property bool iconFrame
111 property bool progression
112-Ubuntu.Components.BottomEdge 1.3: StyledItem
113+Ubuntu.Components.BottomEdge 1.3 UCBottomEdge: StyledItem
114 readonly property BottomEdgeRegion activeRegion
115 property Component contentComponent
116 readonly property Item contentItem
117@@ -205,7 +205,7 @@
118 Committed
119 Hidden
120 Revealed
121-Ubuntu.Components.BottomEdgeHint 1.3: ActionItem
122+Ubuntu.Components.BottomEdgeHint 1.3 UCBottomEdgeHint: ActionItem
123 property int deactivateTimeout
124 property Flickable flickable
125 signal clicked()
126@@ -216,7 +216,7 @@
127 Hidden
128 Inactive
129 Locked
130-Ubuntu.Components.BottomEdgeRegion 1.3: QtObject
131+Ubuntu.Components.BottomEdgeRegion 1.3 UCBottomEdgeRegion: QtObject
132 property Component contentComponent
133 property url contentUrl
134 property bool enabled
135@@ -225,7 +225,7 @@
136 signal exited()
137 signal dragEnded()
138 property double to
139-Ubuntu.Components.Styles.BottomEdgeStyle 1.3: Item
140+Ubuntu.Components.Styles.BottomEdgeStyle 1.3 UCBottomEdgeStyle: Item
141 property Item contentItem
142 property Item panel
143 property Animation panelAnimation
144@@ -299,22 +299,22 @@
145 Ubuntu.Components.Popups.ComposerSheet 1.3: SheetBase
146 signal cancelClicked()
147 signal confirmClicked()
148-Ubuntu.Layouts.ConditionalLayout 1.0 0.1: QtObject
149+Ubuntu.Layouts.ConditionalLayout 1.0 0.1 ULConditionalLayout: QtObject
150 default property Component layout
151 property string name
152 property QQmlBinding when
153-Ubuntu.PerformanceMetrics.CpuUsage 1.0 0.1: Item
154+Ubuntu.PerformanceMetrics.CpuUsage 1.0 0.1 UPMCpuUsage: Item
155 readonly property UPMGraphModel graphModel
156 property int period
157 property int samplingInterval
158-Ubuntu.Components.CrossFadeImage 1.0 0.1: Item
159+Ubuntu.Components.CrossFadeImage 1.0 0.1 CrossFadeImage10: Item
160 property int fadeDuration
161 property int fillMode
162 readonly property bool running
163 property url source
164 property QSizeF sourceSize
165 readonly property int status
166-Ubuntu.Components.CrossFadeImage 1.1: Item
167+Ubuntu.Components.CrossFadeImage 1.1 CrossFadeImage11: Item
168 property int fadeDuration
169 property string fadeStyle
170 property int fillMode
171@@ -468,7 +468,7 @@
172 readonly property bool enabled
173 function play(var customEffect)
174 function play()
175-Ubuntu.Components.ListItems.Header 1.0 0.1: Item
176+Ubuntu.Components.ListItems.Header 1.0 0.1 ListItemHeader: Item
177 property string text
178 Ubuntu.Components.Header 1.0 0.1: AppHeader
179 property string _for_autopilot
180@@ -486,9 +486,9 @@
181 property var tabsModel
182 property string title
183 property bool useDeprecatedToolbar
184-Ubuntu.Components.ListItems.Header 1.3: Item
185+Ubuntu.Components.ListItems.Header 1.3 ListItemHeader: Item
186 property string text
187-Ubuntu.Components.Header 1.3: StyledItem
188+Ubuntu.Components.Header 1.3 UCHeader: StyledItem
189 property bool exposed
190 property Flickable flickable
191 readonly property bool moving
192@@ -498,12 +498,12 @@
193 property string name
194 Ubuntu.Components.Icon 1.1: Icon
195 property url source
196-Ubuntu.Components.InverseMouse 1.0 0.1: Mouse
197-Ubuntu.Components.InverseMouseArea 1.0 0.1: MouseArea
198+Ubuntu.Components.InverseMouse 1.0 0.1 UCInverseMouse: Mouse
199+Ubuntu.Components.InverseMouseArea 1.0 0.1 InverseMouseAreaType: MouseArea
200 function bool contains(QPointF point)
201 property Item sensingArea
202 property bool topmostItem
203-Ubuntu.Layouts.ItemLayout 1.0 0.1: Item
204+Ubuntu.Layouts.ItemLayout 1.0 0.1 ULItemLayout: Item
205 property string item
206 Ubuntu.Components.ListItems.ItemSelector 1.0 0.1: Empty
207 property bool colourImage
208@@ -531,7 +531,7 @@
209 property int selectedIndex
210 Ubuntu.Components.Label 1.0 0.1: Text
211 property string fontSize
212-Ubuntu.Components.Label 1.3: Text
213+Ubuntu.Components.Label 1.3 UCLabel: Text
214 property string fontSize
215 property TextSize textSize
216 Ubuntu.Components.Label.TextSize: Enum
217@@ -541,10 +541,10 @@
218 XLarge
219 XSmall
220 XxSmall
221-Ubuntu.Layouts.Layouts 1.0 0.1: Item
222+Ubuntu.Layouts.Layouts 1.0 0.1 ULLayouts: Item
223 readonly property string currentLayout
224 property list<ConditionalLayout> layouts
225-Ubuntu.Components.ListItem 1.3 1.2: StyledItem
226+Ubuntu.Components.ListItem 1.3 1.2 UCListItem: StyledItem
227 property Action action
228 property color color
229 readonly property Item contentItem
230@@ -567,7 +567,7 @@
231 property bool swipeEnabled 1.3
232 readonly property bool swiped 1.3
233 property ListItemActions trailingActions
234-Ubuntu.Components.ListItemActions 1.2: QtObject
235+Ubuntu.Components.ListItemActions 1.2 UCListItemActions: QtObject
236 property list<Action> actions
237 default property list<QtObject> data
238 property Component delegate
239@@ -582,11 +582,11 @@
240 Dropped
241 Moving
242 Started
243-Ubuntu.Components.ListItemLayout 1.3: SlotsLayout
244+Ubuntu.Components.ListItemLayout 1.3 UCListItemLayout: SlotsLayout
245 readonly property Label subtitle
246 readonly property Label summary
247 readonly property Label title
248-Ubuntu.Components.Styles.ListItemStyle 1.3 1.2: Item
249+Ubuntu.Components.Styles.ListItemStyle 1.3 1.2 UCListItemStyle: Item
250 readonly property bool animatePanels
251 property Item dragPanel
252 property PropertyAnimation dropAnimation
253@@ -595,7 +595,7 @@
254 function swipeEvent(SwipeEvent event)
255 function rebound()
256 property Animation snapAnimation
257-Ubuntu.Components.LiveTimer 1.3: QtObject
258+Ubuntu.Components.LiveTimer 1.3 LiveTimer: QtObject
259 property Frequency frequency
260 signal trigger()
261 property QDateTime relativeTime
262@@ -609,7 +609,7 @@
263 property bool automaticOrientation
264 default property list<QtObject> contentsItem
265 property bool useDeprecatedToolbar
266-Ubuntu.Components.MainView 1.2: MainViewBase
267+Ubuntu.Components.MainView 1.2 MainView12: MainViewBase
268 property bool automaticOrientation
269 default property list<QtObject> contentsItem
270 Ubuntu.Components.MainView 1.3: MainViewBase
271@@ -620,14 +620,14 @@
272 function double lerp(double delta, double from, double to)
273 function double projectValue(double x, double xmin, double xmax, double ymin, double ymax)
274 function double clampAndProject(double x, double xmin, double xmax, double ymin, double ymax)
275-Ubuntu.Components.MimeData 1.0 0.1: QtObject
276+Ubuntu.Components.MimeData 1.0 0.1 QQuickMimeData: QtObject
277 property color color
278 property var data
279 readonly property QStringList formats
280 property string html
281 property string text
282 property list<url> urls
283-Ubuntu.Components.Mouse 1.0 0.1: QtObject
284+Ubuntu.Components.Mouse 1.0 0.1 UCMouse: QtObject
285 readonly property Qt.MouseButtons acceptedButtons
286 property int clickAndHoldThreshold
287 property bool enabled
288@@ -707,12 +707,12 @@
289 property int orientationAngle
290 readonly property bool rotating
291 property bool transitionEnabled
292-Ubuntu.Components.Page 1.0 0.1: PageTreeNode
293+Ubuntu.Components.Page 1.0 0.1 Page10: PageTreeNode
294 property list<Action> actions
295 property Flickable flickable
296 property string title
297 property Item tools
298-Ubuntu.Components.Page 1.1: Page10
299+Ubuntu.Components.Page 1.1 Page11: Page10
300 readonly property PageHeadConfiguration head
301 Ubuntu.Components.Page 1.3: PageTreeNode
302 property Flickable flickable
303@@ -810,7 +810,7 @@
304 function var push(var page, var properties)
305 function var pop()
306 function var clear()
307-Ubuntu.Components.PageTreeNode 1.3: StyledItem
308+Ubuntu.Components.PageTreeNode 1.3 UCPageTreeNode: StyledItem
309 property bool active
310 readonly property Item activeLeafNode
311 property bool isLeaf
312@@ -965,7 +965,7 @@
313 property double value
314 Ubuntu.Components.ProgressionSlot 1.3: Icon
315 property url source
316-Ubuntu.Components.ProportionalShape 1.3: UbuntuShape
317+Ubuntu.Components.ProportionalShape 1.3 UCProportionalShape: UbuntuShape
318 Ubuntu.Components.PullToRefresh 1.1: StyledItem
319 property Component content
320 signal refresh()
321@@ -984,7 +984,7 @@
322 property double activationThreshold
323 property Component defaultContent
324 property bool releaseToRefresh
325-Ubuntu.PerformanceMetrics.RenderingTimes 1.0 0.1: Item
326+Ubuntu.PerformanceMetrics.RenderingTimes 1.0 0.1 UPMRenderingTimes: Item
327 readonly property UPMGraphModel graphModel
328 signal frameRendered(qlonglong renderTime)
329 property int period
330@@ -1004,7 +1004,7 @@
331 property list<Action> actions
332 property var model
333 property int selectedIndex
334-Ubuntu.Components.ServiceProperties 1.1: QtObject
335+Ubuntu.Components.ServiceProperties 1.1 UCServiceProperties: QtObject
336 property string adaptorInterface 1.1
337 readonly property string error 1.1
338 property string path 1.1
339@@ -1062,7 +1062,7 @@
340 property bool overrideVerticalPositioning
341 readonly property SlotsLayoutPadding padding
342 property SlotsLayout.UCSlotPosition position
343-Ubuntu.Components.SlotsLayout 1.3: Item
344+Ubuntu.Components.SlotsLayout 1.3 UCSlotsLayout: Item
345 property Item mainSlot
346 readonly property SlotsLayoutPadding padding
347 Ubuntu.Components.SlotsLayout.UCSlotPosition: Enum
348@@ -1078,7 +1078,7 @@
349 Ubuntu.Components.SortBehavior 1.1: QtObject
350 property Qt.SortOrder order
351 property string property
352-Ubuntu.Components.SortFilterModel 1.1: QSortFilterProxyModel
353+Ubuntu.Components.SortFilterModel 1.1 QSortFilterProxyModelQML: QSortFilterProxyModel
354 readonly property int count
355 readonly property FilterBehavior filter
356 function QVariantMap get(int row)
357@@ -1099,10 +1099,10 @@
358 property var icon
359 property bool iconFrame
360 property bool progression
361-Ubuntu.Components.StateSaver 1.0 0.1: QtObject
362-Ubuntu.Components.StyleHints 1.3: QtObject
363+Ubuntu.Components.StateSaver 1.0 0.1 UCStateSaver: QtObject
364+Ubuntu.Components.StyleHints 1.3 UCStyleHints: QtObject
365 property bool ignoreUnknownProperties
366-Ubuntu.Components.StyledItem 1.3 1.3 1.1 1.0 0.1: Item
367+Ubuntu.Components.StyledItem 1.3 1.3 1.1 1.0 0.1 UCStyledItemBase: Item
368 property bool activeFocusOnPress 1.3
369 readonly property bool keyNavigationFocus 1.3
370 signal activeFocusOnTabChanged2() 1.3
371@@ -1115,7 +1115,7 @@
372 property string subText
373 Ubuntu.Components.ListItems.Subtitled 1.3: Base
374 property string subText
375-Ubuntu.Components.SwipeArea 1.3: Item
376+Ubuntu.Components.SwipeArea 1.3 UCSwipeArea: Item
377 property Direction direction
378 readonly property double distance
379 readonly property bool dragging
380@@ -1205,6 +1205,7 @@
381 function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey, int steps)
382 function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey)
383 function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button)
384+ function removeTimeConstraintsFromSwipeArea(Item item)
385 readonly property bool touchPresent
386 Ubuntu.Components.TextArea 1.0 0.1: StyledItem
387 property bool autoExpand
388@@ -1447,9 +1448,9 @@
389 readonly property int selectionStart
390 property QValidator validator
391 property int verticalAlignment
392-Ubuntu.PerformanceMetrics.TextureFromImage 1.0 0.1: Item
393+Ubuntu.PerformanceMetrics.TextureFromImage 1.0 0.1 UPMTextureFromImage: Item
394 property QImage image
395-Ubuntu.Components.ThemeSettings 1.3: QtObject
396+Ubuntu.Components.ThemeSettings 1.3 UCTheme: QtObject
397 property string name
398 property QtObject palette
399 readonly property ThemeSettings parentTheme
400@@ -1559,13 +1560,14 @@
401 readonly property color warmGrey
402 Ubuntu.Components.UbuntuListView 1.0 0.1: ListView
403 property int expandedIndex
404-Ubuntu.Components.UbuntuListView 1.1: UbuntuListView
405+Ubuntu.Components.UbuntuListView 1.1 UbuntuListView11: UbuntuListView
406 readonly property PullToRefresh pullToRefresh
407-Ubuntu.Components.UbuntuListView 1.3: UbuntuListView
408+Ubuntu.Components.UbuntuListView 1.3: ListView
409+ property int expandedIndex
410 readonly property PullToRefresh pullToRefresh
411 Ubuntu.Components.UbuntuNumberAnimation 1.0 0.1: PropertyAnimation
412 Ubuntu.Components.UbuntuNumberAnimation 1.3: PropertyAnimation
413-Ubuntu.Components.UbuntuShape 1.3 1.2 1.0 0.1 Shape 1.0 0.1: Item
414+Ubuntu.Components.UbuntuShape 1.3 1.2 1.0 0.1 Shape 1.0 0.1 UCUbuntuShape: Item
415 property Aspect aspect 1.3
416 property color backgroundColor 1.3
417 property BackgroundMode backgroundMode 1.3
418@@ -1611,7 +1613,7 @@
419 Ubuntu.Components.UbuntuShape.WrapMode: Enum
420 Repeat
421 Transparent
422-Ubuntu.Components.UbuntuShapeOverlay 1.2: UbuntuShape
423+Ubuntu.Components.UbuntuShapeOverlay 1.2 UCUbuntuShapeOverlay: UbuntuShape
424 property color overlayColor
425 property QRectF overlayRect
426 Ubuntu.Test.UbuntuTestCase 1.0 0.1: TestCase
427
428=== modified file 'debian/control'
429--- debian/control 2015-12-16 09:55:02 +0000
430+++ debian/control 2016-01-07 17:36:33 +0000
431@@ -107,6 +107,15 @@
432 This package contains the development files for
433 Ubuntu gestures library with SwipeArea
434
435+Package: libubuntugestures5-private-dev
436+Architecture: any
437+Multi-Arch: same
438+Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}
439+Depends: ${misc:Depends},
440+ ${shlibs:Depends},
441+Description: Ubuntu gestures library private development files
442+ This package contains the private development files for
443+ Ubuntu gestures library with SwipeArea
444
445
446 Package: ubuntu-ui-toolkit-theme
447
448=== added file 'debian/libubuntugestures5-private-dev.install'
449--- debian/libubuntugestures5-private-dev.install 1970-01-01 00:00:00 +0000
450+++ debian/libubuntugestures5-private-dev.install 2016-01-07 17:36:33 +0000
451@@ -0,0 +1,3 @@
452+usr/include/*/qt5/UbuntuGestures/*/UbuntuGestures/private/ucswipearea_p.h
453+usr/include/*/qt5/UbuntuGestures/*/UbuntuGestures/private/ucswipearea_p_p.h
454+usr/include/*/qt5/UbuntuGestures/*/UbuntuGestures/private/damper_p.h
455
456=== modified file 'documentation/ubuntu-components.qdoc'
457--- documentation/ubuntu-components.qdoc 2015-03-03 13:47:48 +0000
458+++ documentation/ubuntu-components.qdoc 2016-01-07 17:36:33 +0000
459@@ -15,7 +15,7 @@
460 */
461
462 /*!
463- \qmlmodule Ubuntu.Components 1.2
464+ \qmlmodule Ubuntu.Components 1.3
465 \title Basic QML Types
466 \nextpage {Ubuntu User Interface Toolkit}
467 */
468
469=== modified file 'documentation/ubuntu-ui-toolkit-common.qdocconf'
470--- documentation/ubuntu-ui-toolkit-common.qdocconf 2015-09-01 11:59:13 +0000
471+++ documentation/ubuntu-ui-toolkit-common.qdocconf 2016-01-07 17:36:33 +0000
472@@ -29,7 +29,7 @@
473 excludefiles += $BLD/../src/Ubuntu/Components/1.3/PageWrapperUtils.js
474 outputdir = $BLD/html
475 outputformats = HTML
476-version = 1.2
477+version = 1.3
478 syntaxhighlighting = true
479 sourceencoding = UTF-8
480 outputencoding = UTF-8
481
482=== modified file 'examples/ubuntu-ui-toolkit-gallery/Buttons.qml'
483--- examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2015-06-19 05:14:00 +0000
484+++ examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2016-01-07 17:36:33 +0000
485@@ -50,8 +50,8 @@
486 objectName: "button_color"
487 width: units.gu(20)
488 action: Action {
489- text: i18n.tr("Call %1").arg(shortcut)
490- shortcut: 'Ctrl+C'
491+ text: i18n.tr("C&all %1").arg(shortcut)
492+ shortcut: 'Ctrl+L'
493 property bool flipped
494 onTriggered: flipped = !flipped
495 }
496
497=== modified file 'examples/ubuntu-ui-toolkit-gallery/Label.qml'
498--- examples/ubuntu-ui-toolkit-gallery/Label.qml 2015-09-21 14:44:13 +0000
499+++ examples/ubuntu-ui-toolkit-gallery/Label.qml 2016-01-07 17:36:33 +0000
500@@ -28,27 +28,27 @@
501
502 Label {
503 textSize: Label.XxSmall
504- text: "xx-small"
505+ text: "Label.XxSmall"
506 }
507 Label {
508 textSize: Label.XSmall
509- text: "x-small"
510+ text: "Label.XSmall"
511 }
512 Label {
513 textSize: Label.Small
514- text: "small"
515+ text: "Label.Small"
516 }
517 Label {
518 textSize: Label.Medium
519- text: "medium"
520+ text: "Label.Medium"
521 }
522 Label {
523 textSize: Label.Large
524- text: "large"
525+ text: "Label.Large"
526 }
527 Label {
528 textSize: Label.XLarge
529- text: "x-large"
530+ text: "Label.XLarge"
531 }
532 }
533 }
534
535=== modified file 'examples/ubuntu-ui-toolkit-gallery/MainPage.qml'
536--- examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-12-15 14:20:33 +0000
537+++ examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2016-01-07 17:36:33 +0000
538@@ -66,6 +66,18 @@
539 iconName: "starred"
540 visible: !QuickUtils.mouseAttached
541 onTriggered: QuickUtils.mouseAttached = true
542+ },
543+ Action {
544+ text: i18n.tr("Detach keyboard")
545+ iconName: "non-starred"
546+ visible: QuickUtils.keyboardAttached
547+ onTriggered: QuickUtils.keyboardAttached = false
548+ },
549+ Action {
550+ text: i18n.tr("Attach keyboard")
551+ iconName: "starred"
552+ visible: !QuickUtils.keyboardAttached
553+ onTriggered: QuickUtils.keyboardAttached = true
554 }
555 ]
556 }
557@@ -101,36 +113,14 @@
558
559 delegate: ListItem {
560 objectName: model.objectName
561- contentItem {
562- anchors.leftMargin: units.gu(2)
563- anchors.rightMargin: units.gu(2)
564- }
565 enabled: source != ""
566 // Used by Autopilot
567 property string text: label
568 onClicked: widgetList.currentIndex = index
569- Label {
570- id: labelItem
571- anchors {
572- fill: parent
573- rightMargin: units.gu(4)
574- }
575- text: label
576- verticalAlignment: Text.AlignVCenter
577- }
578- Icon {
579- name: "next"
580- width: units.gu(2)
581- height: units.gu(2)
582- anchors {
583- verticalCenter: parent.verticalCenter
584- right: parent.right
585- }
586- }
587- }
588- highlight: Rectangle {
589- color: theme.palette.selected.background
590- }
591- highlightMoveDuration: 0
592+ ListItemLayout {
593+ title.text: label
594+ ProgressionSlot {}
595+ }
596+ }
597 }
598 }
599
600=== modified file 'examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml'
601--- examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml 2015-04-29 07:21:29 +0000
602+++ examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml 2016-01-07 17:36:33 +0000
603@@ -16,7 +16,6 @@
604
605 import QtQuick 2.4
606 import Ubuntu.Components 1.3
607-import Ubuntu.Components.ListItems 1.3 as ListItem
608
609 Template {
610 objectName: "ubuntuListViewTemplate"
611@@ -52,9 +51,14 @@
612 height: units.gu(36)
613 model: fruitModel
614 clip: true
615+ currentIndex: -1
616
617- delegate: ListItem.Standard {
618- text: name
619+ delegate: ListItem {
620+ ListItemLayout {
621+ title.text: name
622+ }
623+ // to enable highlight
624+ onClicked: ListView.view.currentIndex = index
625 }
626
627 pullToRefresh {
628
629=== modified file 'src/Ubuntu/Components/1.2/TextField.qml'
630--- src/Ubuntu/Components/1.2/TextField.qml 2015-12-14 15:47:03 +0000
631+++ src/Ubuntu/Components/1.2/TextField.qml 2016-01-07 17:36:33 +0000
632@@ -929,7 +929,7 @@
633 width: units.gu(2.5)
634 height: width
635 // use icon from icon-theme
636- name: control.hasClearButton && !control.readOnly ? "clear-search" : ""
637+ name: control.hasClearButton && !control.readOnly ? "edit-clear" : ""
638 }
639
640 onClicked: editor.text = ""
641
642=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
643--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-10-29 10:03:14 +0000
644+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-01-07 17:36:33 +0000
645@@ -777,6 +777,7 @@
646
647 property color dividerColor: layout.__propagated.header.dividerColor
648 property color panelColor: layout.__propagated.header.panelColor
649+ property color backgroundColor: layout.__propagated.header.backgroundColor
650
651 visible: !customHeader && holder.pageWrapper && holder.pageWrapper.active
652
653
654=== modified file 'src/Ubuntu/Components/1.3/AppHeader.qml'
655--- src/Ubuntu/Components/1.3/AppHeader.qml 2015-12-14 20:38:59 +0000
656+++ src/Ubuntu/Components/1.3/AppHeader.qml 2016-01-07 17:36:33 +0000
657@@ -32,6 +32,11 @@
658 }
659
660 /*!
661+ The background color of the header. Value set by MainView.
662+ */
663+ property color backgroundColor
664+
665+ /*!
666 The background color of the divider. Value set by MainView.
667 */
668 property color dividerColor
669
670=== modified file 'src/Ubuntu/Components/1.3/MainView.qml'
671--- src/Ubuntu/Components/1.3/MainView.qml 2015-10-13 13:37:43 +0000
672+++ src/Ubuntu/Components/1.3/MainView.qml 2016-01-07 17:36:33 +0000
673@@ -121,28 +121,10 @@
674 UbuntuApplication.inputMethod.keyboardRectangle.height : 0
675 }
676
677- // clip the contents so that it does not overlap the header
678 Item {
679- id: contentsClipper
680+ id: contents
681 anchors {
682- left: parent.left
683- right: parent.right
684- top: headerItem.bottom
685- bottom: parent.bottom
686- }
687- // only clip when necessary
688- // ListView headers may be positioned at the top, independent from
689- // flickable.contentY, so do not clip depending on activePage.flickable.contentY.
690- clip: headerItem.bottomY > 0 && internal.activePage && internal.activePage.flickable
691-
692- Item {
693- id: contents
694- anchors {
695- fill: parent
696-
697- // compensate so that the actual y is always 0
698- topMargin: -parent.y
699- }
700+ fill: parent
701 }
702 }
703
704@@ -159,6 +141,7 @@
705 property real bottomY: headerItem.y + headerItem.height
706 dividerColor: Qt.darker(mainView.headerColor, 1.1)
707 panelColor: Qt.lighter(mainView.headerColor, 1.1)
708+ backgroundColor: mainView.headerColor
709
710 title: internal.activePage ? internal.activePage.title : ""
711 pageStack: internal.activePage ? internal.activePage.pageStack : null
712
713=== modified file 'src/Ubuntu/Components/1.3/TextField.qml'
714--- src/Ubuntu/Components/1.3/TextField.qml 2015-12-15 19:31:38 +0000
715+++ src/Ubuntu/Components/1.3/TextField.qml 2016-01-07 17:36:33 +0000
716@@ -329,6 +329,11 @@
717 inputs. See QLineEdit::inputMask for further details, as the exact same mask strings
718 are used by TextField.
719
720+ Note that when using an inputMask together with echoMode to hide the input
721+ the empty TextField may still show masked characters - consider \l validator instead.
722+
723+ \sa acceptableInput, validator
724+
725 \qmlproperty string inputMask
726 */
727 property alias inputMask: editor.inputMask
728@@ -534,6 +539,19 @@
729 }
730 \endqml
731
732+ The next example is for a use case of typing a PIN with masked characters.
733+
734+ \qml
735+ import QtQuick 2.4
736+ import Ubuntu.Components 1.3
737+
738+ TextField {
739+ echoMode: TextInput.Password
740+ validator: RegExpValidator { regExp: /^\d{4}$/ }
741+ inputMethodHints: Qt.ImhDigitsOnly
742+ }
743+ \endqml
744+
745 \sa acceptableInput, inputMask
746
747 \qmlproperty Validator validator
748@@ -939,7 +957,7 @@
749 width: units.gu(2.5)
750 height: width
751 // use icon from icon-theme
752- name: control.hasClearButton && !control.readOnly ? "clear-search" : ""
753+ name: control.hasClearButton && !control.readOnly ? "edit-clear" : ""
754 }
755
756 onClicked: editor.text = ""
757
758=== removed file 'src/Ubuntu/Components/1.3/UbuntuListView.qml'
759--- src/Ubuntu/Components/1.3/UbuntuListView.qml 2015-04-29 07:21:29 +0000
760+++ src/Ubuntu/Components/1.3/UbuntuListView.qml 1970-01-01 00:00:00 +0000
761@@ -1,143 +0,0 @@
762-/*
763- * Copyright 2014 Canonical Ltd.
764- *
765- * This program is free software; you can redistribute it and/or modify
766- * it under the terms of the GNU Lesser General Public License as published by
767- * the Free Software Foundation; version 3.
768- *
769- * This program is distributed in the hope that it will be useful,
770- * but WITHOUT ANY WARRANTY; without even the implied warranty of
771- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
772- * GNU Lesser General Public License for more details.
773- *
774- * You should have received a copy of the GNU Lesser General Public License
775- * along with this program. If not, see <http://www.gnu.org/licenses/>.
776- */
777-
778-import QtQuick 2.4
779-import Ubuntu.Components 1.3 as Toolkit
780-
781-/*!
782- \qmltype UbuntuListView
783- \inqmlmodule Ubuntu.Components 1.1
784- \ingroup ubuntu
785- \brief A ListView with special features tailored for a look and feel fitting the
786- Ubuntu Touch platform.
787- The UbuntuListView works just like a regular ListView, but it adds special features
788- such as expanding/collapsing items (when used together with the Expandable item).
789- It provides features like automatically positioning the expanding item when it
790- expands and collapsing it again when the user taps outside of it.
791-
792- Examples:
793- \qml
794- import Ubuntu.Components 1.3
795- import Ubuntu.Components.ListItems 1.3 as ListItem
796-
797- Item {
798- ListModel {
799- id: listModel
800- }
801-
802- UbuntuListView {
803- id: ubuntuListView
804- anchors { left: parent.left; right: parent.right }
805- height: units.gu(24)
806- model: listModel
807-
808- delegate: ListItem.Expandable {
809- id: expandingItem
810-
811- expandedHeight: units.gu(30)
812-
813- onClicked: {
814- ubuntuListView.expandedIndex = index;
815- }
816- }
817- }
818- }
819- \endqml
820-*/
821-
822-ListView {
823- id: root
824-
825- /*!
826- The index of the currently expanded item. -1 if no item is expanded.
827- */
828- property int expandedIndex: -1
829-
830- QtObject {
831- id: priv
832-
833- function positionViewAtIndexAnimated(expandedIndex) {
834- animation.from = root.contentY;
835- root.currentIndex = expandedIndex;
836- if (expandedIndex == root.count - 1) {
837- root.positionViewAtIndex(expandedIndex, ListView.End);
838- } else {
839- root.positionViewAtIndex(expandedIndex + 1, ListView.End);
840- }
841-
842- var effectiveExpandedHeight = Math.min(root.currentItem.expandedHeight, root.height - root.currentItem.collapsedHeight);
843- if (root.contentY - root.originY == 0) {
844- if (((root.currentIndex + 1) * root.currentItem.collapsedHeight) + effectiveExpandedHeight > root.height) {
845- animation.to = ((root.currentIndex + 1) * root.currentItem.collapsedHeight + effectiveExpandedHeight) - root.height + root.originY
846- } else {
847- animation.to = root.originY
848- }
849- } else {
850- animation.to = root.contentY + (effectiveExpandedHeight - root.currentItem.collapsedHeight);
851- }
852- animation.start();
853- }
854-
855- function requestFocus(reason) {
856- // lookup for the currentItem, and if it is a FocusScope, focus the view
857- // this will also focus the currentItem
858- if (root.currentItem && root.currentItem.hasOwnProperty("activeFocusOnPress")) {
859- root.forceActiveFocus(reason);
860- }
861- }
862- }
863-
864- focus: true
865-
866- /*!
867- \internal
868- Grab focus when moved, flicked or clicked
869- */
870- onMovementStarted: priv.requestFocus(Qt.MouseFocusReason)
871- onFlickStarted: priv.requestFocus(Qt.MouseFocusReason)
872- Toolkit.Mouse.onClicked: priv.requestFocus(Qt.MouseFocusReason)
873-
874- /*!
875- Expand the item at the given index.
876- */
877- onExpandedIndexChanged: {
878- if (expandedIndex < 0) {
879- return;
880- }
881- priv.positionViewAtIndexAnimated(expandedIndex, ListView.End)
882- }
883-
884- UbuntuNumberAnimation {
885- id: animation
886- target: root
887- property: "contentY"
888- }
889-
890- MouseArea {
891- parent: contentItem
892- anchors.fill: parent
893- z: 2
894- enabled: root.expandedIndex != -1
895- onClicked: root.expandedIndex = -1;
896- }
897-
898- // animate move displaced
899- moveDisplaced: Transition {
900- UbuntuNumberAnimation {
901- properties: "x,y"
902- }
903- }
904-}
905
906=== renamed file 'src/Ubuntu/Components/1.3/UbuntuListView11.qml' => 'src/Ubuntu/Components/1.3/UbuntuListView.qml'
907--- src/Ubuntu/Components/1.3/UbuntuListView11.qml 2015-04-25 08:54:58 +0000
908+++ src/Ubuntu/Components/1.3/UbuntuListView.qml 2016-01-07 17:36:33 +0000
909@@ -1,5 +1,5 @@
910 /*
911- * Copyright 2014 Canonical Ltd.
912+ * Copyright 2015 Canonical Ltd.
913 *
914 * This program is free software; you can redistribute it and/or modify
915 * it under the terms of the GNU Lesser General Public License as published by
916@@ -15,19 +15,188 @@
917 */
918
919 import QtQuick 2.4
920-
921-// documentation in UbuntuListView11.qdoc
922-UbuntuListView {
923-
924- /*!
925- \internal
926- \qmlproperty PullToRefresh pullToRefresh
927+import Ubuntu.Components 1.3 as Toolkit
928+
929+/*!
930+ \qmltype UbuntuListView
931+ \inqmlmodule Ubuntu.Components 1.1
932+ \ingroup ubuntu
933+ \inherits ListView
934+ \brief A ListView with special features tailored for a look and feel fitting the
935+ Ubuntu Touch platform.
936+ The UbuntuListView works just like a regular ListView, but it adds special features
937+ such as expanding/collapsing items (when used together with the Expandable item).
938+ It provides features like automatically positioning the expanding item when it
939+ expands and collapsing it again when the user taps outside of it.
940+
941+ Examples:
942+ \qml
943+ import Ubuntu.Components 1.3
944+ import Ubuntu.Components.ListItems 1.3 as ListItem
945+
946+ Item {
947+ ListModel {
948+ id: listModel
949+ }
950+
951+ UbuntuListView {
952+ id: ubuntuListView
953+ anchors { left: parent.left; right: parent.right }
954+ height: units.gu(24)
955+ model: listModel
956+
957+ delegate: ListItem.Expandable {
958+ id: expandingItem
959+
960+ expandedHeight: units.gu(30)
961+
962+ onClicked: {
963+ ubuntuListView.expandedIndex = index;
964+ }
965+ }
966+ }
967+ }
968+ \endqml
969+*/
970+
971+ListView {
972+ id: root
973+
974+ /*!
975+ \deprecated
976+ The index of the currently expanded item. -1 if no item is expanded.
977+ \b {THIS PROPERTY IS DEPRECATED. USE THE NEW ListItem TO HANDLE EXPANSION}
978+ */
979+ property int expandedIndex: -1
980+
981+ /*!
982+ \qmlproperty pullToRefresh UbuntuListView::pullToRefresh
983+ \readonly
984+ \since Ubuntu.Components 1.1
985+
986+ Attached PullToRefresh to control manual model refresh. The component is disabled
987+ by default.
988+
989+ \qml
990+ import QtQuick 2.4
991+ import Ubuntu.Components 1.3
992+
993+ UbuntuListView {
994+ width: units.gu(40)
995+ height: units.gu(71)
996+ model: XmlListModel {
997+ source: "http://feeds.reuters.com/reuters/topNews"
998+ query: "/rss/channel/item"
999+ XmlRole { name: "title"; query: "title/string()" }
1000+ }
1001+ // let refresh control know when the refresh gets completed
1002+ pullToRefresh {
1003+ enable: true
1004+ refreshing: model.status === XmlListModel.Loading
1005+ onRefresh: model.reload()
1006+ }
1007+ delegate: ListItem {
1008+ ListItemLayout {
1009+ title.text: modelData
1010+ }
1011+ onClicked: {
1012+ ListView.view.model.reload();
1013+ }
1014+ }
1015+ }
1016+ \endqml
1017 */
1018- property alias pullToRefresh: refreshItem
1019+ readonly property alias pullToRefresh: refreshItem
1020
1021 PullToRefresh {
1022 objectName: "listview_pulltorefresh"
1023 id: refreshItem
1024 enabled: false
1025 }
1026+
1027+ QtObject {
1028+ id: priv
1029+
1030+ function positionViewAtIndexAnimated(expandedIndex) {
1031+ animation.from = root.contentY;
1032+ root.currentIndex = expandedIndex;
1033+ if (expandedIndex == root.count - 1) {
1034+ root.positionViewAtIndex(expandedIndex, ListView.End);
1035+ } else {
1036+ root.positionViewAtIndex(expandedIndex + 1, ListView.End);
1037+ }
1038+
1039+ var effectiveExpandedHeight = Math.min(root.currentItem.expandedHeight, root.height - root.currentItem.collapsedHeight);
1040+ if (root.contentY - root.originY == 0) {
1041+ if (((root.currentIndex + 1) * root.currentItem.collapsedHeight) + effectiveExpandedHeight > root.height) {
1042+ animation.to = ((root.currentIndex + 1) * root.currentItem.collapsedHeight + effectiveExpandedHeight) - root.height + root.originY
1043+ } else {
1044+ animation.to = root.originY
1045+ }
1046+ } else {
1047+ animation.to = root.contentY + (effectiveExpandedHeight - root.currentItem.collapsedHeight);
1048+ }
1049+ animation.start();
1050+ }
1051+
1052+ function requestFocus(reason) {
1053+ // lookup for the currentItem, and if it is a FocusScope, focus the view
1054+ // this will also focus the currentItem
1055+ if (root.currentItem && root.currentItem.hasOwnProperty("activeFocusOnPress")) {
1056+ // is the currentItem a ListItem?
1057+ if (QuickUtils.inherits(root.currentItem, "UCListItem")) {
1058+ root.currentItem.requestFocus(reason);
1059+ } else {
1060+ root.forceActiveFocus(reason);
1061+ }
1062+ }
1063+ }
1064+ }
1065+
1066+ focus: true
1067+
1068+ /*!
1069+ \internal
1070+ Grab focus when moved, flicked or clicked
1071+ */
1072+ onMovementStarted: priv.requestFocus(Qt.MouseFocusReason)
1073+ onFlickStarted: priv.requestFocus(Qt.MouseFocusReason)
1074+ Toolkit.Mouse.onClicked: priv.requestFocus(Qt.MouseFocusReason)
1075+
1076+ /*!
1077+ Expand the item at the given index.
1078+ */
1079+ onExpandedIndexChanged: {
1080+ if (expandedIndex < 0) {
1081+ return;
1082+ }
1083+ priv.positionViewAtIndexAnimated(expandedIndex, ListView.End)
1084+ }
1085+
1086+ UbuntuNumberAnimation {
1087+ id: animation
1088+ target: root
1089+ property: "contentY"
1090+ }
1091+
1092+ MouseArea {
1093+ parent: contentItem
1094+ anchors.fill: parent
1095+ z: 2
1096+ enabled: root.expandedIndex != -1
1097+ onClicked: root.expandedIndex = -1;
1098+ }
1099+
1100+ // animate move displaced
1101+ moveDisplaced: Transition {
1102+ UbuntuNumberAnimation {
1103+ properties: "x,y"
1104+ }
1105+ }
1106+
1107+ // highlight current item
1108+ highlight: Rectangle {
1109+ color: theme.palette.selected.background
1110+ }
1111+ highlightMoveDuration: 0
1112 }
1113
1114=== removed file 'src/Ubuntu/Components/1.3/UbuntuListView11.qdoc'
1115--- src/Ubuntu/Components/1.3/UbuntuListView11.qdoc 2015-04-25 08:54:58 +0000
1116+++ src/Ubuntu/Components/1.3/UbuntuListView11.qdoc 1970-01-01 00:00:00 +0000
1117@@ -1,38 +0,0 @@
1118-/*!
1119- \qmlproperty pullToRefresh UbuntuListView::pullToRefresh
1120- \readonly
1121- \since Ubuntu.Components 1.1
1122-
1123- Attached PullToRefresh to control manual model refresh. The component is disabled
1124- by default.
1125-
1126- \qml
1127- import QtQuick 2.4
1128- import Ubuntu.Components 1.2
1129- import Ubuntu.Components.ListItems 1.0
1130-
1131- UbuntuListView {
1132- width: units.gu(40)
1133- height: units.gu(71)
1134- model: XmlListModel {
1135- source: "http://feeds.reuters.com/reuters/topNews"
1136- query: "/rss/channel/item"
1137- XmlRole { name: "title"; query: "title/string()" }
1138- }
1139- // let refresh control know when the refresh gets completed
1140- pullToRefresh {
1141- enable: true
1142- refreshing: model.status === XmlListModel.Loading
1143- onRefresh: model.reload()
1144- }
1145- delegate: ListItem.Standard {
1146- width: ListView.view.width
1147- height: units.gu(5)
1148- text: modelData
1149- onClicked: {
1150- ListView.view.model.reload();
1151- }
1152- }
1153- }
1154- \endqml
1155- */
1156
1157=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
1158--- src/Ubuntu/Components/ComponentModule.pro 2015-12-17 09:13:29 +0000
1159+++ src/Ubuntu/Components/ComponentModule.pro 2016-01-07 17:36:33 +0000
1160@@ -124,7 +124,6 @@
1161 1.3/ToolbarItems.qml \
1162 1.3/tree.js \
1163 1.3/UbuntuColors.qml \
1164- 1.3/UbuntuListView11.qml \
1165 1.3/UbuntuListView.qml \
1166 1.3/UbuntuNumberAnimation.qml \
1167 1.3/ListItemPopover.qml \
1168@@ -136,7 +135,6 @@
1169
1170 OTHER_FILES+= qmldir \
1171 1.3/CrossFadeImage.qdoc \
1172- 1.3/UbuntuListView11.qdoc \
1173 1.3/PageHeadConfiguration.qdoc \
1174 1.3/MainView.qdoc \
1175 1.3/Icon.qdoc
1176
1177=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml'
1178--- src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml 2015-12-16 07:59:19 +0000
1179+++ src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-01-07 17:36:33 +0000
1180@@ -24,7 +24,7 @@
1181
1182 anchors.fill: parent
1183 anchors.margins: -units.gu(0.4)
1184- backgroundColor: Qt.rgba(focusColor.r, focusColor.g, focusColor.b, 0.8)
1185+ backgroundColor: Qt.rgba(focusColor.r, focusColor.g, focusColor.b, 1.0)
1186 visible: styledItem.keyNavigationFocus
1187 z: styledItem.z - 1
1188
1189
1190=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml'
1191--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2015-12-08 22:05:42 +0000
1192+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-01-07 17:36:33 +0000
1193@@ -44,6 +44,15 @@
1194 */
1195 property color titleColor: headerStyle.config.foregroundColor
1196
1197+ /*!
1198+ The background color of the header.
1199+ */
1200+ property color backgroundColor: styledItem.backgroundColor
1201+ Rectangle {
1202+ anchors.fill: parent
1203+ color: headerStyle.backgroundColor
1204+ }
1205+
1206 // FIXME: When the three panel color properties below are removed,
1207 // update unity8/Dash/PageHeader to use the new theming (currently
1208 // in progress) to set these colors.
1209
1210=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml'
1211--- src/Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml 2015-12-11 08:38:42 +0000
1212+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml 2016-01-07 17:36:33 +0000
1213@@ -92,8 +92,10 @@
1214 }
1215
1216 Component.onDestruction: {
1217- rootItem.__propagated.header.visibleChanged.disconnect(fixTopMargin);
1218- rootItem.__propagated.header.heightChanged.disconnect(fixTopMargin);
1219+ if (rootItem && rootItem.__propagated && rootItem.__propagated.header) {
1220+ rootItem.__propagated.header.visibleChanged.disconnect(fixTopMargin);
1221+ rootItem.__propagated.header.heightChanged.disconnect(fixTopMargin);
1222+ }
1223 }
1224
1225 function fixTopMargin() {
1226
1227=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
1228--- src/Ubuntu/Components/plugin/plugin.cpp 2015-12-08 10:54:31 +0000
1229+++ src/Ubuntu/Components/plugin/plugin.cpp 2016-01-07 17:36:33 +0000
1230@@ -71,13 +71,15 @@
1231 #include "uclabel.h"
1232 #include "uclistitemlayout.h"
1233 #include "ucbottomedgehint.h"
1234-#include "gestures/ucswipearea.h"
1235 #include "ucmathutils.h"
1236 #include "ucbottomedge.h"
1237 #include "ucbottomedgeregion.h"
1238 #include "ucbottomedgestyle.h"
1239 #include "ucpagetreenode.h"
1240
1241+// From UbuntuGestures
1242+#include "private/ucswipearea_p.h"
1243+
1244 #include <sys/types.h>
1245 #include <unistd.h>
1246 #include <stdexcept>
1247
1248=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
1249--- src/Ubuntu/Components/plugin/plugin.pri 2015-12-15 15:58:54 +0000
1250+++ src/Ubuntu/Components/plugin/plugin.pri 2016-01-07 17:36:33 +0000
1251@@ -3,7 +3,7 @@
1252 PKGCONFIG += gio-2.0 dbus-1 libnih-dbus
1253 }
1254
1255-QT *= core-private qml qml-private quick quick-private gui-private dbus svg UbuntuGestures
1256+QT *= core-private qml qml-private quick quick-private gui-private dbus svg UbuntuGestures UbuntuGestures_private
1257
1258 equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) {
1259 QT += v8-private
1260@@ -98,8 +98,6 @@
1261 $$PWD/ucimportversionchecker_p.h \
1262 $$PWD/ucbottomedgehint.h \
1263 $$PWD/ucbottomedgehint_p.h \
1264- $$PWD/gestures/ucswipearea.h \
1265- $$PWD/gestures/ucswipearea_p.h \
1266 $$PWD/gestures/damper.h \
1267 $$PWD/gestures/ubuntugesturesqmlglobal.h \
1268 $$PWD/ucmathutils.h \
1269@@ -174,7 +172,6 @@
1270 $$PWD/privates/threelabelsslot_p.cpp \
1271 $$PWD/ucimportversionchecker_p.cpp \
1272 $$PWD/ucbottomedgehint.cpp \
1273- $$PWD/gestures/ucswipearea.cpp \
1274 $$PWD/ucmathutils.cpp \
1275 $$PWD/ucbottomedge.cpp \
1276 $$PWD/ucbottomedgestyle.cpp \
1277
1278=== modified file 'src/Ubuntu/Components/plugin/quickutils.cpp'
1279--- src/Ubuntu/Components/plugin/quickutils.cpp 2015-12-07 09:07:00 +0000
1280+++ src/Ubuntu/Components/plugin/quickutils.cpp 2016-01-07 17:36:33 +0000
1281@@ -33,7 +33,8 @@
1282 QuickUtils::QuickUtils(QObject *parent) :
1283 QObject(parent),
1284 m_rootView(0),
1285- m_mouseAttached(false)
1286+ m_mouseAttached(false),
1287+ m_keyboardAttached(false)
1288 {
1289 QGuiApplication::instance()->installEventFilter(this);
1290 m_omitIM << "ibus" << "none" << "compose";
1291
1292=== modified file 'src/Ubuntu/Components/plugin/quickutils.h'
1293--- src/Ubuntu/Components/plugin/quickutils.h 2015-11-05 13:41:35 +0000
1294+++ src/Ubuntu/Components/plugin/quickutils.h 2016-01-07 17:36:33 +0000
1295@@ -32,6 +32,7 @@
1296 Q_PROPERTY(QString inputMethodProvider READ inputMethodProvider)
1297 Q_PROPERTY(bool touchScreenAvailable READ touchScreenAvailable NOTIFY touchScreenAvailableChanged)
1298 Q_PROPERTY(bool mouseAttached MEMBER m_mouseAttached NOTIFY mouseAttachedChanged)
1299+ Q_PROPERTY(bool keyboardAttached MEMBER m_keyboardAttached NOTIFY keyboardAttachedChanged)
1300 public:
1301 static QuickUtils& instance()
1302 {
1303@@ -53,6 +54,10 @@
1304 {
1305 return m_mouseAttached;
1306 }
1307+ bool keyboardAttached()
1308+ {
1309+ return m_keyboardAttached;
1310+ }
1311
1312 Q_SIGNALS:
1313 void rootObjectChanged();
1314@@ -60,6 +65,7 @@
1315 void deactivated();
1316 void touchScreenAvailableChanged();
1317 void mouseAttachedChanged();
1318+ void keyboardAttachedChanged();
1319
1320 protected:
1321 bool eventFilter(QObject *, QEvent *);
1322@@ -69,6 +75,7 @@
1323 QPointer<QQuickView> m_rootView;
1324 QStringList m_omitIM;
1325 bool m_mouseAttached;
1326+ bool m_keyboardAttached;
1327
1328 void lookupQuickView();
1329 };
1330
1331=== modified file 'src/Ubuntu/Components/plugin/ucaction.cpp'
1332--- src/Ubuntu/Components/plugin/ucaction.cpp 2015-12-13 07:48:56 +0000
1333+++ src/Ubuntu/Components/plugin/ucaction.cpp 2016-01-07 17:36:33 +0000
1334@@ -15,6 +15,7 @@
1335 */
1336
1337 #include "ucaction.h"
1338+#include "quickutils.h"
1339
1340 #include <QtDebug>
1341 #include <QtQml/QQmlInfo>
1342@@ -22,6 +23,30 @@
1343 #include <QtQuick/qquickwindow.h>
1344 #include <private/qguiapplication_p.h>
1345
1346+bool shortcutContextMatcher(QObject* object, Qt::ShortcutContext context)
1347+{
1348+ UCAction* action = static_cast<UCAction*>(object);
1349+ // Can't access member here because it's not public
1350+ if (!action->property("enabled").toBool())
1351+ return false;
1352+
1353+ switch (context) {
1354+ case Qt::ApplicationShortcut:
1355+ return true;
1356+ case Qt::WindowShortcut: {
1357+ QObject* window = object;
1358+ while (window && !window->isWindowType()) {
1359+ window = window->parent();
1360+ if (QQuickItem* item = qobject_cast<QQuickItem*>(window))
1361+ window = item->window();
1362+ }
1363+ return window && window == QGuiApplication::focusWindow();
1364+ }
1365+ default: break;
1366+ }
1367+ return false;
1368+}
1369+
1370 /*!
1371 * \qmltype Action
1372 * \instantiates UCAction
1373@@ -74,6 +99,20 @@
1374 * as well as to define actions for pages, or when defining options in \c ListItemOptions.
1375 *
1376 * Examples: See \l Page
1377+ *
1378+ * \section2 Mnemonics
1379+ * Since Ubuntu.Components 1.3 Action supports mnemonics. Mnemonics are shortcuts
1380+ * defined in the \l text property, prefixed the shortcut letter with \&. For instance
1381+ * \c "\&Call" will bint the \c "Alt-C" shortcut to the action. When a mnemonic
1382+ * is detected on the Action and a keyboard is attached to the device, the \l text
1383+ * property will provide a formatted text having the mnemonic letter underscored.
1384+ * \qml
1385+ * Action {
1386+ * id: call
1387+ * iconName: "call"
1388+ * text: "&Call"
1389+ * }
1390+ * \endqml
1391 */
1392
1393 /*!
1394@@ -94,7 +133,69 @@
1395 /*!
1396 * \qmlproperty string Action::text
1397 * The user visible primary label of the action.
1398+ *
1399+ * Mnemonics are shortcuts prefixed in the text with \&. If the text has multiple
1400+ * occurences of the \& character, the first one will be considered for the shortcut.
1401+ * The \& character cannot be used as shortcut.
1402 */
1403+QString UCAction::text()
1404+{
1405+ // if we have a mnemonic, underscore it
1406+ if (!m_mnemonic.isEmpty()) {
1407+
1408+ QString mnemonic = "&" + m_mnemonic.toString().remove("Alt+");
1409+ // patch special cases
1410+ mnemonic.replace("Space", " ");
1411+ int mnemonicIndex = m_text.indexOf(mnemonic);
1412+ if (mnemonicIndex < 0) {
1413+ // try lower case
1414+ mnemonic = mnemonic.toLower();
1415+ mnemonicIndex = m_text.indexOf(mnemonic);
1416+ }
1417+ QString displayText(m_text);
1418+ // FIXME: we need QInputDeviceInfo to detect the keyboard attechment
1419+ // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1276808
1420+ if (QuickUtils::instance().keyboardAttached()) {
1421+ // underscore the character
1422+ displayText.replace(mnemonicIndex, mnemonic.length(), "<u>" + mnemonic[1] + "</u>");
1423+ } else {
1424+ displayText.remove(mnemonicIndex, 1);
1425+ }
1426+ return displayText;
1427+ }
1428+ return m_text;
1429+}
1430+void UCAction::setText(const QString &text)
1431+{
1432+ if (m_text == text) {
1433+ return;
1434+ }
1435+ m_text = text;
1436+ setMnemonicFromText(m_text);
1437+ Q_EMIT textChanged();
1438+}
1439+void UCAction::resetText()
1440+{
1441+ setText(QString());
1442+}
1443+
1444+void UCAction::setMnemonicFromText(const QString &text)
1445+{
1446+ QKeySequence sequence = QKeySequence::mnemonic(text);
1447+ if (sequence == m_mnemonic) {
1448+ return;
1449+ }
1450+ if (!m_mnemonic.isEmpty()) {
1451+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(0, this, m_mnemonic);
1452+ }
1453+
1454+ m_mnemonic = sequence;
1455+
1456+ if (!m_mnemonic.isEmpty()) {
1457+ Qt::ShortcutContext context = Qt::WindowShortcut;
1458+ QGuiApplicationPrivate::instance()->shortcutMap.addShortcut(this, m_mnemonic, context, shortcutContextMatcher);
1459+ }
1460+}
1461
1462 /*!
1463 * \qmlproperty string Action::keywords
1464@@ -158,11 +259,16 @@
1465 , m_published(false)
1466 {
1467 generateName();
1468+ // FIXME: we need QInputDeviceInfo to detect the keyboard attechment
1469+ // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1276808
1470+ connect(&QuickUtils::instance(), &QuickUtils::keyboardAttachedChanged,
1471+ this, &UCAction::onKeyboardAttached);
1472 }
1473
1474 UCAction::~UCAction()
1475 {
1476 resetShortcut();
1477+ resetText();
1478 }
1479
1480 bool UCAction::isValidType(QVariant::Type valueType)
1481@@ -249,22 +355,6 @@
1482 qWarning() << "Action.itemHint is a DEPRECATED property. Use ActionItems to specify the representation of an Action.";
1483 }
1484
1485-bool shortcutContextMatcher(QObject* object, Qt::ShortcutContext)
1486-{
1487- UCAction* action = static_cast<UCAction*>(object);
1488- // Can't access member here because it's not public
1489- if (!action->property("enabled").toBool())
1490- return false;
1491-
1492- QObject* window = object;
1493- while (window && !window->isWindowType()) {
1494- window = window->parent();
1495- if (QQuickItem* item = qobject_cast<QQuickItem*>(window))
1496- window = item->window();
1497- }
1498- return window && window == QGuiApplication::focusWindow();
1499-}
1500-
1501 QKeySequence sequenceFromVariant(const QVariant& variant) {
1502 if (variant.type() == QVariant::Int)
1503 return static_cast<QKeySequence::StandardKey>(variant.toInt());
1504@@ -320,6 +410,14 @@
1505 return true;
1506 }
1507
1508+// trigger text changes whenever HW keyboad is attached/detached
1509+void UCAction::onKeyboardAttached()
1510+{
1511+ if (!m_mnemonic.isEmpty()) {
1512+ Q_EMIT textChanged();
1513+ }
1514+}
1515+
1516 /*!
1517 * \qmlmethod Action::trigger(var value)
1518 * Checks the \c value against the action \l parameterType and triggers the action.
1519
1520=== modified file 'src/Ubuntu/Components/plugin/ucaction.h'
1521--- src/Ubuntu/Components/plugin/ucaction.h 2015-12-14 06:15:16 +0000
1522+++ src/Ubuntu/Components/plugin/ucaction.h 2016-01-07 17:36:33 +0000
1523@@ -20,6 +20,7 @@
1524 #include <QtCore/QObject>
1525 #include <QtCore/QVariant>
1526 #include <QtCore/QUrl>
1527+#include <QtGui/QKeySequence>
1528
1529 // the function detects whether QML has an overridden trigger() slot available
1530 // and invokes the one with the appropriate signature
1531@@ -51,7 +52,7 @@
1532 // transferred from Unity Actions
1533 Q_ENUMS(Type)
1534 Q_PROPERTY(QString name MEMBER m_name WRITE setName NOTIFY nameChanged)
1535- Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged)
1536+ Q_PROPERTY(QString text READ text WRITE setText RESET resetText NOTIFY textChanged)
1537 Q_PROPERTY(QString iconName MEMBER m_iconName WRITE setIconName NOTIFY iconNameChanged)
1538 Q_PROPERTY(QString description MEMBER m_description NOTIFY descriptionChanged)
1539 Q_PROPERTY(QString keywords MEMBER m_keywords NOTIFY keywordsChanged)
1540@@ -84,6 +85,9 @@
1541 }
1542
1543 void setName(const QString &name);
1544+ QString text();
1545+ void setText(const QString &text);
1546+ void resetText();
1547 void setIconName(const QString &name);
1548 void setIconSource(const QUrl &url);
1549 void setItemHint(QQmlComponent *);
1550@@ -114,6 +118,7 @@
1551 QString m_description;
1552 QString m_keywords;
1553 QVariant m_shortcut;
1554+ QKeySequence m_mnemonic;
1555 QQmlComponent *m_itemHint;
1556 Type m_parameterType;
1557 bool m_factoryIconSource:1;
1558@@ -130,7 +135,9 @@
1559
1560 bool isValidType(QVariant::Type valueType);
1561 void generateName();
1562+ void setMnemonicFromText(const QString &text);
1563 bool event(QEvent *event);
1564+ void onKeyboardAttached();
1565 };
1566
1567 #endif // UCACTION_H
1568
1569=== modified file 'src/Ubuntu/Components/plugin/ucbottomedge.cpp'
1570--- src/Ubuntu/Components/plugin/ucbottomedge.cpp 2015-12-14 07:21:44 +0000
1571+++ src/Ubuntu/Components/plugin/ucbottomedge.cpp 2016-01-07 17:36:33 +0000
1572@@ -34,7 +34,7 @@
1573 #include "ucheader.h"
1574 #include "ucaction.h"
1575 #include "quickutils.h"
1576-#include "gestures/ucswipearea.h"
1577+#include "private/ucswipearea_p.h"
1578 #include <QtQuick/private/qquickanimation_p.h>
1579
1580 Q_LOGGING_CATEGORY(ucBottomEdge, "ubuntu.components.BottomEdge", QtMsgType::QtWarningMsg)
1581
1582=== modified file 'src/Ubuntu/Components/plugin/ucbottomedgehint.cpp'
1583--- src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-12-14 16:05:03 +0000
1584+++ src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2016-01-07 17:36:33 +0000
1585@@ -23,7 +23,7 @@
1586 #include "ucnamespace.h"
1587 #include "ucunits.h"
1588 #include "ucaction.h"
1589-#include "gestures/ucswipearea.h"
1590+#include "private/ucswipearea_p.h"
1591 #include "propertychange_p.h"
1592 #include <QtQml/private/qqmlproperty_p.h>
1593 #include <QtQuick/private/qquickflickable_p.h>
1594
1595=== modified file 'src/Ubuntu/Components/plugin/ucfontutils.h'
1596--- src/Ubuntu/Components/plugin/ucfontutils.h 2015-09-22 14:39:47 +0000
1597+++ src/Ubuntu/Components/plugin/ucfontutils.h 2016-01-07 17:36:33 +0000
1598@@ -26,12 +26,12 @@
1599
1600 public:
1601 static constexpr float fontUnits = 14.0f;
1602- static constexpr float xxSmallScale = 0.677f;
1603- static constexpr float xSmallScale = 0.804f;
1604- static constexpr float smallScale = 0.931f;
1605- static constexpr float mediumScale = 1.079f;
1606- static constexpr float largeScale = 1.291f;
1607- static constexpr float xLargeScale = 1.714f;
1608+ static constexpr float xxSmallScale = 0.606f;
1609+ static constexpr float xSmallScale = 0.707f;
1610+ static constexpr float smallScale = 0.857f;
1611+ static constexpr float mediumScale = 1.0f;
1612+ static constexpr float largeScale = 1.414f;
1613+ static constexpr float xLargeScale = 1.905f;
1614
1615 static UCFontUtils& instance()
1616 {
1617
1618=== modified file 'src/Ubuntu/Components/plugin/ucqquickimageextension.cpp'
1619--- src/Ubuntu/Components/plugin/ucqquickimageextension.cpp 2015-10-15 08:43:17 +0000
1620+++ src/Ubuntu/Components/plugin/ucqquickimageextension.cpp 2016-01-07 17:36:33 +0000
1621@@ -77,16 +77,19 @@
1622 int separatorPosition = resolved.indexOf("/");
1623 QString scaleFactor = resolved.left(separatorPosition);
1624 QString selectedFilePath = resolved.mid(separatorPosition+1);
1625+ QString fragment(m_source.hasFragment() ? "#" + m_source.fragment() : QString(""));
1626
1627 if (scaleFactor == "1") {
1628 if (qFuzzyCompare(qGuiApp->devicePixelRatio(), (qreal)1.0)
1629 || selectedFilePath.endsWith(".svg") || selectedFilePath.endsWith(".svgz")) {
1630- // No scaling necessary. Just pass the file as is.
1631- m_image->setSource(QUrl::fromLocalFile(selectedFilePath));
1632+ // Take care to pass the original fragment
1633+ QUrl selectedFileUrl(QUrl::fromLocalFile(selectedFilePath));
1634+ selectedFileUrl.setFragment(fragment);
1635+ m_image->setSource(selectedFileUrl);
1636 } else {
1637 // Need to scale the pixel-based image to suit the devicePixelRatio setting ourselves.
1638 // If we let Qt do it, Qt will not choose the UITK-supported "@gu" scaled images.
1639- m_image->setSource(QUrl("image://scaling/1/" + selectedFilePath));
1640+ m_image->setSource(QUrl("image://scaling/1/" + selectedFilePath + fragment));
1641 // explicitly set the source size in the QQuickImageBase, this persuades it that the
1642 // supplied image is suitable for the current devicePixelRatio.
1643 m_image->setSourceSize(m_image->sourceSize());
1644@@ -95,7 +98,7 @@
1645 // Prepend "image://scaling" for the image to be loaded by UCScalingImageProvider.
1646 if (!m_source.path().endsWith(".sci")) {
1647 // Regular image file
1648- m_image->setSource(QUrl("image://scaling/" + resolved));
1649+ m_image->setSource(QUrl("image://scaling/" + resolved + fragment));
1650 } else {
1651 // .sci image file. Rewrite the .sci file into a temporary file.
1652 bool rewritten = true;
1653@@ -124,7 +127,10 @@
1654 }
1655
1656 if (rewritten) {
1657- m_image->setSource(QUrl::fromLocalFile(rewrittenSciFile->fileName()));
1658+ // Take care to pass the original fragment
1659+ QUrl rewrittenSciFileUrl(QUrl::fromLocalFile(rewrittenSciFile->fileName()));
1660+ rewrittenSciFileUrl.setFragment(fragment);
1661+ m_image->setSource(rewrittenSciFileUrl);
1662 } else {
1663 m_image->setSource(m_source);
1664 }
1665
1666=== modified file 'src/Ubuntu/Components/plugin/ucscalingimageprovider.cpp'
1667--- src/Ubuntu/Components/plugin/ucscalingimageprovider.cpp 2014-09-30 12:10:46 +0000
1668+++ src/Ubuntu/Components/plugin/ucscalingimageprovider.cpp 2016-01-07 17:36:33 +0000
1669@@ -40,7 +40,9 @@
1670 {
1671 int separatorPosition = id.indexOf("/");
1672 float scaleFactor = id.left(separatorPosition).toFloat();
1673- QString path = id.mid(separatorPosition+1);
1674+ int fragmentPosition = id.lastIndexOf("#");
1675+ int pathLength = fragmentPosition > -1 ? fragmentPosition - separatorPosition - 1 : -1;
1676+ QString path = id.mid(separatorPosition + 1, pathLength);
1677 QFile file(path);
1678
1679 if (file.open(QIODevice::ReadOnly)) {
1680
1681=== modified file 'src/Ubuntu/Components/qmldir'
1682--- src/Ubuntu/Components/qmldir 2015-12-17 09:13:29 +0000
1683+++ src/Ubuntu/Components/qmldir 2016-01-07 17:36:33 +0000
1684@@ -130,7 +130,7 @@
1685 OrientationHelper 1.3 1.3/OrientationHelper.qml
1686 UbuntuNumberAnimation 1.3 1.3/UbuntuNumberAnimation.qml
1687 PullToRefresh 1.3 1.3/PullToRefresh.qml
1688-UbuntuListView 1.3 1.3/UbuntuListView11.qml
1689+UbuntuListView 1.3 1.3/UbuntuListView.qml
1690 Captions 1.3 1.3/Captions.qml
1691 internal ColorUtils 1.3/colorUtils.js
1692 DateUtils 1.3 1.3/dateUtils.js
1693
1694=== modified file 'src/Ubuntu/Test/plugin/plugin.pri'
1695--- src/Ubuntu/Test/plugin/plugin.pri 2015-10-21 08:33:21 +0000
1696+++ src/Ubuntu/Test/plugin/plugin.pri 2016-01-07 17:36:33 +0000
1697@@ -1,4 +1,4 @@
1698-QT *= core-private qml qml-private quick quick-private gui-private testlib
1699+QT *= core-private qml qml-private quick quick-private gui-private testlib UbuntuGestures
1700
1701 equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) {
1702 QT *= v8-private
1703@@ -7,6 +7,7 @@
1704 CONFIG += no_keywords
1705 DEFINES += UBUNTU_QML_IMPORT_PATH='\\"$${ROOT_BUILD_DIR}/qml\\"'
1706 DEFINES += QT_USE_QSTRINGBUILDER
1707+INCLUDEPATH += ../UbuntuGestures
1708
1709 TARGET = $$qtLibraryTarget($$TARGET)
1710 uri = Ubuntu.Test
1711
1712=== modified file 'src/Ubuntu/Test/plugin/uctestextras.cpp'
1713--- src/Ubuntu/Test/plugin/uctestextras.cpp 2015-11-25 07:44:10 +0000
1714+++ src/Ubuntu/Test/plugin/uctestextras.cpp 2016-01-07 17:36:33 +0000
1715@@ -17,7 +17,11 @@
1716 #include "uctestextras.h"
1717 #include "uctestcase.h"
1718
1719+#include "ucswipearea_p.h"
1720+#include "ucswipearea_p_p.h"
1721+
1722 #include <qpa/qwindowsysteminterface.h>
1723+#include <private/qobject_p.h>
1724 #include <QSysInfo>
1725
1726 const char *DEVICE_MISSING_MSG = "No touch device registered. Register one using registerTouchDevice() before using %1";
1727@@ -375,3 +379,17 @@
1728 }
1729 QTest::mouseRelease(item->window(), button, stateKey, movePoint, delay);
1730 }
1731+
1732+
1733+void UCTestExtras::removeTimeConstraintsFromSwipeArea(QQuickItem *item)
1734+{
1735+ UCSwipeArea *swipeArea = dynamic_cast<UCSwipeArea*>(item);
1736+ if (!swipeArea) {
1737+ qWarning() << item << "is not a SwipeArea";
1738+ return;
1739+ }
1740+
1741+ UCSwipeAreaPrivate *priv = static_cast<UCSwipeAreaPrivate *>(QObjectPrivate::get(swipeArea));
1742+ priv->setMaxTime(60 * 60 * 1000);
1743+ priv->setCompositionTime(0);
1744+}
1745
1746=== modified file 'src/Ubuntu/Test/plugin/uctestextras.h'
1747--- src/Ubuntu/Test/plugin/uctestextras.h 2015-11-24 15:23:02 +0000
1748+++ src/Ubuntu/Test/plugin/uctestextras.h 2016-01-07 17:36:33 +0000
1749@@ -46,6 +46,8 @@
1750
1751 static void mouseDrag(QQuickItem *item, const QPoint &from, const QPoint &delta, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, int steps = -1, int delay = -1);
1752
1753+ static void removeTimeConstraintsFromSwipeArea(QQuickItem *item);
1754+
1755 public: // yet for cpp use
1756 static void touchDragWithPoints(int touchId, QQuickItem *item, QList<QPoint> points, int delay = -1);
1757 static void mouseDragWithPoints(QQuickItem *item, QList<QPoint> points, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, int delay = -1);
1758
1759=== modified file 'src/Ubuntu/UbuntuGestures/UbuntuGestures.pro'
1760--- src/Ubuntu/UbuntuGestures/UbuntuGestures.pro 2015-11-17 13:01:00 +0000
1761+++ src/Ubuntu/UbuntuGestures/UbuntuGestures.pro 2016-01-07 17:36:33 +0000
1762@@ -21,6 +21,10 @@
1763 unownedtouchevent.h \
1764 ubuntugesturesglobal.h \
1765 pool.h \
1766+ ucswipearea_p.h \
1767+ ucswipearea_p_p.h \
1768+ damper.h \
1769+
1770
1771 SOURCES += candidateinactivitytimer.cpp \
1772 debughelpers.cpp \
1773@@ -29,3 +33,5 @@
1774 touchownershipevent.cpp \
1775 touchregistry.cpp \
1776 unownedtouchevent.cpp \
1777+ ucswipearea.cpp \
1778+ damper.cpp \
1779\ No newline at end of file
1780
1781=== renamed file 'src/Ubuntu/Components/plugin/gestures/damper.cpp' => 'src/Ubuntu/UbuntuGestures/damper.cpp'
1782--- src/Ubuntu/Components/plugin/gestures/damper.cpp 2015-10-21 08:33:21 +0000
1783+++ src/Ubuntu/UbuntuGestures/damper.cpp 2016-01-07 17:36:33 +0000
1784@@ -14,7 +14,7 @@
1785 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1786 */
1787
1788-#include "Damper.h"
1789+#include "damper_p.h"
1790 #include <QDebug>
1791
1792 QDebug operator<<(QDebug dbg, const DampedPointF &p)
1793
1794=== renamed file 'src/Ubuntu/Components/plugin/gestures/damper.h' => 'src/Ubuntu/UbuntuGestures/damper_p.h'
1795=== renamed file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp' => 'src/Ubuntu/UbuntuGestures/ucswipearea.cpp'
1796--- src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp 2015-12-16 09:52:31 +0000
1797+++ src/Ubuntu/UbuntuGestures/ucswipearea.cpp 2016-01-07 17:36:33 +0000
1798@@ -15,7 +15,7 @@
1799 *
1800 */
1801
1802-#include "ucswipearea_p.h"
1803+#include "ucswipearea_p_p.h"
1804
1805 #include <QQuickWindow>
1806 #include <QtCore/qmath.h>
1807@@ -71,19 +71,19 @@
1808
1809 switch (ev->type()) {
1810 case QEvent::TouchBegin:
1811- message.append("TouchBegin ");
1812+ message.append(QStringLiteral("TouchBegin "));
1813 break;
1814 case QEvent::TouchUpdate:
1815- message.append("TouchUpdate ");
1816+ message.append(QStringLiteral("TouchUpdate "));
1817 break;
1818 case QEvent::TouchEnd:
1819- message.append("TouchEnd ");
1820+ message.append(QStringLiteral("TouchEnd "));
1821 break;
1822 case QEvent::TouchCancel:
1823- message.append("TouchCancel ");
1824+ message.append(QStringLiteral("TouchCancel "));
1825 break;
1826 default:
1827- message.append("INVALID_TOUCH_EVENT_TYPE ");
1828+ message.append(QStringLiteral("INVALID_TOUCH_EVENT_TYPE "));
1829 }
1830
1831 Q_FOREACH(const QTouchEvent::TouchPoint& touchPoint, ev->touchPoints()) {
1832@@ -859,7 +859,7 @@
1833
1834 QString ActiveTouchesInfo::toString()
1835 {
1836- QString string = "(";
1837+ QString string = QStringLiteral("(");
1838
1839 {
1840 QTextStream stream(&string);
1841@@ -869,7 +869,7 @@
1842 });
1843 }
1844
1845- string.append(")");
1846+ string.append(QStringLiteral(")"));
1847
1848 return string;
1849 }
1850
1851=== renamed file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.h' => 'src/Ubuntu/UbuntuGestures/ucswipearea_p.h'
1852--- src/Ubuntu/Components/plugin/gestures/ucswipearea.h 2015-12-10 08:03:24 +0000
1853+++ src/Ubuntu/UbuntuGestures/ucswipearea_p.h 2016-01-07 17:36:33 +0000
1854@@ -19,8 +19,7 @@
1855 #define UCSWIPEAREA_H
1856
1857 #include <QtQuick/QQuickItem>
1858-#include "ubuntugesturesqmlglobal.h"
1859-#include "damper.h"
1860+#include "ubuntugesturesglobal.h"
1861
1862 // lib UbuntuGestures
1863 #include <UbuntuGestures/Pool>
1864@@ -34,7 +33,7 @@
1865 class UCSwipeAreaPrivate;
1866
1867 class UCSwipeAreaPrivate;
1868-class UBUNTUGESTURESQML_EXPORT UCSwipeArea : public QQuickItem
1869+class UBUNTUGESTURES_EXPORT UCSwipeArea : public QQuickItem
1870 {
1871 Q_OBJECT
1872
1873
1874=== renamed file 'src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h' => 'src/Ubuntu/UbuntuGestures/ucswipearea_p_p.h'
1875--- src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h 2015-12-16 09:52:31 +0000
1876+++ src/Ubuntu/UbuntuGestures/ucswipearea_p_p.h 2016-01-07 17:36:33 +0000
1877@@ -18,18 +18,20 @@
1878 #ifndef UCSWIPEAREAPRIVATE_H
1879 #define UCSWIPEAREAPRIVATE_H
1880
1881-#include "ucswipearea.h"
1882+#include "ucswipearea_p.h"
1883 #include <QtQuick/private/qquickitem_p.h>
1884
1885+#include "damper_p.h"
1886+
1887 // Information about an active touch point
1888-struct UBUNTUGESTURESQML_EXPORT ActiveTouchInfo {
1889+struct UBUNTUGESTURES_EXPORT ActiveTouchInfo {
1890 ActiveTouchInfo() : id(-1), startTime(-1) {}
1891 bool isValid() const { return id != -1; }
1892 void reset() { id = -1; }
1893 int id;
1894 qint64 startTime;
1895 };
1896-class UBUNTUGESTURESQML_EXPORT ActiveTouchesInfo {
1897+class UBUNTUGESTURES_EXPORT ActiveTouchesInfo {
1898 public:
1899 ActiveTouchesInfo(const UbuntuGestures::SharedTimeSource &timeSource);
1900 void update(QTouchEvent *event);
1901@@ -46,7 +48,7 @@
1902 };
1903
1904 class UCSwipeAreaStatusListener;
1905-class UBUNTUGESTURESQML_EXPORT UCSwipeAreaPrivate : public QQuickItemPrivate
1906+class UBUNTUGESTURES_EXPORT UCSwipeAreaPrivate : public QQuickItemPrivate
1907 {
1908 Q_DECLARE_PUBLIC(UCSwipeArea)
1909
1910@@ -71,7 +73,6 @@
1911 // Useful for testing, where a fake time source can be supplied
1912 void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
1913
1914-public:
1915 // Describes the state of the directional drag gesture.
1916 enum Status {
1917 // Waiting for a new touch point to land on this area. No gesture is being processed
1918@@ -163,7 +164,7 @@
1919 bool immediateRecognition;
1920 };
1921
1922-class UBUNTUGESTURESQML_EXPORT UCSwipeAreaStatusListener
1923+class UBUNTUGESTURES_EXPORT UCSwipeAreaStatusListener
1924 {
1925 public:
1926 virtual void swipeStatusChanged(UCSwipeAreaPrivate::Status /*old*/, UCSwipeAreaPrivate::Status /*new*/) {}
1927
1928=== modified file 'tests/api/Extinct/Animals/AnimalModule.pro'
1929--- tests/api/Extinct/Animals/AnimalModule.pro 2015-11-30 15:39:52 +0000
1930+++ tests/api/Extinct/Animals/AnimalModule.pro 2016-01-07 17:36:33 +0000
1931@@ -8,7 +8,7 @@
1932 QML_FILES += \
1933 Andrewsarchus.qml \
1934 Paratriisodon.qml \
1935- gigantophis.qml \
1936+ Gigantophis.qml \
1937 test.qml \
1938 digger.js \
1939
1940
1941=== renamed file 'tests/api/Extinct/Animals/gigantophis.qml' => 'tests/api/Extinct/Animals/Gigantophis.qml'
1942=== modified file 'tests/api/Extinct/Animals/plugin/plugin.cpp'
1943--- tests/api/Extinct/Animals/plugin/plugin.cpp 2015-12-11 10:38:46 +0000
1944+++ tests/api/Extinct/Animals/plugin/plugin.cpp 2016-01-07 17:36:33 +0000
1945@@ -17,6 +17,7 @@
1946 */
1947
1948 #include "plugin.h"
1949+#include "tarpan.h"
1950 #include "smilodon.h"
1951 #include "pangaea.h"
1952 #include "rune.h"
1953@@ -50,6 +51,7 @@
1954 {
1955 Q_ASSERT(uri == QLatin1String("Extinct.Animals"));
1956
1957+ qmlRegisterType<EATarpan>();
1958 qmlRegisterType<EASmilodon>(uri, 1, 0, "Smilodon");
1959 qmlRegisterType<EASmilodon>(uri, 0, 1, "ScimitarCat");
1960
1961
1962=== modified file 'tests/api/Extinct/Animals/plugin/plugin.pri'
1963--- tests/api/Extinct/Animals/plugin/plugin.pri 2015-12-02 09:22:28 +0000
1964+++ tests/api/Extinct/Animals/plugin/plugin.pri 2016-01-07 17:36:33 +0000
1965@@ -13,6 +13,7 @@
1966
1967 HEADERS += \
1968 $$PWD/plugin.h \
1969+ $$PWD/tarpan.h \
1970 $$PWD/smilodon.h \
1971 $$PWD/pangaea.h \
1972 $$PWD/rune.h \
1973@@ -21,6 +22,7 @@
1974
1975 SOURCES += \
1976 $$PWD/plugin.cpp \
1977+ $$PWD/tarpan.cpp \
1978 $$PWD/smilodon.cpp \
1979 $$PWD/pangaea.cpp \
1980 $$PWD/rune.cpp \
1981
1982=== added file 'tests/api/Extinct/Animals/plugin/tarpan.cpp'
1983--- tests/api/Extinct/Animals/plugin/tarpan.cpp 1970-01-01 00:00:00 +0000
1984+++ tests/api/Extinct/Animals/plugin/tarpan.cpp 2016-01-07 17:36:33 +0000
1985@@ -0,0 +1,59 @@
1986+/*
1987+ * Copyright 2015 Canonical Ltd.
1988+ *
1989+ * This program is free software; you can redistribute it and/or modify
1990+ * it under the terms of the GNU Lesser General Public License as published by
1991+ * the Free Software Foundation; version 3.
1992+ *
1993+ * This program is distributed in the hope that it will be useful,
1994+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1995+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1996+ * GNU Lesser General Public License for more details.
1997+ *
1998+ * You should have received a copy of the GNU Lesser General Public License
1999+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2000+ *
2001+ * Author: Christian Dywan <christian.dywan@canonical.com>
2002+ */
2003+
2004+#include "tarpan.h"
2005+
2006+/*!
2007+ * \qmltype EATarpan
2008+ * \instantiates EATarpan
2009+ * \inqmlmodule Extinct.Animals 1.0
2010+ * \ingroup ubuntu-commandline
2011+ * \brief The Tarpan class specifies the behavior of a Eurasian wild horse.
2012+ */
2013+
2014+EATarpan::EATarpan(QObject *parent) :
2015+ QObject(parent)
2016+{
2017+}
2018+
2019+/*!
2020+ * \qmlproperty string EATarpan::name
2021+ *
2022+ * Name identifying the wild horse.
2023+ *
2024+ */
2025+QString EATarpan::name() const
2026+{
2027+ return m_name;
2028+}
2029+
2030+void EATarpan::setName(const QString &name)
2031+{
2032+ m_name = name;
2033+ Q_EMIT(nameChanged());
2034+}
2035+
2036+/*!
2037+ * \qmlmethod string EATarpan::kick()
2038+ *
2039+ * A generous kick, commonly towards someone's groin area.
2040+ *
2041+ */
2042+void EATarpan::kick() const
2043+{
2044+}
2045
2046=== added file 'tests/api/Extinct/Animals/plugin/tarpan.h'
2047--- tests/api/Extinct/Animals/plugin/tarpan.h 1970-01-01 00:00:00 +0000
2048+++ tests/api/Extinct/Animals/plugin/tarpan.h 2016-01-07 17:36:33 +0000
2049@@ -0,0 +1,46 @@
2050+/*
2051+ * Copyright 2015 Canonical Ltd.
2052+ *
2053+ * This program is free software; you can redistribute it and/or modify
2054+ * it under the terms of the GNU Lesser General Public License as published by
2055+ * the Free Software Foundation; version 3.
2056+ *
2057+ * This program is distributed in the hope that it will be useful,
2058+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2059+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2060+ * GNU Lesser General Public License for more details.
2061+ *
2062+ * You should have received a copy of the GNU Lesser General Public License
2063+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2064+ *
2065+ * Author: Christian Dywan <christian.dywan@canonical.com>
2066+ */
2067+
2068+#ifndef UCTARPAN_H
2069+#define UCTARPAN_H
2070+
2071+#include <QtCore/QObject>
2072+#include <QtCore/QString>
2073+
2074+class EATarpan : public QObject
2075+{
2076+ Q_OBJECT
2077+
2078+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
2079+
2080+public:
2081+ explicit EATarpan(QObject *parent = 0);
2082+
2083+ QString name() const;
2084+ void setName(const QString &name);
2085+
2086+ Q_INVOKABLE void kick() const;
2087+
2088+Q_SIGNALS:
2089+ void nameChanged();
2090+
2091+private:
2092+ QString m_name;
2093+};
2094+
2095+#endif // UCTARPAN_H
2096
2097=== modified file 'tests/api/Extinct/Animals/qmldir'
2098--- tests/api/Extinct/Animals/qmldir 2015-12-02 09:22:28 +0000
2099+++ tests/api/Extinct/Animals/qmldir 2016-01-07 17:36:33 +0000
2100@@ -1,7 +1,7 @@
2101 module Extinct.Animals
2102 plugin ExtinctAnimals
2103 Titanoboa 4.2 test.qml
2104-Gigantophis 4.3 gigantophis.qml
2105+Gigantophis 4.3 Gigantophis.qml
2106 internal WoollyMammoth mammoth.qml
2107 MonsterSnake 3.1 test.qml
2108 Excavator 1.0 digger.js
2109
2110=== modified file 'tests/api/components.api'
2111--- tests/api/components.api 2015-12-11 10:38:46 +0000
2112+++ tests/api/components.api 2016-01-07 17:36:33 +0000
2113@@ -1,9 +1,12 @@
2114-Extinct.Animals.Andrewsarchus 2.0: Item
2115- property double saggitalCrestSize
2116- property double skullSize
2117-Extinct.Animals.AndrewsarchusMongoliensis 2.5: Item
2118- property double saggitalCrestSize
2119- property double skullSize
2120+Extinct.Animals.Andrewsarchus 2.0 Paratriisodon: Item
2121+ property double saggitalCrestSize
2122+ property double skullSize
2123+Extinct.Animals.AndrewsarchusMongoliensis 2.5 Paratriisodon: Item
2124+ property double saggitalCrestSize
2125+ property double skullSize
2126+EATarpan: QtObject
2127+ function kick()
2128+ property string name
2129 Extinct.Animals.Europe 4.1: QtObject
2130 Extinct.Animals.Europe 4.2: Europe
2131 readonly property ushort era 4.2
2132@@ -23,10 +26,10 @@
2133 Extinct.Animals.Pangaea.ModernContinent: Enum
2134 America
2135 Europe
2136-Extinct.Animals.Smilodon 1.0 ScimitarCat 0.1: QtObject
2137+Extinct.Animals.Smilodon 1.0 ScimitarCat 0.1 EASmilodon: QtObject
2138 function string paw(int i)
2139 property string name
2140-Extinct.Animals.Titanoboa 4.2 MonsterSnake 3.1: Item
2141+Extinct.Animals.Titanoboa 4.2 MonsterSnake 3.1 test: Item
2142 property string bar
2143 property var basket
2144 property url bazz
2145
2146=== modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py'
2147--- tests/autopilot/ubuntuuitoolkit/__init__.py 2015-05-28 15:23:13 +0000
2148+++ tests/autopilot/ubuntuuitoolkit/__init__.py 2016-01-07 17:36:33 +0000
2149@@ -48,6 +48,7 @@
2150 'ToolkitException',
2151 'ubuntu_scenarios',
2152 'UbuntuListView11',
2153+ 'UbuntuListView',
2154 'UbuntuUIToolkitCustomProxyObjectBase',
2155 ]
2156
2157@@ -86,4 +87,5 @@
2158 ToolkitException,
2159 UbuntuUIToolkitCustomProxyObjectBase,
2160 UbuntuListView11,
2161+ UbuntuListView,
2162 )
2163
2164=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py'
2165--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py 2015-09-30 14:46:48 +0000
2166+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py 2016-01-07 17:36:33 +0000
2167@@ -44,6 +44,7 @@
2168 'Toolbar',
2169 'ToolkitException',
2170 'UbuntuListView11',
2171+ 'UbuntuListView',
2172 'UbuntuUIToolkitCustomProxyObjectBase',
2173 ]
2174
2175@@ -90,5 +91,6 @@
2176 from ubuntuuitoolkit._custom_proxy_objects._textfield import TextField
2177 from ubuntuuitoolkit._custom_proxy_objects._toolbar import Toolbar
2178 from ubuntuuitoolkit._custom_proxy_objects._ubuntulistview import (
2179- UbuntuListView11
2180+ UbuntuListView11,
2181+ UbuntuListView,
2182 )
2183
2184=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py'
2185--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py 2015-09-22 15:56:35 +0000
2186+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py 2016-01-07 17:36:33 +0000
2187@@ -45,3 +45,7 @@
2188 refresh.wait_for_refresh()
2189 return True
2190 return False
2191+
2192+
2193+class UbuntuListView(UbuntuListView11):
2194+ """Autopilot helper for the UbuntuListView 1.3."""
2195
2196=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py'
2197--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2015-12-09 14:34:55 +0000
2198+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2016-01-07 17:36:33 +0000
2199@@ -34,7 +34,7 @@
2200 text="Call")),
2201 ('button with color', dict(
2202 button_name="button_color", is_enabled=True,
2203- color=[0, 161, 50, 255], icon=None, text="Call Ctrl+C")),
2204+ color=[0, 161, 50, 255], icon=None, text="C&all Ctrl+L")),
2205 ('button with icon', dict(
2206 button_name="button_iconsource", is_enabled=True, color=None,
2207 icon="call.png", text=None)),
2208
2209=== modified file 'tests/uitk_test_plan.sh'
2210--- tests/uitk_test_plan.sh 2015-12-16 09:50:40 +0000
2211+++ tests/uitk_test_plan.sh 2016-01-07 17:36:33 +0000
2212@@ -552,3 +552,5 @@
2213 echo "Comparing results with the archive tests" > $MAINFILE
2214 compare_results
2215 fi
2216+
2217+
2218
2219=== modified file 'tests/unit/plugin_dependency.pri'
2220--- tests/unit/plugin_dependency.pri 2015-12-16 12:57:21 +0000
2221+++ tests/unit/plugin_dependency.pri 2016-01-07 17:36:33 +0000
2222@@ -8,7 +8,7 @@
2223 PRE_TARGETDEPS += $$PLUGIN_BLD/Test/libUbuntuTest.so
2224 LIBS += -L$$PLUGIN_BLD/Components -lUbuntuComponents
2225 LIBS += -L$$PLUGIN_BLD/Test -lUbuntuTest
2226-LIBS += -L$$PWD/../../lib -lUbuntuGestures
2227+LIBS += -L$${ROOT_BUILD_DIR}/lib -lUbuntuGestures
2228 DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\"
2229 QMAKE_CXXFLAGS += -Werror
2230
2231
2232=== modified file 'tests/unit/runtest.sh'
2233--- tests/unit/runtest.sh 2015-12-16 09:52:31 +0000
2234+++ tests/unit/runtest.sh 2016-01-07 17:36:33 +0000
2235@@ -70,7 +70,7 @@
2236 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'
2237 if [ "x$UITK_TEST_KEEP_RUNNING" != "x1" ]; then
2238 ${BUILD_DIR}/tests/checkresults.sh $_XML
2239- RESULT=$*
2240+ RESULT=$?
2241 fi
2242 else
2243 echo "Skipped because no DISPLAY available"
2244
2245=== modified file 'tests/unit/tst_components/tst_fontutils.qml'
2246--- tests/unit/tst_components/tst_fontutils.qml 2015-03-03 13:20:06 +0000
2247+++ tests/unit/tst_components/tst_fontutils.qml 2016-01-07 17:36:33 +0000
2248@@ -1,5 +1,5 @@
2249 /*
2250- * Copyright 2012 Canonical Ltd.
2251+ * Copyright 2012-2015 Canonical Ltd.
2252 *
2253 * This program is free software; you can redistribute it and/or modify
2254 * it under the terms of the GNU Lesser General Public License as published by
2255@@ -22,12 +22,12 @@
2256 name: "FontUtilsAPI"
2257
2258 function test_modularScale() {
2259- compare(FontUtils.modularScale("xx-small"), 0.677, "xx-small scale");
2260- compare(FontUtils.modularScale("x-small"), 0.804, "x-small scale");
2261- compare(FontUtils.modularScale("small"), 0.931, "small scale");
2262- compare(FontUtils.modularScale("medium"), 1.079, "medium scale");
2263- compare(FontUtils.modularScale("large"), 1.291, "large scale");
2264- compare(FontUtils.modularScale("x-large"), 1.714, "x-large scale");
2265+ compare(FontUtils.modularScale("xx-small"), 0.606, "xx-small scale");
2266+ compare(FontUtils.modularScale("x-small"), 0.707, "x-small scale");
2267+ compare(FontUtils.modularScale("small"), 0.857, "small scale");
2268+ compare(FontUtils.modularScale("medium"), 1.0, "medium scale");
2269+ compare(FontUtils.modularScale("large"), 1.414, "large scale");
2270+ compare(FontUtils.modularScale("x-large"), 1.905, "x-large scale");
2271 }
2272
2273 function test_modularScale_failures() {
2274@@ -36,17 +36,16 @@
2275 }
2276
2277 function test_sizeToPixels() {
2278- compare(FontUtils.sizeToPixels("xx-small"), 0.677 * units.dp(14), "xx-small scale");
2279- compare(FontUtils.sizeToPixels("x-small"), 0.804 * units.dp(14), "x-small scale");
2280- compare(FontUtils.sizeToPixels("small"), 0.931 * units.dp(14), "small scale");
2281- compare(FontUtils.sizeToPixels("medium"), 1.079 * units.dp(14), "medium scale");
2282- compare(FontUtils.sizeToPixels("large"), 1.291 * units.dp(14), "large scale");
2283- compare(FontUtils.sizeToPixels("x-large"), 1.714 * units.dp(14), "x-large scale");
2284+ compare(FontUtils.sizeToPixels("xx-small"), 0.606 * units.dp(14), "xx-small scale");
2285+ compare(FontUtils.sizeToPixels("x-small"), 0.707 * units.dp(14), "x-small scale");
2286+ compare(FontUtils.sizeToPixels("small"), 0.857 * units.dp(14), "small scale");
2287+ compare(FontUtils.sizeToPixels("medium"), 1.0 * units.dp(14), "medium scale");
2288+ compare(FontUtils.sizeToPixels("large"), 1.414 * units.dp(14), "large scale");
2289+ compare(FontUtils.sizeToPixels("x-large"), 1.905 * units.dp(14), "x-large scale");
2290 }
2291
2292 function test_sizeToPixels_failures() {
2293 compare(FontUtils.sizeToPixels("xxsmall"), 0.0, "xxsmall not defined");
2294 compare(FontUtils.sizeToPixels("undefined"), 0.0, "undefined scale");
2295 }
2296-
2297 }
2298
2299=== modified file 'tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp'
2300--- tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2015-12-12 08:25:22 +0000
2301+++ tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2016-01-07 17:36:33 +0000
2302@@ -20,7 +20,7 @@
2303 #include "ucbottomedgeregion.h"
2304 #include "ucbottomedge_p.h"
2305 #include "ucbottomedgehint.h"
2306-#include "gestures/ucswipearea.h"
2307+#include "private/ucswipearea_p.h"
2308 #include "ucunits.h"
2309 #include "ucheader.h"
2310 #include "ucaction.h"
2311
2312=== modified file 'tests/unit_x11/tst_bottomedge/tst_bottomedge.pro'
2313--- tests/unit_x11/tst_bottomedge/tst_bottomedge.pro 2015-12-12 08:25:22 +0000
2314+++ tests/unit_x11/tst_bottomedge/tst_bottomedge.pro 2016-01-07 17:36:33 +0000
2315@@ -1,5 +1,5 @@
2316 include(../test-include.pri)
2317-QT += core-private qml-private quick-private gui-private UbuntuGestures
2318+QT += core-private qml-private quick-private gui-private UbuntuGestures UbuntuGestures_private
2319
2320 SOURCES += \
2321 tst_bottomedge.cpp
2322
2323=== added file 'tests/unit_x11/tst_components/PageHeaderBaseDividerBottom@18.png'
2324Binary files tests/unit_x11/tst_components/PageHeaderBaseDividerBottom@18.png 1970-01-01 00:00:00 +0000 and tests/unit_x11/tst_components/PageHeaderBaseDividerBottom@18.png 2016-01-07 17:36:33 +0000 differ
2325=== added file 'tests/unit_x11/tst_components/battery-100-charging.svg'
2326--- tests/unit_x11/tst_components/battery-100-charging.svg 1970-01-01 00:00:00 +0000
2327+++ tests/unit_x11/tst_components/battery-100-charging.svg 2016-01-07 17:36:33 +0000
2328@@ -0,0 +1,25 @@
2329+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2330+<!-- Created with Inkscape (http://www.inkscape.org/) -->
2331+<svg id="svg4966" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="90" viewBox="0 0 139.00489 90.000001" width="139" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
2332+ <metadata id="metadata4971">
2333+ <rdf:RDF>
2334+ <cc:Work rdf:about="">
2335+ <dc:format>image/svg+xml</dc:format>
2336+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
2337+ <dc:title/>
2338+ </cc:Work>
2339+ </rdf:RDF>
2340+ </metadata>
2341+ <g id="layer1" transform="translate(-149.78 -484.51)">
2342+ <g id="g5120" transform="translate(-433.79 125.71)">
2343+ <g id="g5124" transform="translate(409.57 223.43)">
2344+ <g id="g5126" style="fill:none" transform="matrix(2.1875 0 0 1.875 -456 -1657.8)">
2345+ <rect id="rect5128" style="opacity:.21171;fill:none" transform="translate(0 804.36)" height="48" width="48" y="152" x="288"/>
2346+ </g>
2347+ <path id="path5130" style="fill:#808080" transform="translate(174 135.36)" d="m86 15-75.156 0.012c-7.844-0.012-10.844 1.988-10.844 11.988v18 18c0 10 3 12 10.844 11.988l75.156 0.012c7.8438 0.01172 11-2.3633 11-12v-4.0117h8v-13.988-13.988h-8v-4.012c0-9.637-3.156-12.012-11-12zm-75 6c21.619 0.0096 48.956 0.0081 75 0 4 0 5 1 5 6v18 18c0 5-1 6-5 6-26.044-0.008-53.381-0.01-75 0-4 0-5-1-5-6v-18-18c0-5 1-6 5-6z"/>
2348+ <path id="path5132" style="fill:#38b44a" d="m1051 697c-3 0-4 0-4 5v26c0 5 1 5 4 5h65c3 0 4 0 4-5v-26c0-5-1-5-4-5z" transform="translate(-861 -534.64)"/>
2349+ <path id="path3847-0" style="fill:#808080" d="m299 150.36-13.996 35h14v25l14.005-35h-14z"/>
2350+ </g>
2351+ </g>
2352+ </g>
2353+</svg>
2354
2355=== added file 'tests/unit_x11/tst_components/shape.svg'
2356--- tests/unit_x11/tst_components/shape.svg 1970-01-01 00:00:00 +0000
2357+++ tests/unit_x11/tst_components/shape.svg 2016-01-07 17:36:33 +0000
2358@@ -0,0 +1,77 @@
2359+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2360+<!-- Created with Inkscape (http://www.inkscape.org/) -->
2361+
2362+<svg
2363+ xmlns:dc="http://purl.org/dc/elements/1.1/"
2364+ xmlns:cc="http://creativecommons.org/ns#"
2365+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2366+ xmlns:svg="http://www.w3.org/2000/svg"
2367+ xmlns="http://www.w3.org/2000/svg"
2368+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
2369+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
2370+ width="64"
2371+ height="64"
2372+ id="svg3336"
2373+ version="1.1"
2374+ inkscape:version="0.48.5 r10040"
2375+ sodipodi:docname="ushape.svg">
2376+ <defs
2377+ id="defs3338" />
2378+ <sodipodi:namedview
2379+ id="base"
2380+ pagecolor="#ffffff"
2381+ bordercolor="#666666"
2382+ borderopacity="1.0"
2383+ inkscape:pageopacity="0.0"
2384+ inkscape:pageshadow="2"
2385+ inkscape:zoom="4"
2386+ inkscape:cx="113.3337"
2387+ inkscape:cy="-31.239507"
2388+ inkscape:document-units="px"
2389+ inkscape:current-layer="layer1"
2390+ showgrid="false"
2391+ inkscape:window-width="1871"
2392+ inkscape:window-height="1056"
2393+ inkscape:window-x="49"
2394+ inkscape:window-y="24"
2395+ inkscape:window-maximized="1"
2396+ inkscape:showpageshadow="false"
2397+ borderlayer="false"
2398+ showborder="true" />
2399+ <metadata
2400+ id="metadata3341">
2401+ <rdf:RDF>
2402+ <cc:Work
2403+ rdf:about="">
2404+ <dc:format>image/svg+xml</dc:format>
2405+ <dc:type
2406+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
2407+ <dc:title />
2408+ </cc:Work>
2409+ </rdf:RDF>
2410+ </metadata>
2411+ <g
2412+ inkscape:label="Layer 1"
2413+ inkscape:groupmode="layer"
2414+ id="layer1"
2415+ transform="translate(0,-988.36218)">
2416+ <g
2417+ transform="matrix(0.92774742,0,0,0.92677598,0,190.60819)"
2418+ id="layer1-3"
2419+ inkscape:label="Layer 1"
2420+ style="fill:#000000;display:inline">
2421+ <g
2422+ style="fill:#000000"
2423+ inkscape:label="Layer 1"
2424+ id="layer1-2"
2425+ transform="translate(0,9.99998)">
2426+ <path
2427+ sodipodi:nodetypes="sssssssss"
2428+ inkscape:connector-curvature="0"
2429+ id="path3774"
2430+ d="m 66.770269,850.78408 72.334451,0 c 58.42399,0 66.77028,8.34623 66.77028,66.77022 l 0,58.03793 c 0,58.42377 -8.34629,66.76997 -66.77028,66.76997 l -72.334451,0 C 8.3462835,1042.3622 0,1034.016 0,975.59223 L 0,917.5543 c 0,-58.42399 8.3462835,-66.77022 66.770269,-66.77022 z"
2431+ style="fill:#000000;fill-opacity:1;stroke:none;display:inline" />
2432+ </g>
2433+ </g>
2434+ </g>
2435+</svg>
2436
2437=== modified file 'tests/unit_x11/tst_components/tst_imageprovider.qml'
2438--- tests/unit_x11/tst_components/tst_imageprovider.qml 2015-03-03 13:20:06 +0000
2439+++ tests/unit_x11/tst_components/tst_imageprovider.qml 2016-01-07 17:36:33 +0000
2440@@ -53,16 +53,41 @@
2441 signalName: "visibleChanged"
2442 }
2443
2444- function test_sourceChanged() {
2445+ function cleanup() {
2446+ sourceChangeSpy.clear();
2447+ visibleChangedSpy.clear();
2448+ }
2449+
2450+ // tests adjusted to reproduce bug #1401920
2451+ function test_sourceChanged_bug1401920_data() {
2452+ return [
2453+ {tag: "Bitmap file", file: 'tst_icon-select.png'},
2454+ {tag: "Bitmap file(18gu)", gu: 18, file: 'tst_icon-select.png'},
2455+ {tag: "Bitmap with fragment", file: 'tst_icon-select.png#' + Date.now()},
2456+ {tag: "Bitmap with fragment(18gu)", gu: 18, file: 'PageHeaderBaseDividerBottom@18.png#' + Date.now()},
2457+ {tag: "Bitmap file with gu", file: 'tst_icon-select@18.png'},
2458+ {tag: "Bitmap file with gu(18gu)", gu: 18, file: 'PageHeaderBaseDividerBottom@18.png'},
2459+ {tag: "Bitmap with gu/ fragment", file: 'tst_icon-select@18.png#' + Date.now()},
2460+ {tag: "Bitmap with gu/ fragment(18gu)", gu: 18, file: 'PageHeaderBaseDividerBottom@18.png#' + Date.now()},
2461+ {tag: "Scalable file", file: 'battery-100-charging.svg'},
2462+ {tag: "Scalable file(18gu)", gu: 18, file: 'shape.svg'},
2463+ {tag: "Scalable with fragment", file: 'shape.svg#' + Date.now()},
2464+ {tag: "Scalable with fragment(18gu)", gu: 18, file: 'battery-100-charging.svg#' + Date.now()},
2465+ ];
2466+ }
2467+
2468+ function test_sourceChanged_bug1401920(data) {
2469+ units.gridUnit = data.gu ? data.gu : 8;
2470 sourceChangeSpy.target = test;
2471- test.source = "/usr/share/icons/ubuntu-mobile/actions/scalable/delete.svg";
2472- sourceChangeSpy.wait();
2473+ test.source = Qt.resolvedUrl(data.file);
2474+ sourceChangeSpy.wait(400);
2475+ compare(test.source, Qt.resolvedUrl(data.file));
2476 }
2477
2478 function test_sourceNOTIFYable() {
2479 /* Test source through visible to cover NOTIFYable errors */
2480 visibleChangedSpy.target = bindingTest;
2481- bindingTest.source = "/usr/share/icons/ubuntu-mobile/actions/scalable/help.svg";
2482+ bindingTest.source = Qt.resolvedUrl('battery-100-charging.svg');
2483 visibleChangedSpy.wait();
2484 }
2485 }
2486
2487=== modified file 'tests/unit_x11/tst_components/tst_scrollbar.qml'
2488--- tests/unit_x11/tst_components/tst_scrollbar.qml 2015-12-16 16:33:22 +0000
2489+++ tests/unit_x11/tst_components/tst_scrollbar.qml 2016-01-07 17:36:33 +0000
2490@@ -46,7 +46,9 @@
2491 Rectangle {
2492 id: content
2493 width: units.gu(40)
2494- height: units.gu(50)
2495+ //make this much taller than the flickable to avoid timing issues when
2496+ //detecting if the flickable is flicking in the tests
2497+ height: units.gu(200)
2498 color: "blue"
2499 }
2500 }
2501@@ -60,6 +62,9 @@
2502 SignalSpy {
2503 id: signalSpy
2504 }
2505+ SignalSpy {
2506+ id: anotherSignalSpy
2507+ }
2508
2509 Flickable {
2510 anchors.fill: parent
2511@@ -126,6 +131,8 @@
2512 }
2513 function setupSignalSpy(spy, target, signalName) {
2514 spy.clear()
2515+ //reset signalName otherwise it will look for the old signalName in the new target
2516+ spy.signalName = ""
2517 spy.target = target
2518 spy.signalName = signalName
2519 }
2520@@ -176,46 +183,81 @@
2521 scrollbar_trailingAlign_anchors.flickableItem.top, "top anchor")
2522 }
2523
2524- function test_indicatorWhileFlicking() {
2525+ function test_indicatorStyleWhileFlicking_shortContent() {
2526 var freshTestItem = getFreshFlickable()
2527 if (!freshTestItem) return
2528
2529 var flickable = freshTestItem.flickable
2530 var scrollbar = freshTestItem.scrollbar
2531
2532- setupSignalSpy(signalSpy, flickable, "movementEnded")
2533-
2534- flick(flickable, 1, 2, units.gu(2), units.gu(3))
2535- compare(flickable.moving, true, "not moving")
2536- compare(scrollbar.__styleInstance.state, "indicator", "wrong style while flicking")
2537-
2538- signalSpy.wait()
2539- compare(signalSpy.count, 1, "flick not completed")
2540-
2541- compare(scrollbar.__styleInstance.state, "hidden", "wrong style while flicking short item")
2542+ compare(scrollbar.__styleInstance.veryLongContentItem, false, "Scrollable item should be short.")
2543+
2544+ setupSignalSpy(signalSpy, flickable, "movingChanged")
2545+
2546+ flick(flickable, 1, 2, units.gu(2), -units.gu(10))
2547+
2548+ signalSpy.wait()
2549+ compare(signalSpy.count, 1, "No movingChanged signal after simulating a flick.")
2550+ compare(flickable.moving, true, "Flickable not moving after simulating a flick.")
2551+ compare(scrollbar.__styleInstance.state, "indicator", "Wrong style while flicking.")
2552+
2553+ //we don't set it up before because the hinting feature already changes the style to thumb
2554+ //at the beginning
2555+ setupSignalSpy(anotherSignalSpy, scrollbar.__styleInstance, "stateChanged")
2556+
2557+ //make sure the flickable stops
2558+ mousePress(flickable, 0, 0)
2559+ mouseMove(flickable, 0, 0)
2560+ mouseRelease(flickable, 0, 0)
2561+
2562+ signalSpy.wait()
2563+ compare(flickable.moving, false, "Flickable still moving after simulating mouse click.")
2564+ compare(signalSpy.count, 2, "No movingChanged signal after Flickable stopped moving.")
2565+
2566+ anotherSignalSpy.wait()
2567+ compare(anotherSignalSpy.count, 1, "State unchanged after Flickable stopped moving.")
2568+ compare(scrollbar.__styleInstance.state, "hidden", "Wrong style after the item stopped moving.")
2569+
2570 freshTestItem.destroy()
2571 }
2572
2573- function test_thumbStyleVeryLongContent() {
2574+ function test_thumbStyleWhileFlicking_veryLongContent() {
2575 var freshTestItem = getFreshFlickable()
2576 if (!freshTestItem) return
2577
2578 var flickable = freshTestItem.flickable
2579 var scrollbar = freshTestItem.scrollbar
2580
2581+ setupSignalSpy(signalSpy, scrollbar.__styleInstance, "veryLongContentItemChanged")
2582 setVeryLongContentItem(flickable)
2583- compare(scrollbar.__styleInstance.veryLongContentItem, true, "very long content item not detected")
2584-
2585- setupSignalSpy(signalSpy, flickable, "movementEnded")
2586-
2587- flick(flickable, 1, 2, units.gu(2), units.gu(3))
2588- compare(flickable.moving, true, "not moving")
2589- compare(scrollbar.__styleInstance.state, "thumb", "wrong style while flicking a very long item")
2590-
2591- signalSpy.wait()
2592- compare(signalSpy.count, 1, "flick not completed")
2593-
2594- compare(scrollbar.__styleInstance.state, "hidden", "wrong style while flicking a very long item")
2595+ signalSpy.wait()
2596+
2597+ compare(scrollbar.__styleInstance.veryLongContentItem, true, "Very long content item not detected")
2598+
2599+ setupSignalSpy(signalSpy, flickable, "movingChanged")
2600+ flick(flickable, 1, 2, units.gu(2), -units.gu(10))
2601+
2602+ signalSpy.wait()
2603+ compare(signalSpy.count, 1, "No movingChanged signal after simulating a flick.")
2604+ compare(flickable.moving, true, "Flickable not moving after simulating a flick.")
2605+ compare(scrollbar.__styleInstance.state, "thumb", "Wrong style while flicking a very long item")
2606+
2607+ //we don't set it up before because the hinting feature already changes the style to thumb
2608+ //at the beginning
2609+ setupSignalSpy(anotherSignalSpy, scrollbar.__styleInstance, "stateChanged")
2610+
2611+ //make sure the flickable stops
2612+ mousePress(flickable, 0, 0)
2613+ mouseMove(flickable, 0, 0)
2614+ mouseRelease(flickable, 0, 0)
2615+
2616+ signalSpy.wait()
2617+ compare(flickable.moving, false, "Flickable still moving after simulating mouse click.")
2618+ compare(signalSpy.count, 2, "No movingChanged signal after Flickable stopped moving.")
2619+
2620+ anotherSignalSpy.wait()
2621+ compare(anotherSignalSpy.count, 1, "State unchanged after Flickable stopped moving.")
2622+ compare(scrollbar.__styleInstance.state, "hidden", "Wrong style after a the item stopped moving.")
2623 freshTestItem.destroy()
2624 }
2625 }
2626
2627=== modified file 'tests/unit_x11/tst_components/tst_shortcuts.qml'
2628--- tests/unit_x11/tst_components/tst_shortcuts.qml 2015-12-06 11:48:53 +0000
2629+++ tests/unit_x11/tst_components/tst_shortcuts.qml 2016-01-07 17:36:33 +0000
2630@@ -46,6 +46,10 @@
2631
2632 function init() {
2633 }
2634+ function cleanup() {
2635+ spy.clear();
2636+ shortcutSpy.clear();
2637+ }
2638
2639 SignalSpy {
2640 id: spy
2641@@ -102,6 +106,60 @@
2642 shortcutSpy.clear();
2643 action.shortcut = undefined;
2644 shortcutSpy.wait(200);
2645+ shortcutSpy.target = null;
2646+ }
2647+
2648+ function test_mnemonic_data() {
2649+ return [
2650+ {tag: "HW keyboard, valid 'C&all'", kbd: true, text: "C&all", displayText: "C<u>a</u>ll", key: Qt.Key_A, xfail: false},
2651+ {tag: "HW keyboard, valid '&Save & Exit", kbd: true, text: "&Save & Exit", displayText: "<u>S</u>ave & Exit", key: Qt.Key_S, xfail: false},
2652+ {tag: "HW keyboard, valid 'Hide &Seek'", kbd: true, text: "Hide&Seek", displayText: "Hide<u>S</u>eek", key: Qt.Key_S, xfail: false},
2653+ {tag: "HW keyboard, valid 'Save & Exit'", kbd: true, text: "Save & Exit", displayText: "Save <u> </u>Exit", key: Qt.Key_Space, xfail: false},
2654+ {tag: "HW keyboard, valid 'Paste &&&Proceed'", kbd: true, text: "Paste &&&Proceed", displayText: "Paste &&<u>P</u>roceed", key: Qt.Key_P, xfail: false},
2655+ {tag: "HW keyboard, valid 'Cut &$'", kbd: true, text: "Cut &$", displayText: "Cut <u>$</u>", key: Qt.Key_Dollar, xfail: false},
2656+ {tag: "HW keyboard, valid 'At &@'", kbd: true, text: "At &@", displayText: "At <u>@</u>", key: Qt.Key_At, xfail: false},
2657+ {tag: "HW keyboard, valid '&_'", kbd: true, text: "&_", displayText: "<u>_</u>", key: Qt.Key_Underscore, xfail: false},
2658+
2659+ {tag: "HW keyboard, invalid '&&Call'", kbd: true, text: "&&Call", displayText: "&&Call", key: Qt.Key_Asterisk, xfail: true},
2660+ {tag: "HW keyboard, invalid 'Jump &'", kbd: true, text: "Jump &", displayText: "Jump &", key: Qt.Key_Asterisk, xfail: true},
2661+ {tag: "HW keyboard, invalid '&&'", kbd: true, text: "&&", displayText: "&&", key: Qt.Key_Asterisk, xfail: true},
2662+
2663+ {tag: "no HW keyboard", kbd: false, text: "&Call", displayText: "Call", key: Qt.Key_C, xfail: false},
2664+ ];
2665+ }
2666+ function test_mnemonic(data) {
2667+ QuickUtils.keyboardAttached = data.kbd;
2668+ action.text = data.text;
2669+ if (!data.kbd && QuickUtils.keyboardAttached) {
2670+ skip("Cannot test this case: " + data.tag);
2671+ }
2672+ compare(action.text, data.displayText);
2673+ // shortcut
2674+ keyClick(data.key, Qt.AltModifier);
2675+ if (data.xfail) {
2676+ expectFail(data.tag, "invalid mnemonic");
2677+ }
2678+ spy.wait(200);
2679+ }
2680+
2681+ SignalSpy {
2682+ id: textSpy
2683+ target: action
2684+ signalName: "textChanged"
2685+ }
2686+
2687+ function test_mnemonic_displaytext() {
2688+ QuickUtils.keyboardAttached = false;
2689+ if (QuickUtils.keyboardAttached) {
2690+ skip("the test needs to be able to detach the keyboard");
2691+ }
2692+ action.text = "&Call";
2693+ textSpy.clear();
2694+ QuickUtils.keyboardAttached = true;
2695+ if (!QuickUtils.keyboardAttached) {
2696+ skip("the test needs to be able to attach the keyboard");
2697+ }
2698+ textSpy.wait(200);
2699 }
2700 }
2701 }
2702
2703=== added file 'tests/unit_x11/tst_components/tst_ubuntulistview13.qml'
2704--- tests/unit_x11/tst_components/tst_ubuntulistview13.qml 1970-01-01 00:00:00 +0000
2705+++ tests/unit_x11/tst_components/tst_ubuntulistview13.qml 2016-01-07 17:36:33 +0000
2706@@ -0,0 +1,105 @@
2707+/*
2708+ * Copyright 2014 Canonical Ltd.
2709+ *
2710+ * This program is free software; you can redistribute it and/or modify
2711+ * it under the terms of the GNU Lesser General Public License as published by
2712+ * the Free Software Foundation; version 3.
2713+ *
2714+ * This program is distributed in the hope that it will be useful,
2715+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2716+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2717+ * GNU Lesser General Public License for more details.
2718+ *
2719+ * You should have received a copy of the GNU Lesser General Public License
2720+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2721+ */
2722+
2723+import QtQuick 2.4
2724+import QtTest 1.0
2725+import Ubuntu.Test 1.0
2726+import Ubuntu.Components 1.3
2727+
2728+Item {
2729+ width: units.gu(40)
2730+ height: units.gu(60)
2731+
2732+ ListModel {
2733+ id: dummyModel
2734+ Component.onCompleted: {
2735+ reload();
2736+ }
2737+ function reload() {
2738+ clear();
2739+ for (var i = 0; i < 20; ++i) {
2740+ dummyModel.append({idx: i});
2741+ }
2742+ }
2743+ }
2744+
2745+ // timer used to simulate the model refresh
2746+ Timer {
2747+ id: refreshTimer
2748+ interval: 500
2749+ onTriggered: {
2750+ dummyModel.reload();
2751+ }
2752+ }
2753+
2754+ UbuntuListView {
2755+ id: ubuntuListView
2756+ anchors.fill: parent
2757+ clip: true
2758+ model: dummyModel
2759+
2760+ pullToRefresh {
2761+ refreshing: refreshTimer.running
2762+ onRefresh: refreshTimer.restart()
2763+ }
2764+
2765+ delegate: ListItem {
2766+ id: expandable
2767+ Label { text: "item " + index }
2768+ }
2769+ }
2770+
2771+ UbuntuTestCase {
2772+ name: "UbuntuListView"
2773+ when: windowShown
2774+
2775+ SignalSpy {
2776+ id: refreshSpy
2777+ signalName: "onRefresh"
2778+ }
2779+
2780+ function initTestCase() {
2781+ tryCompare(dummyModel, "count", 20);
2782+ }
2783+
2784+ function init() {
2785+ waitForRendering(ubuntuListView, 1000);
2786+ }
2787+
2788+ function cleanup() {
2789+ // scroll the ListView back to top
2790+ ubuntuListView.positionViewAtIndex(0, ListView.Beginning);
2791+ refreshSpy.clear();
2792+ refreshSpy.target = null;
2793+ ubuntuListView.pullToRefresh.enabled = false;
2794+ }
2795+
2796+ function test_0_defaults() {
2797+ verify(ubuntuListView.hasOwnProperty("pullToRefresh"), "PullToRefresh is missing");
2798+ compare(ubuntuListView.pullToRefresh.enabled, false, "PullToRefresh functionality is disabled by default");
2799+ }
2800+
2801+ function test_pullToRefresh_manual_refresh() {
2802+ ubuntuListView.pullToRefresh.enabled = true;
2803+ refreshSpy.target = ubuntuListView.pullToRefresh
2804+ var x = ubuntuListView.width / 2;
2805+ mouseDrag(ubuntuListView, x, units.gu(1), 0, ubuntuListView.height);
2806+ refreshSpy.wait();
2807+ tryCompareFunction(function() { return ubuntuListView.pullToRefresh.refreshing; }, false, 1000);
2808+ waitForRendering(ubuntuListView, 1000);
2809+ }
2810+ }
2811+}
2812
2813=== modified file 'tests/unit_x11/tst_swipearea/tst_swipearea.cpp'
2814--- tests/unit_x11/tst_swipearea/tst_swipearea.cpp 2015-12-16 09:52:31 +0000
2815+++ tests/unit_x11/tst_swipearea/tst_swipearea.cpp 2016-01-07 17:36:33 +0000
2816@@ -23,8 +23,8 @@
2817 #include <private/qquickmousearea_p.h>
2818 #include <private/qquickwindow_p.h>
2819
2820-#include "gestures/ucswipearea.h"
2821-#include "gestures/ucswipearea_p.h"
2822+#include "private/ucswipearea_p.h"
2823+#include "private/ucswipearea_p_p.h"
2824 #define protected public
2825 #define private public
2826 #include <UbuntuGestures/TouchRegistry>
2827
2828=== modified file 'tests/unit_x11/tst_swipearea/tst_swipearea.pro'
2829--- tests/unit_x11/tst_swipearea/tst_swipearea.pro 2015-11-06 14:05:07 +0000
2830+++ tests/unit_x11/tst_swipearea/tst_swipearea.pro 2016-01-07 17:36:33 +0000
2831@@ -1,5 +1,5 @@
2832 include(../test-include.pri)
2833-QT += core-private qml-private quick-private gui-private UbuntuGestures
2834+QT += core-private qml-private quick-private gui-private UbuntuGestures UbuntuGestures_private
2835 SOURCES += \
2836 GestureTest.cpp \
2837 tst_swipearea.cpp

Subscribers

People subscribed via source and target branches

to status/vote changes: