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