Merge lp:~tpeeters/ubuntu-ui-toolkit/lessHeaderDisabling into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters on 2015-11-17
Status: Superseded
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/lessHeaderDisabling
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 7110 lines (+2844/-1259) (has conflicts)
115 files modified
components.api (+69/-78)
debian/control (+1/-0)
examples/ubuntu-ui-toolkit-gallery/About.qml (+2/-3)
examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml (+8/-8)
examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/MainPage.qml (+107/-85)
examples/ubuntu-ui-toolkit-gallery/Sections.qml (+7/-1)
examples/ubuntu-ui-toolkit-gallery/Template.qml (+16/-7)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+2/-2)
examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot (+179/-91)
po/ubuntu-ui-toolkit.pot (+182/-41)
src/Ubuntu/Components/1.2/MainViewBase.qml (+4/-4)
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+82/-6)
src/Ubuntu/Components/1.3/AnimatedItem.qml (+2/-3)
src/Ubuntu/Components/1.3/AppHeader.qml (+0/-1)
src/Ubuntu/Components/1.3/BottomEdgeHint.qml (+0/-155)
src/Ubuntu/Components/1.3/Button.qml (+0/-1)
src/Ubuntu/Components/1.3/CheckBox.qml (+0/-1)
src/Ubuntu/Components/1.3/OptionSelector.qml (+0/-1)
src/Ubuntu/Components/1.3/Page.qdoc (+0/-132)
src/Ubuntu/Components/1.3/Page.qml (+100/-5)
src/Ubuntu/Components/1.3/PageHeader.qml (+24/-5)
src/Ubuntu/Components/1.3/PageStack.qml (+18/-0)
src/Ubuntu/Components/1.3/PageTreeNode.qml (+0/-2)
src/Ubuntu/Components/1.3/PageWrapper.qml (+2/-2)
src/Ubuntu/Components/1.3/ProgressBar.qml (+0/-1)
src/Ubuntu/Components/1.3/PullToRefresh.qml (+0/-1)
src/Ubuntu/Components/1.3/Scrollbar.qml (+0/-1)
src/Ubuntu/Components/1.3/Sections.qml (+0/-1)
src/Ubuntu/Components/1.3/Slider.qml (+0/-1)
src/Ubuntu/Components/1.3/TabBar.qml (+0/-1)
src/Ubuntu/Components/1.3/TextArea.qml (+0/-1)
src/Ubuntu/Components/1.3/TextCursor.qml (+0/-1)
src/Ubuntu/Components/1.3/TextField.qml (+0/-1)
src/Ubuntu/Components/1.3/TextInputPopover.qml (+0/-1)
src/Ubuntu/Components/1.3/Toolbar.qml (+0/-1)
src/Ubuntu/Components/1.3/ToolbarButton.qml (+0/-1)
src/Ubuntu/Components/ComponentModule.pro (+0/-2)
src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml (+0/-1)
src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/DatePicker.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/Dialer.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/DialerHand.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/Picker.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/Dialog.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/Popover.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/SheetBase.qml (+0/-1)
src/Ubuntu/Components/Styles/Styles.pro (+0/-4)
src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml (+149/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro (+3/-0)
src/Ubuntu/Components/plugin/plugin.cpp (+2/-1)
src/Ubuntu/Components/plugin/plugin.pri (+8/-2)
src/Ubuntu/Components/plugin/privates/gesturedetector.cpp (+142/-0)
src/Ubuntu/Components/plugin/privates/gesturedetector.h (+75/-0)
src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp (+3/-3)
src/Ubuntu/Components/plugin/quickutils.cpp (+2/-1)
src/Ubuntu/Components/plugin/quickutils.h (+8/-0)
src/Ubuntu/Components/plugin/ucbottomedgehint.cpp (+347/-0)
src/Ubuntu/Components/plugin/ucbottomedgehint.h (+92/-0)
src/Ubuntu/Components/plugin/ucheader.cpp (+2/-0)
src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp (+58/-0)
src/Ubuntu/Components/plugin/ucimportversionchecker_p.h (+34/-0)
src/Ubuntu/Components/plugin/uclabel.cpp (+1/-8)
src/Ubuntu/Components/plugin/uclabel.h (+1/-2)
src/Ubuntu/Components/plugin/uclistitem.cpp (+64/-10)
src/Ubuntu/Components/plugin/uclistitem.h (+4/-0)
src/Ubuntu/Components/plugin/uclistitem_p.h (+1/-0)
src/Ubuntu/Components/plugin/uclistitemlayout.cpp (+20/-11)
src/Ubuntu/Components/plugin/uclistitemlayout.h (+2/-1)
src/Ubuntu/Components/plugin/ucqquickimageextension.cpp (+1/-1)
src/Ubuntu/Components/plugin/ucslotslayout.cpp (+10/-2)
src/Ubuntu/Components/plugin/ucslotslayout.h (+3/-2)
src/Ubuntu/Components/plugin/ucstyleditembase.cpp (+22/-32)
src/Ubuntu/Components/plugin/ucstyleditembase.h (+8/-4)
src/Ubuntu/Components/plugin/ucstyleditembase_p.h (+5/-3)
src/Ubuntu/Components/plugin/uctheme.cpp (+36/-49)
src/Ubuntu/Components/plugin/uctheme.h (+7/-4)
src/Ubuntu/Components/plugin/ucthemingextension.cpp (+122/-139)
src/Ubuntu/Components/plugin/ucthemingextension.h (+11/-56)
src/Ubuntu/Components/plugin/ucubuntushape.cpp (+2/-0)
src/Ubuntu/Components/plugin/unixsignalhandler_p.cpp (+1/-1)
src/Ubuntu/Components/plugin/unixsignalhandler_p.h (+1/-1)
src/Ubuntu/Components/qmldir (+0/-1)
src/Ubuntu/Test/UbuntuTestCase.qml (+5/-0)
src/Ubuntu/Test/plugin/uctestextras.cpp (+5/-0)
src/Ubuntu/Test/plugin/uctestextras.h (+5/-1)
tests/apicheck/apicheck.cpp (+103/-60)
tests/apicheck/test/Extinct/Animals/test.qml (+2/-1)
tests/apicheck/test/components.api (+1/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py (+3/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py (+2/-14)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+41/-5)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py (+2/-4)
tests/unit_x11/tst_components/tst_bottomedgehint.qml (+161/-20)
tests/unit_x11/tst_components/tst_bug1510919.qml (+75/-0)
tests/unit_x11/tst_components/tst_header.qml (+27/-1)
tests/unit_x11/tst_components/tst_listitem_extras.qml (+81/-0)
tests/unit_x11/tst_components/tst_multicolumnheader.qml (+113/-36)
tests/unit_x11/tst_components/tst_pageheader.qml (+21/-3)
tests/unit_x11/tst_components/tst_pagestack.qml (+29/-20)
tests/unit_x11/tst_components/tst_slotslayout.qml (+30/-1)
tests/unit_x11/tst_subtheming/OtherVersion.qml (+25/-0)
tests/unit_x11/tst_subtheming/StyledItemAppThemeFallback.qml (+0/-24)
tests/unit_x11/tst_subtheming/StyledItemAppThemeVersioned.qml (+0/-1)
tests/unit_x11/tst_subtheming/StyledItemFallback.qml (+0/-24)
tests/unit_x11/tst_subtheming/StyledItemV12.qml (+4/-4)
tests/unit_x11/tst_subtheming/StyledItemV13.qml (+0/-1)
tests/unit_x11/tst_subtheming/tst_subtheming.cpp (+44/-32)
tests/unit_x11/tst_subtheming/tst_subtheming.pro (+2/-3)
ubuntu-ui-toolkit-launcher/launcher.cpp (+4/-3)
Conflict adding file tests/unit_x11/tst_components/tst_bug1510919.qml.  Moved existing file to tests/unit_x11/tst_components/tst_bug1510919.qml.moved.
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/lessHeaderDisabling
Reviewer Review Type Date Requested Status
Ubuntu SDK team 2015-11-17 Pending
Review via email: mp+277711@code.launchpad.net

Commit message

Don't set the header.moving property when flickable contents height changes but the header does not actually move.

Description of the change

Please review, but don't top-approve yet. Let's discuss if this should be a hotfix that goes directly to trunk.

To post a comment you must log in.
1719. By Tim Peeters on 2015-11-18

fix second part of the bug (scrolling); add unit tests

1720. By Tim Peeters on 2015-11-18

remove new blank line

1721. By Tim Peeters on 2015-11-18

comment in unit test file

1722. By Tim Peeters on 2015-11-18

kick jenkins. It passed for r1720 and failed for r1721, the difference was the text in a comment

1723. By Tim Peeters on 2015-11-18

formatting

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2015-10-15 14:17:25 +0000
3+++ components.api 2015-11-17 15:49:37 +0000
4@@ -31,7 +31,7 @@
5 Real
6 String
7 Ubuntu.Components.ActionBar 1.3: StyledItem
8- readonly property Action actions
9+ property list<Action> actions
10 property Component delegate
11 property int numberOfSlots
12 Ubuntu.Components.Styles.ActionBarStyle 1.3: Item
13@@ -41,7 +41,7 @@
14 property url overflowIconSource
15 property string overflowText
16 Ubuntu.Components.ActionContext 1.0 0.1: QtObject
17- default readonly property Action actions
18+ default property list<Action> actions
19 property bool active
20 function addAction(Action action)
21 function removeAction(Action action)
22@@ -54,15 +54,15 @@
23 function trigger()
24 property string text
25 Ubuntu.Components.ActionList 1.0 0.1: QtObject
26- readonly property Action actions
27- default readonly property Action children
28+ property list<Action> actions
29+ default property list<Action> children
30 Ubuntu.Components.ActionList 1.3: QtObject
31- readonly property Action actions
32- default readonly property Action children
33+ property list<Action> actions
34+ default property list<Action> children
35 Ubuntu.Components.ActionManager 1.0 0.1: QtObject
36- default readonly property Action actions
37+ default property list<Action> actions
38 readonly property ActionContext globalContext
39- readonly property ActionContext localContexts
40+ property list<ActionContext> localContexts
41 signal quit()
42 function addAction(Action action)
43 function removeAction(Action action)
44@@ -84,7 +84,7 @@
45 property bool running
46 Ubuntu.Components.AdaptivePageLayout 1.3: PageTreeNode
47 readonly property int columns
48- readonly property PageColumnsLayout layouts
49+ property list<PageColumnsLayou> layouts
50 function var addPageToCurrentColumn(var sourcePage, var page, var properties)
51 function var addPageToNextColumn(var sourcePage, var page, var properties)
52 function var removePages(var page)
53@@ -155,7 +155,7 @@
54 property bool required
55 property QStringList valueNames
56 Ubuntu.Components.Arguments 1.0 0.1: QtObject
57- default readonly property Argument arguments
58+ default property list<Argument> arguments
59 property Argument defaultArgument
60 readonly property bool error
61 readonly property string errorMessage
62@@ -175,11 +175,19 @@
63 property var icon
64 property bool iconFrame
65 property bool progression
66-Ubuntu.Components.BottomEdgeHint 1.3: Item
67+Ubuntu.Components.BottomEdgeHint 1.3: StyledItem
68+ property int deactivateTimeout
69+ property Flickable flickable
70 property string iconName
71 property url iconSource
72 signal clicked()
73+ property Status status
74 property string text
75+Ubuntu.Components.BottomEdgeHint.Status: Enum
76+ Active
77+ Hidden
78+ Inactive
79+ Locked
80 Ubuntu.Components.Button 1.0 0.1: AbstractButton
81 property color color
82 property QFont font
83@@ -221,14 +229,14 @@
84 Ubuntu.Components.ColorUtils 0.1 1.0
85 Ubuntu.Components.ComboButton 1.1: Button
86 property double collapsedHeight
87- default readonly property QtObject comboList
88+ default property list<QtObject> comboList
89 readonly property double comboListHeight
90 property color dropdownColor
91 property bool expanded
92 property double expandedHeight
93 Ubuntu.Components.ComboButton 1.3: Button
94 property double collapsedHeight
95- default readonly property QtObject comboList
96+ default property list<QtObject> comboList
97 readonly property double comboListHeight
98 property color dropdownColor
99 property bool expanded
100@@ -318,7 +326,7 @@
101 signal closeClicked()
102 signal doneClicked()
103 Ubuntu.Components.Pickers.Dialer 1.0 0.1: StyledItem
104- readonly property QtObject centerContent
105+ property list<QtObject> centerContent
106 readonly property Item centerItem
107 property double handSpace
108 readonly property var hands
109@@ -327,7 +335,7 @@
110 property double minimumValue
111 property double size
112 Ubuntu.Components.Pickers.Dialer 1.3: StyledItem
113- readonly property QtObject centerContent
114+ property list<QtObject> centerContent
115 readonly property Item centerItem
116 property double handSpace
117 readonly property var hands
118@@ -339,18 +347,18 @@
119 readonly property Dialer dialer
120 property DialerHandGroup hand
121 readonly property int index
122- default readonly property QtObject overlay
123+ default property list<QtObject> overlay
124 property double value
125 Ubuntu.Components.Pickers.DialerHand 1.3: StyledItem
126 readonly property Dialer dialer
127 property DialerHandGroup hand
128 readonly property int index
129- default readonly property QtObject overlay
130+ default property list<QtObject> overlay
131 property double value
132 Ubuntu.Components.Popups.Dialog 1.0 0.1: PopupBase
133 property Item caller
134 property double callerMargin
135- default readonly property QtObject contents
136+ default property list<QtObject> contents
137 property double edgeMargins
138 property bool modal
139 property Item pointerTarget
140@@ -359,34 +367,16 @@
141 Ubuntu.Components.Popups.Dialog 1.3: PopupBase
142 property Item caller
143 property double callerMargin
144- default readonly property QtObject contents
145+ default property list<QtObject> contents
146 property double edgeMargins
147 property bool modal
148 property Item pointerTarget
149 property string text
150 property string title
151 Ubuntu.Components.ListItems.Divider 1.0 0.1: QQuickImageBase
152- property FillMode fillMode
153- property HAlignment horizontalAlignment
154- signal horizontalAlignmentChanged(HAlignment alignment)
155- signal verticalAlignmentChanged(VAlignment alignment)
156- signal mipmapChanged(bool )
157- property bool mipmap
158- readonly property double paintedHeight
159- readonly property double paintedWidth
160- property VAlignment verticalAlignment
161 Ubuntu.Components.ListItems.Divider 1.3: QQuickImageBase
162- property FillMode fillMode
163- property HAlignment horizontalAlignment
164- signal horizontalAlignmentChanged(HAlignment alignment)
165- signal verticalAlignmentChanged(VAlignment alignment)
166- signal mipmapChanged(bool )
167- property bool mipmap
168- readonly property double paintedHeight
169- readonly property double paintedWidth
170- property VAlignment verticalAlignment
171 Ubuntu.Components.ListItems.Empty 1.0 0.1: AbstractButton
172- readonly property Item backgroundIndicator
173+ property list<Item> backgroundIndicator
174 property bool confirmRemoval
175 readonly property ThinDivider divider
176 property bool highlightWhenPressed
177@@ -398,7 +388,7 @@
178 readonly property string swipingState
179 readonly property bool waitingConfirmationForRemoval
180 Ubuntu.Components.ListItems.Empty 1.3: AbstractButton
181- readonly property Item backgroundIndicator
182+ property list<Item> backgroundIndicator
183 property bool confirmRemoval
184 readonly property ThinDivider divider
185 property bool highlightWhenPressed
186@@ -510,7 +500,7 @@
187 XxSmall
188 Ubuntu.Layouts.Layouts 1.0 0.1: Item
189 readonly property string currentLayout
190- readonly property ConditionalLayout layouts
191+ property list<ConditionalLayout> layouts
192 Ubuntu.Components.ListItem 1.3 1.2: StyledItem
193 property Action action
194 property color color
195@@ -523,18 +513,19 @@
196 property color highlightColor
197 readonly property bool highlighted
198 property ListItemActions leadingActions
199- readonly property Item listItemChildren
200- default readonly property QtObject listItemData
201+ property list<Item> listItemChildren
202+ default property list<QtObject> listItemData
203 signal clicked()
204 signal pressAndHold()
205 signal contentMovementStarted()
206 signal contentMovementEnded()
207 property bool selectMode
208 property bool selected
209+ property bool swipeEnabled 1.3
210 property ListItemActions trailingActions
211 Ubuntu.Components.ListItemActions 1.2: QtObject
212- readonly property Action actions
213- default readonly property QtObject data
214+ property list<Action> actions
215+ default property list<QtObject> data
216 property Component delegate
217 Ubuntu.Components.ListItemDrag 1.2: QtObject
218 property bool accept
219@@ -572,14 +563,14 @@
220 Second
221 Ubuntu.Components.MainView 1.0 0.1: MainViewBase
222 property bool automaticOrientation
223- default readonly property QtObject contentsItem
224+ default property list<QtObject> contentsItem
225 property bool useDeprecatedToolbar
226 Ubuntu.Components.MainView 1.2: MainViewBase
227 property bool automaticOrientation
228- default readonly property QtObject contentsItem
229+ default property list<QtObject> contentsItem
230 Ubuntu.Components.MainView 1.3: MainViewBase
231 property bool automaticOrientation
232- default readonly property QtObject contentsItem
233+ default property list<QtObject> contentsItem
234 Ubuntu.Components.MathUtils 0.1 1.0 1.3
235 Ubuntu.Components.MimeData 1.0 0.1: QtObject
236 property color color
237@@ -587,12 +578,12 @@
238 readonly property QStringList formats
239 property string html
240 property string text
241- property QList<QUrl> urls
242+ property list<url> urls
243 Ubuntu.Components.Mouse 1.0 0.1: QtObject
244 readonly property Qt.MouseButtons acceptedButtons
245 property int clickAndHoldThreshold
246 property bool enabled
247- readonly property Item forwardTo
248+ property list<Item> forwardTo
249 readonly property bool hoverEnabled
250 signal pressed(QQuickMouseEvent mouse, Item host)
251 signal released(QQuickMouseEvent mouse, Item host)
252@@ -611,7 +602,7 @@
253 Ubuntu.Components.ListItems.MultiValue 1.3: Base
254 property var values
255 Ubuntu.Components.Object 1.0 0.1: QtObject
256- default readonly property QtObject children
257+ default property list<QtObject> children
258 Ubuntu.Components.OptionSelector 1.0 0.1: Empty
259 property bool colourImage
260 property double containerHeight
261@@ -665,11 +656,11 @@
262 readonly property bool rotating
263 property bool transitionEnabled
264 Ubuntu.Components.Page 1.0 0.1: PageTreeNode
265- readonly property Action actions
266+ property list<Action> actions
267 property Flickable flickable
268 property string title
269 property Item tools
270-Ubuntu.Components.Page 1.1: Page
271+Ubuntu.Components.Page 1.1: Page10
272 readonly property PageHeadConfiguration head
273 Ubuntu.Components.Page 1.3: PageTreeNode
274 property Flickable flickable
275@@ -682,17 +673,17 @@
276 property double minimumWidth
277 property double preferredWidth
278 Ubuntu.Components.PageColumnsLayout 1.3: QtObject
279- default readonly property PageColumn data
280+ default property list<PageColum> data
281 property bool when
282 Ubuntu.Components.PageHeadConfiguration 1.1: Object
283- readonly property Action actions
284+ property list<Action> actions
285 property Action backAction
286 property Item contents
287 property color foregroundColor
288 property string preset
289 readonly property PageHeadSections sections
290 Ubuntu.Components.PageHeadConfiguration 1.3: Object
291- readonly property Action actions
292+ property list<Action> actions
293 property Action backAction
294 property Item contents
295 property Flickable flickable
296@@ -707,17 +698,17 @@
297 property var model
298 property int selectedIndex
299 Ubuntu.Components.PageHeadSections 1.3: QtObject
300- readonly property Action actions
301+ property list<Action> actions
302 property bool enabled
303 property var model
304 property int selectedIndex
305 Ubuntu.Components.PageHeadState 1.1: State
306- readonly property Action actions
307+ property list<Action> actions
308 property Action backAction
309 property Item contents
310 property PageHeadConfiguration head
311 Ubuntu.Components.PageHeadState 1.3: State
312- readonly property Action actions
313+ property list<Action> actions
314 property Action backAction
315 property Item contents
316 property PageHeadConfiguration head
317@@ -743,6 +734,7 @@
318 Ubuntu.Components.PageHeader 1.3: Header
319 property Item contents
320 readonly property ActionBar leadingActionBar
321+ property list<Action> navigationActions
322 readonly property Sections sections
323 property string title
324 readonly property ActionBar trailingActionBar
325@@ -799,7 +791,7 @@
326 property int align
327 property bool animate
328 readonly property bool animating
329- default readonly property QtObject contents
330+ default property list<QtObject> contents
331 property int hideTimeout
332 property double hintSize
333 property bool locked
334@@ -813,7 +805,7 @@
335 property int align
336 property bool animate
337 readonly property bool animating
338- default readonly property QtObject contents
339+ default property list<QtObject> contents
340 property int hideTimeout
341 property double hintSize
342 property bool locked
343@@ -854,7 +846,7 @@
344 property bool autoClose
345 property Item caller
346 property double callerMargin
347- default readonly property QtObject container
348+ default property list<QtObject> container
349 property double contentHeight
350 property double contentWidth
351 property double edgeMargins
352@@ -866,7 +858,7 @@
353 property bool autoClose
354 property Item caller
355 property double callerMargin
356- default readonly property QtObject container
357+ default property list<QtObject> container
358 property double contentHeight
359 property double contentWidth
360 property double edgeMargins
361@@ -937,7 +929,7 @@
362 property Flickable flickableItem
363 Ubuntu.Components.ScrollbarUtils 0.1 1.0
364 Ubuntu.Components.Sections 1.3: StyledItem
365- readonly property Action actions
366+ property list<Action> actions
367 property var model
368 property int selectedIndex
369 Ubuntu.Components.ServiceProperties 1.1: QtObject
370@@ -958,13 +950,13 @@
371 Inactive
372 Synchronizing
373 Ubuntu.Components.Popups.SheetBase 1.0 0.1: PopupBase
374- default readonly property QtObject container
375+ default property list<QtObject> container
376 property double contentsHeight
377 property double contentsWidth
378 property bool modal
379 property string title
380 Ubuntu.Components.Popups.SheetBase 1.3: PopupBase
381- default readonly property QtObject container
382+ default property list<QtObject> container
383 property double contentsHeight
384 property double contentsWidth
385 property bool modal
386@@ -1094,14 +1086,14 @@
387 readonly property Tab selectedTab
388 property int selectedTabIndex
389 property TabBar tabBar
390- default readonly property QtObject tabChildren
391+ default property list<QtObject> tabChildren
392 Ubuntu.Components.Tabs 1.3: PageTreeNode
393 readonly property int count
394 readonly property Item currentPage
395 readonly property Tab selectedTab
396 property int selectedTabIndex
397 property TabBar tabBar
398- default readonly property QtObject tabChildren
399+ default property list<QtObject> tabChildren
400 Ubuntu.Test.TestExtras 1.0: QtObject singleton
401 function string openGLflavor()
402 function string cpuArchitecture()
403@@ -1284,10 +1276,10 @@
404 property bool persistentSelection
405 property string placeholderText
406 property var popover
407- readonly property QtObject primaryItem
408+ property list<QtObject> primaryItem
409 property bool readOnly
410 property int renderType
411- readonly property QtObject secondaryItem
412+ property list<QtObject> secondaryItem
413 property bool selectByMouse
414 readonly property string selectedText
415 property color selectedTextColor
416@@ -1345,10 +1337,10 @@
417 property bool persistentSelection
418 property string placeholderText
419 property var popover
420- readonly property QtObject primaryItem
421+ property list<QtObject> primaryItem
422 property bool readOnly
423 property int renderType
424- readonly property QtObject secondaryItem
425+ property list<QtObject> secondaryItem
426 property bool selectByMouse
427 readonly property string selectedText
428 property color selectedTextColor
429@@ -1363,7 +1355,6 @@
430 property string name
431 property QtObject palette
432 readonly property ThemeSettings parentTheme
433- property ushort version
434 Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle
435 Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle
436 Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem
437@@ -1384,13 +1375,13 @@
438 property string text
439 Ubuntu.Components.ToolbarItems 1.0 0.1: Item
440 property Item back
441- default readonly property QtObject contents
442+ default property list<QtObject> contents
443 property bool locked
444 property bool opened
445 property Item pageStack
446 Ubuntu.Components.ToolbarItems 1.3: Item
447 property Item back
448- default readonly property QtObject contents
449+ default property list<QtObject> contents
450 property bool locked
451 property bool opened
452 property Item pageStack
453@@ -1400,7 +1391,6 @@
454 Ubuntu.Components.UCFontUtils 1.0 0.1: QtObject
455 function double sizeToPixels(string size)
456 function double modularScale(string size)
457-UCItemAttached: QtObject
458 UCListItemDivider: Item
459 property color colorFrom
460 property color colorTo
461@@ -1531,6 +1521,7 @@
462 function var typeString(var string)
463 function var warningFormat(var line, var column, var message)
464 function var waitForHeaderAnimation(var mainView)
465+ readonly property QuickTestUtil testUtil
466 Ubuntu.Components.UriHandler 1.0 0.1: QtObject singleton
467 signal opened(QStringList uris)
468 Ubuntu.Components.ListItems.ValueSelector 1.0 0.1: Empty
469@@ -1551,12 +1542,12 @@
470 property var values
471 Ubuntu.Components.ViewItems 1.2: QtObject
472 property bool dragMode
473- property QList<int> expandedIndices
474+ property list<int> expandedIndices
475 property int expansionFlags
476 signal dragUpdated(ListItemDrag event)
477- signal expandedIndicesChanged(QList<int> indices)
478+ signal expandedIndicesChanged(list<int> indices)
479 property bool selectMode
480- property QList<int> selectedIndices
481+ property list<int> selectedIndices
482 Ubuntu.Components.ViewItems.ExpansionFlag: Enum
483 CollapseOnOutsidePress
484 Exclusive
485
486=== modified file 'debian/control'
487--- debian/control 2015-10-09 08:23:09 +0000
488+++ debian/control 2015-11-17 15:49:37 +0000
489@@ -9,6 +9,7 @@
490 python3:any,
491 qml-module-qtgraphicaleffects | libqt5qml-graphicaleffects,
492 libinput-dev,
493+ libxkbcommon-dev,
494 qtbase5-dev,
495 qtbase5-private-dev,
496 qttools5-dev-tools,
497
498=== modified file 'examples/ubuntu-ui-toolkit-gallery/About.qml'
499--- examples/ubuntu-ui-toolkit-gallery/About.qml 2015-09-24 19:36:36 +0000
500+++ examples/ubuntu-ui-toolkit-gallery/About.qml 2015-11-17 15:49:37 +0000
501@@ -30,9 +30,8 @@
502 anchors.fill: parent
503 color: theme.palette.normal.background
504 }
505- head {
506- title: i18n.tr('About...')
507- foregroundColor: theme.palette.selected.foregroundText
508+ header: PageHeader {
509+ title: i18n.tr("About...")
510 }
511
512 Column {
513
514=== renamed file 'examples/ubuntu-ui-toolkit-gallery/BottomEdgeHint.qml' => 'examples/ubuntu-ui-toolkit-gallery/BottomEdgePage.qml'
515=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml'
516--- examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-09-30 21:14:25 +0000
517+++ examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-11-17 15:49:37 +0000
518@@ -28,7 +28,7 @@
519
520 ListItem {
521 id: addressbookListItem
522- height: addressbookLayout.height
523+ height: addressbookLayout.height + (divider.visible ? divider.height : 0)
524
525 ListItemLayout {
526 id: addressbookLayout
527@@ -48,7 +48,7 @@
528
529 ListItem {
530 id: addressbookDetailsListItem
531- height: addressbookDetailsLayout.height + divider.height
532+ height: addressbookDetailsLayout.height + (divider.visible ? divider.height : 0)
533 ListItemLayout {
534 id: addressbookDetailsLayout
535
536@@ -73,7 +73,7 @@
537 ListItem {
538 id: telegramContactsListItem
539
540- height: telegramContactsLayout.height
541+ height: telegramContactsLayout.height + (divider.visible ? divider.height : 0)
542
543 ListItemLayout {
544 id: telegramContactsLayout
545@@ -92,7 +92,7 @@
546
547 ListItem {
548 id: systemSettings1
549- height: systemSettings1_layout.height
550+ height: systemSettings1_layout.height + (divider.visible ? divider.height : 0)
551
552 ListItemLayout {
553 id: systemSettings1_layout
554@@ -110,7 +110,7 @@
555
556 ListItem {
557 id: systemSettings2
558- height: systemSettings2_layout.height
559+ height: systemSettings2_layout.height + (divider.visible ? divider.height : 0)
560
561 ListItemLayout {
562 id: systemSettings2_layout
563@@ -129,7 +129,7 @@
564
565 ListItem {
566 id: systemSettings3
567- height: systemSettings3_layout.height
568+ height: systemSettings3_layout.height + (divider.visible ? divider.height : 0)
569
570 ListItemLayout {
571 id: systemSettings3_layout
572@@ -157,7 +157,7 @@
573 spacing: 0
574
575 ListItem {
576- height: customLabelsLayout.height
577+ height: customLabelsLayout.height + (divider.visible ? divider.height : 0)
578
579 ListItemLayout {
580 id: customLabelsLayout
581@@ -220,7 +220,7 @@
582
583 ListItem {
584 id: dialerHistoryListItem
585- height: dialerHistoryLayout.height
586+ height: dialerHistoryLayout.height + (divider.visible ? divider.height : 0)
587
588 ListItemLayout {
589 id: dialerHistoryLayout
590
591=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml'
592--- examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-09-28 12:26:13 +0000
593+++ examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-11-17 15:49:37 +0000
594@@ -20,7 +20,7 @@
595 ListItem {
596 property alias title: layout.title
597
598- height: layout.height
599+ height: layout.height + (divider.visible ? divider.height : 0)
600 onPressAndHold: selectMode = !selectMode
601
602 ListItemLayout { id: layout }
603
604=== modified file 'examples/ubuntu-ui-toolkit-gallery/MainPage.qml'
605--- examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-09-30 05:59:49 +0000
606+++ examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-11-17 15:49:37 +0000
607@@ -21,37 +21,53 @@
608 id: mainPage
609 title: "Ubuntu UI Toolkit"
610
611- head.actions: [
612- Action {
613- text: i18n.tr('Right to Left')
614- iconName: 'flash-on'
615- visible: !gallery.rtl
616- onTriggered: gallery.rtl = !gallery.rtl
617- },
618- Action {
619- text: i18n.tr('Left to Right')
620- iconName: 'flash-off'
621- visible: gallery.rtl
622- onTriggered: gallery.rtl = !gallery.rtl
623- },
624- Action {
625- text: i18n.tr('Use dark theme')
626- iconName: 'torch-on'
627- visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'
628- onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'
629- },
630- Action {
631- text: i18n.tr('Use light theme')
632- iconName: 'torch-off'
633- visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'
634- onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'
635- },
636- Action {
637- text: i18n.tr('About')
638- iconName: "info"
639- onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
640- }
641- ]
642+ header: PageHeader {
643+ title: mainPage.title
644+ flickable: layout.columns === 1 ? widgetList : null
645+ trailingActionBar.actions: [
646+ Action {
647+ text: i18n.tr('Right to Left')
648+ iconName: 'flash-on'
649+ visible: !gallery.rtl
650+ onTriggered: gallery.rtl = !gallery.rtl
651+ },
652+ Action {
653+ text: i18n.tr('Left to Right')
654+ iconName: 'flash-off'
655+ visible: gallery.rtl
656+ onTriggered: gallery.rtl = !gallery.rtl
657+ },
658+ Action {
659+ text: i18n.tr('Use dark theme')
660+ iconName: 'torch-on'
661+ visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'
662+ onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'
663+ },
664+ Action {
665+ text: i18n.tr('Use light theme')
666+ iconName: 'torch-off'
667+ visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'
668+ onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'
669+ },
670+ Action {
671+ text: i18n.tr('About')
672+ iconName: "info"
673+ onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
674+ },
675+ Action {
676+ text: i18n.tr("Deactivate mouse")
677+ iconName: "non-starred"
678+ visible: QuickUtils.mouseAttached
679+ onTriggered: QuickUtils.mouseAttached = false
680+ },
681+ Action {
682+ text: i18n.tr("Activate mouse")
683+ iconName: "starred"
684+ visible: !QuickUtils.mouseAttached
685+ onTriggered: QuickUtils.mouseAttached = true
686+ }
687+ ]
688+ }
689
690 onActiveChanged: {
691 if (layout.columns < 2) {
692@@ -62,59 +78,65 @@
693 }
694 }
695
696- Rectangle {
697- color: Qt.rgba(0.0, 0.0, 0.0, 0.01)
698- anchors.fill: parent
699-
700- UbuntuListView {
701- id: widgetList
702- objectName: "widgetList"
703- anchors.fill: parent
704- model: WidgetsModel {}
705- currentIndex: -1
706-
707- onCurrentIndexChanged: openPage()
708-
709- function openPage() {
710- if (!mainPage.active || currentIndex < 0) return;
711- var modelData = model.get(currentIndex);
712- var source = Qt.resolvedUrl(modelData.source);
713- mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});
714- }
715-
716- delegate: ListItem {
717- objectName: model.objectName
718- contentItem {
719- anchors.leftMargin: units.gu(2)
720- anchors.rightMargin: units.gu(2)
721- }
722- enabled: source != ""
723- // Used by Autopilot
724- property string text: label
725- onClicked: widgetList.currentIndex = index
726- Label {
727- id: labelItem
728- anchors {
729- fill: parent
730- rightMargin: units.gu(4)
731- }
732- text: label
733- verticalAlignment: Text.AlignVCenter
734- }
735- Icon {
736- name: "next"
737- width: units.gu(2)
738- height: units.gu(2)
739- anchors {
740- verticalCenter: parent.verticalCenter
741- right: parent.right
742- }
743- }
744- }
745- highlight: Rectangle {
746- color: theme.palette.selected.background
747- }
748- highlightMoveDuration: 0
749- }
750+ UbuntuListView {
751+ id: widgetList
752+ objectName: "widgetList"
753+ anchors {
754+ fill: parent
755+ topMargin: mainPage.header.flickable ? 0 : mainPage.header.height
756+ }
757+
758+ model: WidgetsModel {}
759+ currentIndex: -1
760+
761+ onCurrentIndexChanged: openPage()
762+
763+ function openPage() {
764+ if (!mainPage.active || currentIndex < 0) return;
765+ var modelData = model.get(currentIndex);
766+ var source = Qt.resolvedUrl(modelData.source);
767+ mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});
768+ }
769+
770+ delegate: ListItem {
771+ objectName: model.objectName
772+ contentItem {
773+ anchors.leftMargin: units.gu(2)
774+ anchors.rightMargin: units.gu(2)
775+ }
776+ enabled: source != ""
777+ // Used by Autopilot
778+ property string text: label
779+ onClicked: widgetList.currentIndex = index
780+ Label {
781+ id: labelItem
782+ anchors {
783+ fill: parent
784+ rightMargin: units.gu(4)
785+ }
786+ text: label
787+ verticalAlignment: Text.AlignVCenter
788+ }
789+ Icon {
790+ name: "next"
791+ width: units.gu(2)
792+ height: units.gu(2)
793+ anchors {
794+ verticalCenter: parent.verticalCenter
795+ right: parent.right
796+ }
797+ }
798+ }
799+ highlight: Rectangle {
800+ color: theme.palette.selected.background
801+ }
802+ highlightMoveDuration: 0
803+ }
804+
805+ BottomEdgeHint {
806+ flickable: widgetList
807+ text: i18n.tr('About')
808+ iconName: "info"
809+ onClicked: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
810 }
811 }
812
813=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sections.qml'
814--- examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-07-03 16:19:59 +0000
815+++ examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-11-17 15:49:37 +0000
816@@ -19,7 +19,13 @@
817
818 Template {
819 objectName: "sectionsTemplate"
820- head.sections.model: ["first", "second", "third"]
821+ id: sectionsTemplate
822+
823+ header: PageHeader {
824+ title: sectionsTemplate.title
825+ sections.model: ["first", "second", "third"]
826+ }
827+
828 TemplateSection {
829 title: "Sections"
830 className: "Sections"
831
832=== modified file 'examples/ubuntu-ui-toolkit-gallery/Template.qml'
833--- examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-07-16 09:12:55 +0000
834+++ examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-11-17 15:49:37 +0000
835@@ -20,20 +20,29 @@
836 Page {
837 id: template
838
839- default property alias content: layout.children
840- property alias spacing: layout.spacing
841+ default property alias content: column.children
842+ property alias spacing: column.spacing
843+
844+ header: PageHeader {
845+ title: template.title
846+ flickable: layout.columns === 1 ? flickable : null
847+ onFlickableChanged: exposed = true;
848+ }
849
850 Flickable {
851 id: flickable
852 objectName: "TemplateFlickable"
853- anchors.fill: parent
854- anchors.topMargin: units.gu(2)
855- anchors.bottomMargin: units.gu(2)
856- contentHeight: layout.height
857+ anchors {
858+ fill: parent
859+ topMargin: template.header.flickable ? units.gu(2) :
860+ units.gu(2) + template.header.height
861+ bottomMargin: units.gu(2)
862+ }
863+ contentHeight: column.height
864 interactive: contentHeight > height
865
866 Column {
867- id: layout
868+ id: column
869 spacing: units.gu(6)
870 anchors.left: parent.left
871 anchors.right: parent.right
872
873=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
874--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-09-25 17:05:53 +0000
875+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-11-17 15:49:37 +0000
876@@ -103,8 +103,8 @@
877 }
878 ListElement {
879 objectName: "bottomEdgeHintElement"
880- label: "Bottom Edge Hint"
881- source: "BottomEdgeHint.qml"
882+ label: "Bottom Edge"
883+ source: "BottomEdgePage.qml"
884 }
885
886 ListElement {
887
888=== modified file 'examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot'
889--- examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot 2014-11-11 10:28:08 +0000
890+++ examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot 2015-11-17 15:49:37 +0000
891@@ -8,7 +8,7 @@
892 msgstr ""
893 "Project-Id-Version: ubuntu-ui-toolkit-gallery\n"
894 "Report-Msgid-Bugs-To: \n"
895-"POT-Creation-Date: 2014-11-11 11:21+0100\n"
896+"POT-Creation-Date: 2015-11-05 10:04+0100\n"
897 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
898 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
899 "Language-Team: LANGUAGE <LL@li.org>\n"
900@@ -17,13 +17,34 @@
901 "Content-Type: text/plain; charset=CHARSET\n"
902 "Content-Transfer-Encoding: 8bit\n"
903
904+#: About.qml:34
905+msgid "About..."
906+msgstr ""
907+
908+#: ActionBars.qml:68
909+msgid "Short list"
910+msgstr ""
911+
912+#: ActionBars.qml:79
913+msgid "Number of slots"
914+msgstr ""
915+
916+#: ActionBars.qml:92
917+msgid "Long list"
918+msgstr ""
919+
920+#: ActionBars.qml:102 Buttons.qml:91 Sections.qml:45 TextInputs.qml:90
921+#: Toggles.qml:45 Toggles.qml:83
922+msgid "Disabled"
923+msgstr ""
924+
925 #: Animations.qml:24
926 msgid "NumberAnimation"
927 msgstr ""
928
929 #: Animations.qml:28 Buttons.qml:28 Dialog.qml:29 ListItems.qml:25
930-#: ProgressBars.qml:28 ProgressBars.qml:84 Sheet.qml:40 Sheet.qml:73
931-#: Sliders.qml:28 TextInputs.qml:45
932+#: ProgressBars.qml:29 ProgressBars.qml:85 Sheet.qml:40 Sheet.qml:73
933+#: Sliders.qml:28 TextInputs.qml:46
934 msgid "Standard"
935 msgstr ""
936
937@@ -47,8 +68,7 @@
938 msgid "Sleepy"
939 msgstr ""
940
941-#: Buttons.qml:32 Buttons.qml:41 Buttons.qml:51 Buttons.qml:71 Buttons.qml:79
942-#: Buttons.qml:89
943+#: Buttons.qml:32 Buttons.qml:41 Buttons.qml:77 Buttons.qml:85 Buttons.qml:95
944 msgid "Call"
945 msgstr ""
946
947@@ -56,27 +76,28 @@
948 msgid "Stroke"
949 msgstr ""
950
951-#: Buttons.qml:47 UbuntuShape.qml:28
952+#: Buttons.qml:47 Icons.qml:54
953 msgid "Color"
954 msgstr ""
955
956-#: Buttons.qml:57 Buttons.qml:114 ListItems.qml:43
957+#: Buttons.qml:53
958+#, qt-format
959+msgid "Call %1"
960+msgstr ""
961+
962+#: Buttons.qml:63 Buttons.qml:120 ListItems.qml:43
963 msgid "Icon"
964 msgstr ""
965
966-#: Buttons.qml:66 Buttons.qml:128
967+#: Buttons.qml:72 Buttons.qml:134
968 msgid "Icon+Text"
969 msgstr ""
970
971-#: Buttons.qml:85 TextInputs.qml:88 Toggles.qml:45 Toggles.qml:83
972-msgid "Disabled"
973-msgstr ""
974-
975-#: Buttons.qml:99 OptionSelectors.qml:34
976+#: Buttons.qml:105 OptionSelectors.qml:41
977 msgid "Collapsed"
978 msgstr ""
979
980-#: Buttons.qml:142 ListItems.qml:120 OptionSelectors.qml:43
981+#: Buttons.qml:148 ListItems.qml:120 OptionSelectors.qml:47
982 msgid "Expanded"
983 msgstr ""
984
985@@ -108,22 +129,22 @@
986 msgid "Purple"
987 msgstr ""
988
989-#: Dialog.qml:32 Popover.qml:45 Sheet.qml:43 Sheet.qml:76
990+#: Dialog.qml:32 Popover.qml:42 Sheet.qml:43 Sheet.qml:76
991 msgid "Open"
992 msgstr ""
993
994-#: Icons.qml:30
995+#: Icons.qml:29
996 msgid "Scaling"
997 msgstr ""
998
999-#: Icons.qml:55
1000-msgid "Colorization"
1001-msgstr ""
1002-
1003-#: Icons.qml:80
1004+#: Icons.qml:79
1005 msgid "Theme"
1006 msgstr ""
1007
1008+#: ListItemLayouts.qml:208 NewListItems.qml:79
1009+msgid "Leading and trailing actions"
1010+msgstr ""
1011+
1012 #: ListItems.qml:28 ListItems.qml:36 ListItems.qml:46 ListItems.qml:60
1013 #: ListItems.qml:66 ListItems.qml:76 ListItems.qml:85 ListItems.qml:94
1014 #: ListItems.qml:160 ListItems.qml:173 ListItems.qml:193
1015@@ -159,30 +180,26 @@
1016 msgstr ""
1017
1018 #: ListItems.qml:95 ListItems.qml:113 ListItems.qml:122 ListItems.qml:132
1019-#: ListItems.qml:161 ListItems.qml:176 OptionSelectors.qml:35
1020-#: OptionSelectors.qml:45 OptionSelectors.qml:56 OptionSelectors.qml:86
1021-#: OptionSelectors.qml:101
1022+#: ListItems.qml:161 ListItems.qml:176 OptionSelectors.qml:33
1023+#: OptionSelectors.qml:84 OptionSelectors.qml:99
1024 msgid "Value 1"
1025 msgstr ""
1026
1027 #: ListItems.qml:96 ListItems.qml:114 ListItems.qml:123 ListItems.qml:133
1028-#: ListItems.qml:162 ListItems.qml:177 OptionSelectors.qml:36
1029-#: OptionSelectors.qml:46 OptionSelectors.qml:57 OptionSelectors.qml:87
1030-#: OptionSelectors.qml:102
1031+#: ListItems.qml:162 ListItems.qml:177 OptionSelectors.qml:85
1032+#: OptionSelectors.qml:100
1033 msgid "Value 2"
1034 msgstr ""
1035
1036 #: ListItems.qml:97 ListItems.qml:115 ListItems.qml:124 ListItems.qml:134
1037-#: ListItems.qml:163 ListItems.qml:178 OptionSelectors.qml:37
1038-#: OptionSelectors.qml:47 OptionSelectors.qml:58 OptionSelectors.qml:88
1039-#: OptionSelectors.qml:103
1040+#: ListItems.qml:163 ListItems.qml:178 OptionSelectors.qml:86
1041+#: OptionSelectors.qml:101
1042 msgid "Value 3"
1043 msgstr ""
1044
1045 #: ListItems.qml:98 ListItems.qml:116 ListItems.qml:125 ListItems.qml:135
1046-#: ListItems.qml:164 ListItems.qml:179 OptionSelectors.qml:38
1047-#: OptionSelectors.qml:48 OptionSelectors.qml:59 OptionSelectors.qml:89
1048-#: OptionSelectors.qml:104
1049+#: ListItems.qml:164 ListItems.qml:179 OptionSelectors.qml:87
1050+#: OptionSelectors.qml:102
1051 msgid "Value 4"
1052 msgstr ""
1053
1054@@ -190,35 +207,35 @@
1055 msgid "Item selector"
1056 msgstr ""
1057
1058-#: ListItems.qml:112 TextInputs.qml:114
1059+#: ListItems.qml:112 TextInputs.qml:117
1060 msgid "Expanding"
1061 msgstr ""
1062
1063-#: ListItems.qml:129 OptionSelectors.qml:53
1064+#: ListItems.qml:129 OptionSelectors.qml:54
1065 msgid "Multiple Selection"
1066 msgstr ""
1067
1068-#: ListItems.qml:139 OptionSelectors.qml:64
1069+#: ListItems.qml:139 OptionSelectors.qml:62
1070 msgid "Custom Model"
1071 msgstr ""
1072
1073-#: ListItems.qml:165 ListItems.qml:180 OptionSelectors.qml:90
1074-#: OptionSelectors.qml:105
1075+#: ListItems.qml:165 ListItems.qml:180 OptionSelectors.qml:88
1076+#: OptionSelectors.qml:103
1077 msgid "Value 5"
1078 msgstr ""
1079
1080-#: ListItems.qml:166 ListItems.qml:181 OptionSelectors.qml:91
1081-#: OptionSelectors.qml:106
1082+#: ListItems.qml:166 ListItems.qml:181 OptionSelectors.qml:89
1083+#: OptionSelectors.qml:104
1084 msgid "Value 6"
1085 msgstr ""
1086
1087-#: ListItems.qml:167 ListItems.qml:182 OptionSelectors.qml:92
1088-#: OptionSelectors.qml:107
1089+#: ListItems.qml:167 ListItems.qml:182 OptionSelectors.qml:90
1090+#: OptionSelectors.qml:105
1091 msgid "Value 7"
1092 msgstr ""
1093
1094-#: ListItems.qml:168 ListItems.qml:183 OptionSelectors.qml:93
1095-#: OptionSelectors.qml:108
1096+#: ListItems.qml:168 ListItems.qml:183 OptionSelectors.qml:91
1097+#: OptionSelectors.qml:106
1098 msgid "Value 8"
1099 msgstr ""
1100
1101@@ -254,59 +271,118 @@
1102 msgid "Expandable"
1103 msgstr ""
1104
1105+#: NewListItems.qml:39
1106+msgid "Colored"
1107+msgstr ""
1108+
1109+#: NewListItems.qml:42
1110+msgid "Highlight color"
1111+msgstr ""
1112+
1113+#: NewListItems.qml:71
1114+msgid "Leading actions"
1115+msgstr ""
1116+
1117+#: NewListItems.qml:75
1118+msgid "Trailing actions"
1119+msgstr ""
1120+
1121+#: NewListItems.qml:84
1122+msgid "Custom action delegates"
1123+msgstr ""
1124+
1125+#: NewListItems.qml:111
1126+msgid "Edit"
1127+msgstr ""
1128+
1129+#: NewListItems.qml:114
1130+msgid "Move"
1131+msgstr ""
1132+
1133+#: NewListItems.qml:163
1134+msgid "Basic"
1135+msgstr ""
1136+
1137+#: NewListItems.qml:163 NewListItems.qml:168 NewListItems.qml:169
1138+#: NewListItems.qml:213 NewListItems.qml:214
1139+msgid "Colored divider"
1140+msgstr ""
1141+
1142+#: NewListItems.qml:163
1143+msgid "Immutable"
1144+msgstr ""
1145+
1146+#: NewListItems.qml:163 NewListItems.qml:170 NewListItems.qml:215
1147+msgid "No divider"
1148+msgstr ""
1149+
1150 #: OptionSelectors.qml:24
1151 msgid "Option Selector"
1152 msgstr ""
1153
1154-#: OptionSelectors.qml:85
1155+#: OptionSelectors.qml:34
1156+msgid "This is the second value"
1157+msgstr ""
1158+
1159+#: OptionSelectors.qml:35
1160+msgid ""
1161+"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy "
1162+"nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."
1163+msgstr ""
1164+
1165+#: OptionSelectors.qml:36
1166+msgid "Once upon a time there was a story nobody told."
1167+msgstr ""
1168+
1169+#: OptionSelectors.qml:83
1170 msgid "Custom container height"
1171 msgstr ""
1172
1173-#: OptionSelectors.qml:98
1174+#: OptionSelectors.qml:96
1175 msgid "No initial selection, scrollable."
1176 msgstr ""
1177
1178-#: Pickers.qml:29
1179+#: Pickers.qml:31
1180 msgid "Linear"
1181 msgstr ""
1182
1183-#: Pickers.qml:48
1184+#: Pickers.qml:63
1185 msgid "Circular"
1186 msgstr ""
1187
1188-#: Pickers.qml:73 ProgressBars.qml:48
1189+#: Pickers.qml:100 ProgressBars.qml:49
1190 msgid "Infinite"
1191 msgstr ""
1192
1193-#: Pickers.qml:110
1194+#: Pickers.qml:137
1195 msgid "Clock"
1196 msgstr ""
1197
1198-#: Pickers.qml:147
1199+#: Pickers.qml:174
1200 msgid "Overlay"
1201 msgstr ""
1202
1203-#: Popover.qml:41
1204+#: Popover.qml:38
1205 msgid "Flickable"
1206 msgstr ""
1207
1208-#: Popover.qml:77
1209+#: Popover.qml:74
1210 msgid "Action #1"
1211 msgstr ""
1212
1213-#: Popover.qml:81
1214+#: Popover.qml:78
1215 msgid "Action #2"
1216 msgstr ""
1217
1218-#: Popover.qml:85
1219+#: Popover.qml:82
1220 msgid "Action #3"
1221 msgstr ""
1222
1223-#: Popover.qml:89
1224+#: Popover.qml:86
1225 msgid "Action #4"
1226 msgstr ""
1227
1228-#: Popover.qml:93
1229+#: Popover.qml:90
1230 msgid "Action #5"
1231 msgstr ""
1232
1233@@ -314,14 +390,22 @@
1234 msgid "Progress Bar"
1235 msgstr ""
1236
1237-#: ProgressBars.qml:58
1238+#: ProgressBars.qml:59
1239 msgid "No label"
1240 msgstr ""
1241
1242-#: ProgressBars.qml:80
1243+#: ProgressBars.qml:81
1244 msgid "Activity Indicator"
1245 msgstr ""
1246
1247+#: ProportionalShape.qml:28
1248+msgid "Sizes"
1249+msgstr ""
1250+
1251+#: Sections.qml:34
1252+msgid "Enabled"
1253+msgstr ""
1254+
1255 #: Sheet.qml:28
1256 msgid "The visual style of the Sheet is early work and thus clunky looking."
1257 msgstr ""
1258@@ -330,7 +414,7 @@
1259 msgid "Title"
1260 msgstr ""
1261
1262-#: Sliders.qml:36 Sliders.qml:51 Sliders.qml:68
1263+#: Sliders.qml:36 Sliders.qml:51 Sliders.qml:68 Sliders.qml:93
1264 #, qt-format
1265 msgid "Actual value: %1"
1266 msgstr ""
1267@@ -343,43 +427,51 @@
1268 msgid "Range"
1269 msgstr ""
1270
1271-#: Styles.qml:27
1272-msgid "Switch between old and new style header"
1273-msgstr ""
1274-
1275-#: Styles.qml:40
1276-msgid "Switch between themes"
1277-msgstr ""
1278-
1279-#: TextInputs.qml:49
1280+#: Sliders.qml:74
1281+msgid "Labels"
1282+msgstr ""
1283+
1284+#: Sliders.qml:85
1285+msgid "Small"
1286+msgstr ""
1287+
1288+#: Sliders.qml:87
1289+msgid "Medium"
1290+msgstr ""
1291+
1292+#: Sliders.qml:89
1293+msgid "Large"
1294+msgstr ""
1295+
1296+#: TextInputs.qml:50
1297 msgid "Type me in..."
1298 msgstr ""
1299
1300-#: TextInputs.qml:55
1301+#: TextInputs.qml:56
1302 msgid "Password"
1303 msgstr ""
1304
1305-#: TextInputs.qml:66
1306+#: TextInputs.qml:67
1307 msgid "Numbers"
1308 msgstr ""
1309
1310-#: TextInputs.qml:77
1311+#: TextInputs.qml:78
1312 msgid "Read-only"
1313 msgstr ""
1314
1315-#: TextInputs.qml:81
1316+#: TextInputs.qml:82
1317 msgid "Nobody type here"
1318 msgstr ""
1319
1320-#: TextInputs.qml:92
1321+#: TextInputs.qml:94
1322 msgid "No interaction allowed"
1323 msgstr ""
1324
1325-#: TextInputs.qml:104
1326+#: TextInputs.qml:107
1327 msgid "Default"
1328 msgstr ""
1329
1330-#: TextInputs.qml:126
1331+#: TextInputs.qml:129
1332 msgid "Rich Text"
1333 msgstr ""
1334
1335@@ -391,22 +483,18 @@
1336 msgid "Checked"
1337 msgstr ""
1338
1339-#: Toolbar.qml:30
1340-msgid "Share"
1341-msgstr ""
1342-
1343-#: Toolbar.qml:46
1344-msgid "See below"
1345-msgstr ""
1346-
1347-#: UbuntuShape.qml:49
1348+#: UbuntuShape.qml:28
1349+msgid "Aspect"
1350+msgstr ""
1351+
1352+#: UbuntuShape.qml:73
1353+msgid "Radius"
1354+msgstr ""
1355+
1356+#: UbuntuShape.qml:115
1357 msgid "Image"
1358 msgstr ""
1359
1360-#: UbuntuShape.qml:64
1361-msgid "Radius"
1362-msgstr ""
1363-
1364-#: UbuntuShape.qml:97
1365-msgid "Sizes"
1366+#: UbuntuShape.qml:134
1367+msgid "Gradient"
1368 msgstr ""
1369
1370=== modified file 'po/ubuntu-ui-toolkit.pot'
1371--- po/ubuntu-ui-toolkit.pot 2014-11-06 15:50:17 +0000
1372+++ po/ubuntu-ui-toolkit.pot 2015-11-17 15:49:37 +0000
1373@@ -8,19 +8,140 @@
1374 msgstr ""
1375 "Project-Id-Version: ubuntu-ui-toolkit\n"
1376 "Report-Msgid-Bugs-To: \n"
1377-"POT-Creation-Date: 2014-11-05 14:29+0100\n"
1378+"POT-Creation-Date: 2015-11-05 10:05+0100\n"
1379 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1380 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1381 "Language-Team: LANGUAGE <LL@li.org>\n"
1382 "Language: \n"
1383 "MIME-Version: 1.0\n"
1384-"Content-Type: text/plain; charset=CHARSET\n"
1385+"Content-Type: text/plain; charset=UTF-8\n"
1386 "Content-Transfer-Encoding: 8bit\n"
1387-
1388-#: Ubuntu/Components/ListItems/Empty.qml:413
1389+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
1390+
1391+#: Ubuntu/Components/1.2/TextInputPopover.qml:29
1392+#: Ubuntu/Components/1.3/TextInputPopover.qml:29
1393+msgid "Select All"
1394+msgstr ""
1395+
1396+#: Ubuntu/Components/1.2/TextInputPopover.qml:36
1397+#: Ubuntu/Components/1.3/TextInputPopover.qml:36
1398+msgid "Cut"
1399+msgstr ""
1400+
1401+#: Ubuntu/Components/1.2/TextInputPopover.qml:48
1402+#: Ubuntu/Components/1.3/TextInputPopover.qml:48
1403+msgid "Copy"
1404+msgstr ""
1405+
1406+#: Ubuntu/Components/1.2/TextInputPopover.qml:57
1407+#: Ubuntu/Components/1.3/TextInputPopover.qml:57
1408+msgid "Paste"
1409+msgstr ""
1410+
1411+#: Ubuntu/Components/1.2/ToolbarItems.qml:143
1412+#: Ubuntu/Components/1.3/ToolbarItems.qml:143
1413+msgid "Back"
1414+msgstr ""
1415+
1416+#: Ubuntu/Components/ListItems/1.2/Empty.qml:398
1417+#: Ubuntu/Components/ListItems/1.3/Empty.qml:398
1418 msgid "Delete"
1419 msgstr ""
1420
1421+#: Ubuntu/Components/plugin/adapters/dbuspropertywatcher_p.cpp:51
1422+msgid "No service/path specified"
1423+msgstr ""
1424+
1425+#: Ubuntu/Components/plugin/adapters/dbuspropertywatcher_p.cpp:69
1426+#, qt-format
1427+msgid "Invalid bus type: %1."
1428+msgstr ""
1429+
1430+#. TRANSLATORS: Time based "this is happening/happened now"
1431+#: Ubuntu/Components/plugin/i18n.cpp:268
1432+msgid "Now"
1433+msgstr ""
1434+
1435+#: Ubuntu/Components/plugin/i18n.cpp:275
1436+#, qt-format
1437+msgid "%1 minute ago"
1438+msgid_plural "%1 minutes ago"
1439+msgstr[0] ""
1440+msgstr[1] ""
1441+
1442+#: Ubuntu/Components/plugin/i18n.cpp:277
1443+#, qt-format
1444+msgid "%1 minute"
1445+msgid_plural "%1 minutes"
1446+msgstr[0] ""
1447+msgstr[1] ""
1448+
1449+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1450+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1451+#: Ubuntu/Components/plugin/i18n.cpp:284
1452+msgid "h:mm ap"
1453+msgstr ""
1454+
1455+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1456+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1457+#: Ubuntu/Components/plugin/i18n.cpp:287
1458+msgid "HH:mm"
1459+msgstr ""
1460+
1461+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1462+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1463+#: Ubuntu/Components/plugin/i18n.cpp:293
1464+msgid "'Yesterday 'h:mm ap"
1465+msgstr ""
1466+
1467+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1468+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1469+#: Ubuntu/Components/plugin/i18n.cpp:296
1470+msgid "'Yesterday 'HH:mm"
1471+msgstr ""
1472+
1473+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1474+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1475+#: Ubuntu/Components/plugin/i18n.cpp:302
1476+msgid "'Tomorrow 'h:mm ap"
1477+msgstr ""
1478+
1479+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1480+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1481+#: Ubuntu/Components/plugin/i18n.cpp:305
1482+msgid "'Tomorrow 'HH:mm"
1483+msgstr ""
1484+
1485+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1486+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1487+#: Ubuntu/Components/plugin/i18n.cpp:312
1488+msgid "ddd' 'h:mm ap"
1489+msgstr ""
1490+
1491+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1492+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1493+#: Ubuntu/Components/plugin/i18n.cpp:315
1494+msgid "ddd' 'HH:mm"
1495+msgstr ""
1496+
1497+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1498+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1499+#: Ubuntu/Components/plugin/i18n.cpp:322
1500+msgid "ddd d MMM' 'h:mm ap"
1501+msgstr ""
1502+
1503+#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
1504+#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
1505+#: Ubuntu/Components/plugin/i18n.cpp:325
1506+msgid "ddd d MMM' 'HH:mm"
1507+msgstr ""
1508+
1509+#: Ubuntu/Components/plugin/privates/listitemdragarea.cpp:122
1510+msgid ""
1511+"ListView has no ViewItems.dragUpdated() signal handler implemented. No "
1512+"dragging will be possible."
1513+msgstr ""
1514+
1515 #: Ubuntu/Components/plugin/statesaverbackend_p.cpp:176
1516 #, qt-format
1517 msgid ""
1518@@ -33,13 +154,13 @@
1519 msgid "property \"%1\" does not exist or is not writable for object %2"
1520 msgstr ""
1521
1522-#: Ubuntu/Components/plugin/ucalarm.cpp:42
1523-#: Ubuntu/Components/plugin/ucalarm.cpp:136
1524+#: Ubuntu/Components/plugin/ucalarm.cpp:41
1525+#: Ubuntu/Components/plugin/ucalarm.cpp:643
1526 msgid "Alarm"
1527 msgstr ""
1528
1529-#: Ubuntu/Components/plugin/ucalarm.cpp:684
1530-#: Ubuntu/Components/plugin/ucalarm.cpp:716
1531+#: Ubuntu/Components/plugin/ucalarm.cpp:635
1532+#: Ubuntu/Components/plugin/ucalarm.cpp:667
1533 msgid "Alarm has a pending operation."
1534 msgstr ""
1535
1536@@ -66,10 +187,28 @@
1537 msgid "%1 is expecting additional arguments: %2"
1538 msgstr ""
1539
1540-#: Ubuntu/Components/plugin/ucmousefilters.cpp:1064
1541+#: Ubuntu/Components/plugin/uclistitemstyle.cpp:145
1542+msgid "consider overriding swipeEvent() slot!"
1543+msgstr ""
1544+
1545+#: Ubuntu/Components/plugin/uclistitemstyle.cpp:165
1546+msgid "consider overriding rebound() slot!"
1547+msgstr ""
1548+
1549+#: Ubuntu/Components/plugin/ucmousefilters.cpp:1065
1550 msgid "Ignoring AfterItem priority for InverseMouse filters."
1551 msgstr ""
1552
1553+#: Ubuntu/Components/plugin/ucserviceproperties.cpp:77
1554+msgid "Changing connection parameters forbidden."
1555+msgstr ""
1556+
1557+#: Ubuntu/Components/plugin/ucserviceproperties.cpp:160
1558+#, qt-format
1559+msgid ""
1560+"Binding detected on property '%1' will be removed by the service updates."
1561+msgstr ""
1562+
1563 #: Ubuntu/Components/plugin/ucstatesaver.cpp:46
1564 msgid "Warning: attachee must have an ID. State will not be saved."
1565 msgstr ""
1566@@ -80,61 +219,63 @@
1567 "Warning: attachee's UUID is already registered, state won't be saved: %1"
1568 msgstr ""
1569
1570-#: Ubuntu/Components/plugin/ucstatesaver.cpp:102
1571+#: Ubuntu/Components/plugin/ucstatesaver.cpp:107
1572 #, qt-format
1573 msgid ""
1574 "All the parents must have an id.\n"
1575 "State saving disabled for %1, class %2"
1576 msgstr ""
1577
1578-#: Ubuntu/Components/plugin/uctheme.cpp:233
1579-msgid "Theme not found: "
1580-msgstr ""
1581-
1582-#: Ubuntu/Components/Popups/ComposerSheet.qml:80
1583+#: Ubuntu/Components/plugin/uctheme.cpp:208
1584+#, qt-format
1585+msgid "Theme not found: \"%1\""
1586+msgstr ""
1587+
1588+#: Ubuntu/Components/plugin/uctheme.cpp:539
1589+msgid "Not a Palette component."
1590+msgstr ""
1591+
1592+#: Ubuntu/Components/plugin/ucviewitemsattached.cpp:462
1593+msgid "Dragging mode requires ListView"
1594+msgstr ""
1595+
1596+#: Ubuntu/Components/plugin/ucviewitemsattached.cpp:468
1597+msgid ""
1598+"Dragging is only supported when using a QAbstractItemModel, ListModel or "
1599+"list."
1600+msgstr ""
1601+
1602+#: Ubuntu/Components/Popups/1.2/ComposerSheet.qml:78
1603+#: Ubuntu/Components/Popups/1.3/ComposerSheet.qml:78
1604 msgid "Cancel"
1605 msgstr ""
1606
1607-#: Ubuntu/Components/Popups/ComposerSheet.qml:90
1608+#: Ubuntu/Components/Popups/1.2/ComposerSheet.qml:88
1609+#: Ubuntu/Components/Popups/1.3/ComposerSheet.qml:88
1610 msgid "Confirm"
1611 msgstr ""
1612
1613-#: Ubuntu/Components/Popups/DefaultSheet.qml:89
1614+#: Ubuntu/Components/Popups/1.2/DefaultSheet.qml:85
1615+#: Ubuntu/Components/Popups/1.3/DefaultSheet.qml:85
1616 msgid "Close"
1617 msgstr ""
1618
1619-#: Ubuntu/Components/Popups/DefaultSheet.qml:99
1620+#: Ubuntu/Components/Popups/1.2/DefaultSheet.qml:95
1621+#: Ubuntu/Components/Popups/1.3/DefaultSheet.qml:95
1622 msgid "Done"
1623 msgstr ""
1624
1625-#: Ubuntu/Components/TextInputPopover.qml:27
1626-msgid "Select All"
1627-msgstr ""
1628-
1629-#: Ubuntu/Components/TextInputPopover.qml:33
1630-msgid "Cut"
1631-msgstr ""
1632-
1633-#: Ubuntu/Components/TextInputPopover.qml:42
1634-msgid "Copy"
1635-msgstr ""
1636-
1637-#: Ubuntu/Components/TextInputPopover.qml:49
1638-msgid "Paste"
1639-msgstr ""
1640-
1641-#: Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml:57
1642+#: Ubuntu/Components/Themes/Ambiance/1.2/ProgressBarStyle.qml:51
1643+#: Ubuntu/Components/Themes/Ambiance/1.3/ProgressBarStyle.qml:50
1644 msgid "In Progress"
1645 msgstr ""
1646
1647-#: Ubuntu/Components/Themes/Ambiance/PullToRefreshStyle.qml:28
1648+#: Ubuntu/Components/Themes/Ambiance/1.2/PullToRefreshStyle.qml:28
1649+#: Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml:28
1650 msgid "Release to refresh..."
1651 msgstr ""
1652
1653-#: Ubuntu/Components/Themes/Ambiance/PullToRefreshStyle.qml:28
1654+#: Ubuntu/Components/Themes/Ambiance/1.2/PullToRefreshStyle.qml:28
1655+#: Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml:28
1656 msgid "Pull to refresh..."
1657 msgstr ""
1658-
1659-#: Ubuntu/Components/ToolbarItems.qml:142
1660-msgid "Back"
1661-msgstr ""
1662
1663=== modified file 'src/Ubuntu/Components/1.2/MainViewBase.qml'
1664--- src/Ubuntu/Components/1.2/MainViewBase.qml 2015-04-30 08:32:44 +0000
1665+++ src/Ubuntu/Components/1.2/MainViewBase.qml 2015-11-17 15:49:37 +0000
1666@@ -48,12 +48,12 @@
1667
1668 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
1669 */
1670- property string theme: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
1671+ property string themeName: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
1672 "Ambiance" : "SuruDark"
1673- onThemeChanged: {
1674+ onThemeNameChanged: {
1675 // only change the theme if the current one is a system one.
1676- if (theme !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
1677- Theme.name = "Ubuntu.Components.Themes.%1".arg(theme);
1678+ if (themeName !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
1679+ Theme.name = "Ubuntu.Components.Themes.%1".arg(themeName);
1680 }
1681 }
1682 }
1683
1684=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
1685--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-10-14 15:44:15 +0000
1686+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-11-17 15:49:37 +0000
1687@@ -166,6 +166,11 @@
1688 and the preferred width is set to 40 grid units. This width is set every time
1689 the layout is activated.
1690
1691+ When a \l Page with the \l Page::header property set is added to an
1692+ AdaptivePageLayout, the AdaptivePageLayout will synchronize the height of that
1693+ header with the height of the headers in other columns, i.e., the height of
1694+ each of the headers will be set to the maximum implicitHeight of all the headers.
1695+
1696 \sa PageStack, PageColumnsLayout, PageColumn
1697 */
1698
1699@@ -452,7 +457,17 @@
1700 // replace page holder's child
1701 var holder = body.children[targetColumn];
1702 holder.detachCurrentPage();
1703- holder.attachPage(pageWrapper);
1704+ holder.attachPage(pageWrapper); // sets pageWrapper.pageHolder
1705+
1706+ // set the back action for Page.header:
1707+ var page = pageWrapper.object;
1708+ if (page && page.hasOwnProperty("header") && page.header &&
1709+ page.header.hasOwnProperty("navigationActions")) {
1710+ // Page.header is an instance of PageHeader.
1711+ var backAction = backActionComponent.createObject(
1712+ pageWrapper, { 'wrapper': pageWrapper } );
1713+ page.header.navigationActions = [ backAction ] ;
1714+ }
1715 }
1716
1717 function getWrapper(page) {
1718@@ -644,6 +659,42 @@
1719 }
1720 }
1721
1722+ // An instance will be added to each Page with
1723+ Component {
1724+ id: backActionComponent
1725+
1726+ Action {
1727+ // used when the Page has a Page.header property set.
1728+ id: backAction
1729+ objectName: "apl_back_action"
1730+ iconName: "back"
1731+ text: "Back"
1732+
1733+ // set when backAction is created.
1734+ property PageWrapper wrapper
1735+ onTriggered: layout.removePages(wrapper.object)
1736+
1737+ visible: {
1738+ var parentWrapper;
1739+ try {
1740+ parentWrapper = d.tree.parent(wrapper);
1741+ } catch(err) {
1742+ // Root node has no parent node.
1743+ return false;
1744+ }
1745+ if (!wrapper.pageHolder) {
1746+ // columns are being re-arranged.
1747+ return false;
1748+ }
1749+ // wrapper.column is the virtual column, pageHolder.column the actual column.
1750+ var column = wrapper.pageHolder.column;
1751+ var nextInColumn = d.tree.top(column, column < d.columns - 1, 1);
1752+ return parentWrapper === nextInColumn;
1753+ }
1754+ }
1755+ }
1756+
1757+
1758 // Page holder component, can have only one Page as child at a time, all stacked pages
1759 // will be parented into hiddenPool
1760 Component {
1761@@ -670,6 +721,15 @@
1762 property var page: pageWrapper ? pageWrapper.object : null
1763 property bool customHeader: page && page.hasOwnProperty("header") &&
1764 page.header
1765+ onPageChanged: body.updateHeaderHeight(0)
1766+ Connections {
1767+ target: page
1768+ onHeaderChanged: body.updateHeaderHeight(0)
1769+ }
1770+ Connections {
1771+ target: page ? page.header : null
1772+ onImplicitHeightChanged: body.updateHeaderHeight(page.header.implicitHeight)
1773+ }
1774
1775 // prevent the pages from taking the app header height into account.
1776 __propagated: null
1777@@ -692,6 +752,8 @@
1778 }
1779 }
1780
1781+ // subHeader is to be deprecated in UITK 1.4 and will be replaced
1782+ // by the Page.header property (introduced in 1.3).
1783 property alias head: subHeader
1784 StyledItem {
1785 id: subHeader
1786@@ -703,7 +765,6 @@
1787 height: body.headerHeight
1788
1789 styleName: "PageHeadStyle"
1790- theme.version: Ubuntu.toolkitVersion
1791 objectName: "Header" + column
1792
1793 property real preferredHeight: subHeader.__styleInstance ?
1794@@ -795,8 +856,8 @@
1795 onXChanged: holder.Layout.preferredWidth = x
1796 }
1797
1798- function attachPage(page) {
1799- pageWrapper = page;
1800+ function attachPage(wrapper) {
1801+ pageWrapper = wrapper;
1802 pageWrapper.parent = holderBody;
1803 pageWrapper.pageHolder = holder;
1804 pageWrapper.active = true;
1805@@ -854,17 +915,32 @@
1806 property real headerHeight: 0
1807
1808 function updateHeaderHeight(newHeight) {
1809+ var page;
1810+ var i;
1811 if (newHeight > body.headerHeight) {
1812 body.headerHeight = newHeight;
1813 } else {
1814 var h = 0;
1815 var subHeight = 0;
1816- for (var i = 0; i < children.length; i++) {
1817- subHeight = children[i].head.preferredHeight;
1818+ for (i = 0; i < children.length; i++) {
1819+ page = children[i].page;
1820+ if (page && page.hasOwnProperty("header") && page.header) {
1821+ subHeight = page.header.implicitHeight;
1822+ } else {
1823+ subHeight = children[i].head.preferredHeight;
1824+ }
1825 if (subHeight > h) h = subHeight;
1826 }
1827 body.headerHeight = h;
1828 }
1829+
1830+ // Update all the Page.header heights.
1831+ for (i = 0; i < body.children.length; i++) {
1832+ page = body.children[i].page;
1833+ if (page && page.hasOwnProperty("header") && page.header) {
1834+ page.header.height = headerHeight;
1835+ }
1836+ }
1837 }
1838
1839 onChildrenChanged: {
1840
1841=== modified file 'src/Ubuntu/Components/1.3/AnimatedItem.qml'
1842--- src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-04-25 08:54:58 +0000
1843+++ src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-11-17 15:49:37 +0000
1844@@ -25,14 +25,13 @@
1845 */
1846
1847 import QtQuick 2.4
1848-import Ubuntu.Components 1.3 as Toolkit
1849+import Ubuntu.Components 1.3
1850
1851-Toolkit.StyledItem {
1852+StyledItem {
1853 id: root
1854 /*!
1855 \deprecated
1856 Specifies whether the component is on the visible area of the Flickable or not.
1857 */
1858- theme.version: Toolkit.Ubuntu.toolkitVersion
1859 property bool onScreen: true
1860 }
1861
1862=== modified file 'src/Ubuntu/Components/1.3/AppHeader.qml'
1863--- src/Ubuntu/Components/1.3/AppHeader.qml 2015-10-01 21:23:04 +0000
1864+++ src/Ubuntu/Components/1.3/AppHeader.qml 2015-11-17 15:49:37 +0000
1865@@ -151,6 +151,5 @@
1866 }
1867 }
1868
1869- theme.version: Components.Ubuntu.toolkitVersion
1870 styleName: "PageHeadStyle"
1871 }
1872
1873=== removed file 'src/Ubuntu/Components/1.3/BottomEdgeHint.qml'
1874--- src/Ubuntu/Components/1.3/BottomEdgeHint.qml 2015-09-21 14:44:13 +0000
1875+++ src/Ubuntu/Components/1.3/BottomEdgeHint.qml 1970-01-01 00:00:00 +0000
1876@@ -1,155 +0,0 @@
1877-/*
1878- * Copyright 2015 Canonical Ltd.
1879- *
1880- * This program is free software; you can redistribute it and/or modify
1881- * it under the terms of the GNU Lesser General Public License as published by
1882- * the Free Software Foundation; version 3.
1883- *
1884- * This program is distributed in the hope that it will be useful,
1885- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1886- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1887- * GNU Lesser General Public License for more details.
1888- *
1889- * You should have received a copy of the GNU Lesser General Public License
1890- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1891- */
1892-
1893-import QtQuick 2.4
1894-import Ubuntu.Components 1.3
1895-
1896-/*!
1897- \qmlabstract BottomEdgeHint
1898- \inqmlmodule Ubuntu.Components 1.3
1899- \ingroup ubuntu
1900- \brief The BottomEdgeHint shows the availability of extra features
1901- available from the bottom edge of the application.
1902-
1903- It displays either a label or an icon at the bottom of the application.
1904-
1905- It has 2 states: hidden or visible. When hidden, part of it is still visible
1906- to hint at the existence of the bottom edge.
1907-
1908- When used with a mouse it acts like a button. The typical action associated
1909- with clicking on it should be revealing the extra features provided by the
1910- bottom edge.
1911-
1912- Example:
1913- \qml
1914- BottomEdgeHint {
1915- id: bottomEdgeHint
1916- text: i18n.tr("Favorites")
1917- onClicked: revealBottomEdge()
1918- }
1919- \endqml
1920-
1921-*/
1922-Item {
1923- id: bottomEdgeHint
1924-
1925- anchors {
1926- bottom: parent.bottom
1927- bottomMargin: bottomEdgeHint.state == "Hidden" ? -bottomEdgeHint.height + units.gu(1.5) : 0
1928- horizontalCenter: parent.horizontalCenter
1929- Behavior on bottomMargin { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1930- }
1931-
1932- width: label.paintedWidth + units.gu(7)
1933- height: units.gu(4)
1934-
1935- /*!
1936- This handler is called when there is a mouse click on the BottomEdgeHint
1937- and the BottomEdgeHint is not disabled.
1938- */
1939- signal clicked()
1940-
1941- Keys.onEnterPressed: clicked()
1942- Keys.onReturnPressed: clicked()
1943-
1944- /*!
1945- The label displayed by the BottomEdgeHint.
1946- */
1947- property string text
1948-
1949- /*!
1950- The icon displayed by the BottomEdgeHint.
1951-
1952- This is the URL of any image file.
1953- If both iconSource and iconName are defined, iconName will be ignored.
1954- */
1955- property url iconSource: iconName ? "image://theme/" + iconName : ""
1956-
1957- /*!
1958- The icon associated with the BottomEdgeHint in the icon theme.
1959-
1960- If both iconSource and iconName are defined, iconName will be ignored.
1961- */
1962- property string iconName
1963-
1964- /*!
1965- BottomEdgeHint can take 2 states of visibility: "Hidden" and "Visible".
1966-
1967- When "Visible", the full hint with its content is shown.
1968-
1969- When "Hidden", only part of the hint is visible leaving more space for application content.
1970- */
1971- property string state: "Visible"
1972-
1973- MouseArea {
1974- id: mouseArea
1975- anchors.fill: parent
1976- hoverEnabled: true
1977- onEntered: bottomEdgeHint.state = "Visible"
1978- onClicked: {
1979- Haptics.play();
1980- bottomEdgeHint.clicked();
1981- mouse.accepted = false;
1982- }
1983- }
1984-
1985- clip: true
1986-
1987- UbuntuShape {
1988- id: background
1989-
1990- anchors {
1991- bottom: parent.bottom
1992- horizontalCenter: bottomEdgeHint.horizontalCenter
1993- bottomMargin: -units.gu(1)
1994- }
1995-
1996- width: bottomEdgeHint.width - 2 * hoverExpansion
1997- height: bottomEdgeHint.height + units.gu(1) - hoverExpansion
1998-
1999- property real hoverExpansion: mouseArea.containsMouse ? 0 : units.gu(0.5)
2000- Behavior on hoverExpansion { UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } }
2001-
2002- backgroundColor: theme.palette.normal.overlay
2003- }
2004-
2005- Label {
2006- id: label
2007-
2008- anchors {
2009- top: parent.top
2010- horizontalCenter: parent.horizontalCenter
2011- }
2012- text: icon.name ? "" : bottomEdgeHint.text
2013- textSize: Label.Medium
2014- height: bottomEdgeHint.height
2015- verticalAlignment: Text.AlignVCenter
2016- horizontalAlignment: Text.AlignHCenter
2017- }
2018-
2019- Icon {
2020- id: icon
2021-
2022- name: bottomEdgeHint.iconName
2023- anchors {
2024- bottom: parent.bottom
2025- bottomMargin: units.gu(0.5)
2026- horizontalCenter: parent.horizontalCenter
2027- }
2028- width: height
2029- height: units.gu(2)
2030- }
2031-}
2032
2033=== modified file 'src/Ubuntu/Components/1.3/Button.qml'
2034--- src/Ubuntu/Components/1.3/Button.qml 2015-08-20 06:56:44 +0000
2035+++ src/Ubuntu/Components/1.3/Button.qml 2015-11-17 15:49:37 +0000
2036@@ -121,6 +121,5 @@
2037 */
2038 property string iconPosition: "left"
2039
2040- theme.version: Ubuntu.toolkitVersion
2041 styleName: "ButtonStyle"
2042 }
2043
2044=== modified file 'src/Ubuntu/Components/1.3/CheckBox.qml'
2045--- src/Ubuntu/Components/1.3/CheckBox.qml 2015-09-16 16:58:51 +0000
2046+++ src/Ubuntu/Components/1.3/CheckBox.qml 2015-11-17 15:49:37 +0000
2047@@ -49,6 +49,5 @@
2048 */
2049 onTriggered: checked = !checked
2050
2051- theme.version: Ubuntu.toolkitVersion
2052 styleName: "CheckBoxStyle"
2053 }
2054
2055=== modified file 'src/Ubuntu/Components/1.3/OptionSelector.qml'
2056--- src/Ubuntu/Components/1.3/OptionSelector.qml 2015-09-07 10:05:58 +0000
2057+++ src/Ubuntu/Components/1.3/OptionSelector.qml 2015-11-17 15:49:37 +0000
2058@@ -225,7 +225,6 @@
2059 right: parent.right
2060 }
2061 state: optionSelector.expanded ? "expanded" : "collapsed"
2062- theme.version: Toolkit.Ubuntu.toolkitVersion
2063 styleName: "OptionSelectorStyle"
2064 states: [ State {
2065 name: "expanded"
2066
2067=== removed file 'src/Ubuntu/Components/1.3/Page.qdoc'
2068--- src/Ubuntu/Components/1.3/Page.qdoc 2015-04-25 08:54:58 +0000
2069+++ src/Ubuntu/Components/1.3/Page.qdoc 1970-01-01 00:00:00 +0000
2070@@ -1,132 +0,0 @@
2071-/*
2072- * Copyright 2014 Canonical Ltd.
2073- *
2074- * This program is free software; you can redistribute it and/or modify
2075- * it under the terms of the GNU Lesser General Public License as published by
2076- * the Free Software Foundation; version 3.
2077- *
2078- * This program is distributed in the hope that it will be useful,
2079- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2080- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2081- * GNU Lesser General Public License for more details.
2082- *
2083- * You should have received a copy of the GNU Lesser General Public License
2084- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2085- */
2086-
2087-/*!
2088- \qmltype Page
2089- \inqmlmodule Ubuntu.Components 1.1
2090- \ingroup ubuntu
2091- \brief A page is the basic Item that must be used inside the \l MainView,
2092- \l PageStack and \l Tabs.
2093- Anchors and height of a Page are automatically determined to align with
2094- the header of the \l MainView, but can be overridden.
2095-
2096- \l MainView provides a header for Pages it includes.
2097- The text and actions of the header are determined by the \l title
2098- and \l head properties of the page:
2099-
2100- \qml
2101- import QtQuick 2.4
2102- import Ubuntu.Components 1.2
2103-
2104- MainView {
2105- width: units.gu(48)
2106- height: units.gu(60)
2107-
2108- Page {
2109- title: i18n.tr("Example page")
2110-
2111- Label {
2112- anchors.centerIn: parent
2113- text: i18n.tr("Hello world!")
2114- }
2115-
2116- head.actions: [
2117- Action {
2118- iconName: "search"
2119- text: i18n.tr("Search")
2120- },
2121- Action {
2122- iconName: "contacts"
2123- text: i18n.tr("Contacts")
2124- }
2125- ]
2126- }
2127- }
2128- \endqml
2129- See \l MainView for more examples on how to use the header.
2130- Advanced navigation structures can be created by adding Pages to a \l PageStack or \l Tabs.
2131-
2132- The Page automatically anchors to the left and bottom of its parent. The width of the Page
2133- will be the full width of its parent \l MainView or \l PageStack or \l Tab,
2134- and the height will adapt to leave space for the header when needed. It is possible to
2135- use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
2136- so that the Page can control its width and height.
2137-*/
2138-
2139-/*!
2140- \qmlproperty string Page::title
2141- The title of the page. Will be shown in the header of the \l MainView.
2142- If the page is used inside a \l Tab, the default title is the \l Tab title.
2143- For a Page not inside a \l Tab, the default title is an empty string.
2144- */
2145-
2146-/*!
2147- \qmlproperty Item Page::tools
2148- \deprecated
2149- The toolbar items associated with this Page.
2150- DEPRECATED. Use \b head.actions instead.
2151- */
2152-
2153-/*!
2154- \qmlproperty PageHeadConfiguration Page::head
2155- \readonly
2156- Configuration of the header for this page.
2157- */
2158-
2159-/*!
2160- \qmlproperty Flickable Page::flickable
2161- Optional flickable that controls the header. This property
2162- is automatically set to the first child of the page that is Flickable
2163- and anchors to the top of the page or fills the page. For example:
2164- \qml
2165- import QtQuick 2.4
2166- import Ubuntu.Components 1.2
2167-
2168- MainView {
2169- width: units.gu(30)
2170- height: units.gu(50)
2171- Page {
2172- id: page
2173- title: "example"
2174- //flickable: null // uncomment for a fixed header
2175- Flickable {
2176- id: content
2177- anchors.fill: parent
2178- contentHeight: units.gu(70)
2179- Label {
2180- text: "hello"
2181- anchors.centerIn: parent
2182- }
2183- }
2184- }
2185- }
2186- \endqml
2187- In this example, page.flickable will automatically be set to content because it is
2188- a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
2189- hide the header.
2190-
2191- Set this property to null to avoid automatic flickable detection, which disables hiding
2192- of the header by scrolling in the Flickable. In cases where a flickable should control the header,
2193- but it is not automatically detected, the flickable property can be set.
2194- */
2195-
2196-/*!
2197- \qmlproperty list<Action> Page::actions
2198- Local actions. These actions will be made available outside the application
2199- (for example, to HUD) when the Page is active. For actions that are always available
2200- when the application is running, use the actions property of \l MainView.
2201- For actions in the header, see \l head.
2202-*/
2203
2204=== modified file 'src/Ubuntu/Components/1.3/Page.qml'
2205--- src/Ubuntu/Components/1.3/Page.qml 2015-10-15 10:07:59 +0000
2206+++ src/Ubuntu/Components/1.3/Page.qml 2015-11-17 15:49:37 +0000
2207@@ -19,8 +19,55 @@
2208 import "pageUtils.js" as Utils
2209
2210 /*!
2211- \internal
2212- Documentation is in Page.qdoc
2213+ \qmltype Page
2214+ \inqmlmodule Ubuntu.Components 1.1
2215+ \ingroup ubuntu
2216+ \brief A page is the basic Item that must be used inside the \l MainView,
2217+ \l PageStack and \l Tabs.
2218+ Anchors and height of a Page are automatically determined to align with
2219+ the header of the \l MainView, but can be overridden.
2220+
2221+
2222+ \l MainView provides a header for Pages it includes if no
2223+ \l header property was set.
2224+ The text and actions of the header are determined by the \l title
2225+ and \l head properties of the page:
2226+
2227+ \qml
2228+ import QtQuick 2.4
2229+ import Ubuntu.Components 1.2
2230+
2231+ MainView {
2232+ width: units.gu(48)
2233+ height: units.gu(60)
2234+
2235+ Page {
2236+ title: i18n.tr("Example page")
2237+
2238+ Label {
2239+ anchors.centerIn: parent
2240+ text: i18n.tr("Hello world!")
2241+ }
2242+
2243+ head.actions: [
2244+ Action {
2245+ iconName: "search"
2246+ text: i18n.tr("Search")
2247+ },
2248+ Action {
2249+ iconName: "contacts"
2250+ text: i18n.tr("Contacts")
2251+ }
2252+ ]
2253+ }
2254+ }
2255+ \endqml
2256+
2257+ The Page automatically anchors to the left and bottom of its parent. The width of the Page
2258+ will be the full width of its parent \l MainView or \l PageStack or \l Tab,
2259+ and the height will adapt to leave space for the header when needed. It is possible to
2260+ use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
2261+ so that the Page can control its width and height.
2262 */
2263 PageTreeNode {
2264 id: page
2265@@ -35,13 +82,13 @@
2266
2267 /*!
2268 The header property for this page. Setting this property will reparent the
2269- header to the page and disable the \l Mainview's application header.
2270+ header to the page and disable the \l MainView's application header.
2271 \qml
2272 Page {
2273 id: page
2274 title: "Page with header"
2275 header: PageHeader {
2276- title: page.header
2277+ title: page.title
2278 trailingActionBar.actions: [
2279 Action { iconName: "settings" },
2280 Action { iconName: "info" }
2281@@ -49,17 +96,65 @@
2282 }
2283 }
2284 \endqml
2285+ \sa PageHeader
2286 */
2287 property Item header
2288 onHeaderChanged: internal.updateHeader()
2289 Component.onCompleted: internal.updateHeader()
2290
2291+ /*! \internal */
2292 isLeaf: true
2293+
2294+ /*!
2295+ The title of the page. Will be shown in the header of the \l MainView.
2296+ If the page is used inside a \l Tab, the default title is the \l Tab title.
2297+ For a Page not inside a \l Tab, the default title is an empty string.
2298+ */
2299 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""
2300+
2301+ /*!
2302+ Optional flickable that controls the MainView header. This property
2303+ is automatically set to the first child of the page that is Flickable
2304+ and anchors to the top of the page or fills the page. For example:
2305+ \qml
2306+ import QtQuick 2.4
2307+ import Ubuntu.Components 1.2
2308+
2309+ MainView {
2310+ width: units.gu(30)
2311+ height: units.gu(50)
2312+ Page {
2313+ id: page
2314+ title: "example"
2315+ //flickable: null // uncomment for a fixed header
2316+ Flickable {
2317+ id: content
2318+ anchors.fill: parent
2319+ contentHeight: units.gu(70)
2320+ Label {
2321+ text: "hello"
2322+ anchors.centerIn: parent
2323+ }
2324+ }
2325+ }
2326+ }
2327+ \endqml
2328+ In this example, page.flickable will automatically be set to content because it is
2329+ a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
2330+ hide the header.
2331+
2332+ Set this property to null to avoid automatic flickable detection, which disables hiding
2333+ of the header by scrolling in the Flickable. In cases where a flickable should control the header,
2334+ but it is not automatically detected, the flickable property can be set.
2335+ */
2336 property Flickable flickable: Utils.getFlickableChild(page)
2337
2338 /*!
2339- \qmlproperty PageHeadConfiguration head
2340+ \qmlproperty PageHeadConfiguration Page::head
2341+ \readonly
2342+ \deprecated
2343+ Configuration of the header for this page.
2344+ Deprecated: This configuration will be replaced by setting the \l header property.
2345 */
2346 readonly property alias head: headerConfig
2347 Toolkit13.PageHeadConfiguration {
2348
2349=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
2350--- src/Ubuntu/Components/1.3/PageHeader.qml 2015-10-15 14:17:25 +0000
2351+++ src/Ubuntu/Components/1.3/PageHeader.qml 2015-11-17 15:49:37 +0000
2352@@ -40,8 +40,8 @@
2353 Header {
2354 id: header
2355 anchors {
2356- left: parent.left
2357- right: parent.right
2358+ left: parent ? parent.left : undefined
2359+ right: parent ? parent.right : undefined
2360 }
2361
2362 /*!
2363@@ -109,9 +109,25 @@
2364 titleLoader.sourceComponent = __styleInstance.titleComponent;
2365 }
2366 }
2367+
2368+ // When the style changes, make sure that the titleLoader loads
2369+ // the new titleComponent.
2370+ property Item styleInstance: __styleInstance
2371+ onStyleInstanceChanged: updateContents()
2372 }
2373
2374 /*!
2375+ The actions to be shown in the leading action bar.
2376+ This property is automatically set by the
2377+ \l AdaptivePageLayout and other navigation components to configure the
2378+ back action for the \l Page.
2379+ Application developers should not set this property, because the
2380+ value may be overridden by Ubuntu components that have navigation.
2381+ Instead, set \l leadingActionBar's actions property.
2382+ */
2383+ property list<Action> navigationActions
2384+
2385+ /*!
2386 \qmlproperty ActionBar leadingActionBar
2387 The \l ActionBar for the leading navigation actions.
2388 Example:
2389@@ -125,6 +141,9 @@
2390 ]
2391 }
2392 \endqml
2393+ The default value of \l leadingActionBar actions is
2394+ \l navigationActions, but that value can be changed to show
2395+ different actions in front of the title.
2396 See \l ActionBar.
2397 */
2398 readonly property alias leadingActionBar: leading
2399@@ -138,7 +157,8 @@
2400 height: header.__styleInstance.contentHeight
2401 numberOfSlots: 1
2402 delegate: header.__styleInstance.defaultActionDelegate
2403- visible: actions.length > 0
2404+ actions: header.navigationActions
2405+ visible: leading.width > 0 // at least 1 visible action
2406 StyleHints {
2407 overflowIconName: "navigation-menu"
2408 }
2409@@ -182,7 +202,7 @@
2410 height: header.__styleInstance.contentHeight
2411 numberOfSlots: 3
2412 delegate: header.__styleInstance.defaultActionDelegate
2413- visible: actions.length > 0
2414+ visible: trailing.width > 0 // at least 1 visible action
2415 }
2416
2417 /*!
2418@@ -203,6 +223,5 @@
2419 height: visible ? implicitHeight : 0
2420 }
2421
2422- theme.version: Ubuntu.toolkitVersion
2423 styleName: "PageHeaderStyle"
2424 }
2425
2426=== modified file 'src/Ubuntu/Components/1.3/PageStack.qml'
2427--- src/Ubuntu/Components/1.3/PageStack.qml 2015-07-10 07:42:38 +0000
2428+++ src/Ubuntu/Components/1.3/PageStack.qml 2015-11-17 15:49:37 +0000
2429@@ -16,6 +16,7 @@
2430
2431 import QtQuick 2.4
2432 import "../1.2/stack.js" as Stack
2433+import Ubuntu.Components 1.3
2434
2435 /*!
2436 \qmltype PageStack
2437@@ -171,6 +172,13 @@
2438 } else {
2439 internal.pushWrapperObject();
2440 }
2441+ // set the back action for Page.header:
2442+ if (pageObject && pageObject.hasOwnProperty("header") && pageObject.header &&
2443+ pageObject.header.hasOwnProperty("navigationActions")) {
2444+ // Page.header is an instance of PageHeader.
2445+ pageObject.header.navigationActions = [ backAction ];
2446+ }
2447+
2448 return pageObject;
2449 }
2450
2451@@ -206,6 +214,16 @@
2452 internal.stackUpdated();
2453 }
2454
2455+ Action {
2456+ // used when the Page has a Page.header property set.
2457+ id: backAction
2458+ visible: pageStack.depth > 0
2459+ iconName: "back"
2460+ text: "Back"
2461+ onTriggered: pageStack.pop()
2462+ objectName: "pagestack_back_action"
2463+ }
2464+
2465 QtObject {
2466 id: internal
2467 property Item headStyle: (pageStack.__propagated
2468
2469=== modified file 'src/Ubuntu/Components/1.3/PageTreeNode.qml'
2470--- src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-10-14 19:18:58 +0000
2471+++ src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-11-17 15:49:37 +0000
2472@@ -148,6 +148,4 @@
2473 node.parentNode = internal.getParentPageTreeNode(node);
2474 }
2475 }
2476-
2477- theme.version: Toolkit.Ubuntu.toolkitVersion
2478 }
2479
2480=== modified file 'src/Ubuntu/Components/1.3/PageWrapper.qml'
2481--- src/Ubuntu/Components/1.3/PageWrapper.qml 2015-09-24 15:28:58 +0000
2482+++ src/Ubuntu/Components/1.3/PageWrapper.qml 2015-11-17 15:49:37 +0000
2483@@ -46,7 +46,7 @@
2484 property bool canDestroy: false
2485
2486 /*!
2487- Column number in MultiColumnView.
2488+ Column number in AdaptivePageLayout.
2489 */
2490 property int column: 0
2491
2492@@ -61,7 +61,7 @@
2493 property Item parentWrapper
2494
2495 /*!
2496- Page holder in MultiColumnView
2497+ Page holder in AdaptivePageLayout.
2498 */
2499 property Item pageHolder
2500
2501
2502=== modified file 'src/Ubuntu/Components/1.3/ProgressBar.qml'
2503--- src/Ubuntu/Components/1.3/ProgressBar.qml 2015-05-21 10:50:35 +0000
2504+++ src/Ubuntu/Components/1.3/ProgressBar.qml 2015-11-17 15:49:37 +0000
2505@@ -70,6 +70,5 @@
2506 */
2507 property bool showProgressPercentage: true
2508
2509- theme.version: Ubuntu.toolkitVersion
2510 styleName: "ProgressBarStyle"
2511 }
2512
2513=== modified file 'src/Ubuntu/Components/1.3/PullToRefresh.qml'
2514--- src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-05-21 10:50:35 +0000
2515+++ src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-11-17 15:49:37 +0000
2516@@ -222,7 +222,6 @@
2517 */
2518 signal refresh()
2519
2520- theme.version: Ubuntu.toolkitVersion
2521 styleName: "PullToRefreshStyle"
2522 implicitHeight: __styleInstance.implicitHeight
2523 anchors {
2524
2525=== modified file 'src/Ubuntu/Components/1.3/Scrollbar.qml'
2526--- src/Ubuntu/Components/1.3/Scrollbar.qml 2015-05-21 10:50:35 +0000
2527+++ src/Ubuntu/Components/1.3/Scrollbar.qml 2015-11-17 15:49:37 +0000
2528@@ -146,6 +146,5 @@
2529 }
2530 }
2531
2532- theme.version: Toolkit.Ubuntu.toolkitVersion
2533 styleName: "ScrollbarStyle"
2534 }
2535
2536=== modified file 'src/Ubuntu/Components/1.3/Sections.qml'
2537--- src/Ubuntu/Components/1.3/Sections.qml 2015-07-14 12:49:58 +0000
2538+++ src/Ubuntu/Components/1.3/Sections.qml 2015-11-17 15:49:37 +0000
2539@@ -29,7 +29,6 @@
2540 StyledItem {
2541 id: sections
2542 styleName: "SectionsStyle"
2543- theme.version: Ubuntu.toolkitVersion
2544
2545 /*!
2546 List of actions that represent the sections.
2547
2548=== modified file 'src/Ubuntu/Components/1.3/Slider.qml'
2549--- src/Ubuntu/Components/1.3/Slider.qml 2015-05-21 10:50:35 +0000
2550+++ src/Ubuntu/Components/1.3/Slider.qml 2015-11-17 15:49:37 +0000
2551@@ -206,6 +206,5 @@
2552 onLiveValueChanged: if (isPressed) slider.requestFocus(Qt.MouseFocusReason)
2553 }
2554
2555- theme.version: Toolkit.Ubuntu.toolkitVersion
2556 styleName: "SliderStyle"
2557 }
2558
2559=== modified file 'src/Ubuntu/Components/1.3/TabBar.qml'
2560--- src/Ubuntu/Components/1.3/TabBar.qml 2015-05-21 10:50:35 +0000
2561+++ src/Ubuntu/Components/1.3/TabBar.qml 2015-11-17 15:49:37 +0000
2562@@ -97,7 +97,6 @@
2563
2564 implicitHeight: units.gu(7.5)
2565 activeFocusOnPress: true
2566- theme.version: Toolkit.Ubuntu.toolkitVersion
2567 styleName: "TabBarStyle"
2568
2569 QtObject {
2570
2571=== modified file 'src/Ubuntu/Components/1.3/TextArea.qml'
2572--- src/Ubuntu/Components/1.3/TextArea.qml 2015-09-07 10:05:58 +0000
2573+++ src/Ubuntu/Components/1.3/TextArea.qml 2015-11-17 15:49:37 +0000
2574@@ -886,6 +886,5 @@
2575 }
2576 }
2577
2578- theme.version: Ubuntu.Ubuntu.toolkitVersion
2579 styleName: "TextAreaStyle"
2580 }
2581
2582=== modified file 'src/Ubuntu/Components/1.3/TextCursor.qml'
2583--- src/Ubuntu/Components/1.3/TextCursor.qml 2015-10-30 13:38:52 +0000
2584+++ src/Ubuntu/Components/1.3/TextCursor.qml 2015-11-17 15:49:37 +0000
2585@@ -41,7 +41,6 @@
2586 handler.main.cursorDelegate :
2587 __styleInstance.cursorDelegate
2588
2589- theme.version: Ubuntu.Ubuntu.toolkitVersion
2590 styleName: "TextCursorStyle"
2591
2592 objectName: "textCursor"
2593
2594=== modified file 'src/Ubuntu/Components/1.3/TextField.qml'
2595--- src/Ubuntu/Components/1.3/TextField.qml 2015-09-07 10:05:58 +0000
2596+++ src/Ubuntu/Components/1.3/TextField.qml 2015-11-17 15:49:37 +0000
2597@@ -1013,6 +1013,5 @@
2598 cursorPosition = 0;
2599 }
2600
2601- theme.version: Ubuntu.Ubuntu.toolkitVersion
2602 styleName: "TextFieldStyle"
2603 }
2604
2605=== modified file 'src/Ubuntu/Components/1.3/TextInputPopover.qml'
2606--- src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-09-16 05:28:29 +0000
2607+++ src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-11-17 15:49:37 +0000
2608@@ -86,7 +86,6 @@
2609 width: Math.max(units.gu(5), implicitWidth) + units.gu(2)
2610 height: units.gu(6)
2611 action: actions[modelData]
2612- theme.version: Ubuntu.toolkitVersion
2613 styleName: "ToolbarButtonStyle"
2614 }
2615 }
2616
2617=== modified file 'src/Ubuntu/Components/1.3/Toolbar.qml'
2618--- src/Ubuntu/Components/1.3/Toolbar.qml 2015-05-21 10:50:35 +0000
2619+++ src/Ubuntu/Components/1.3/Toolbar.qml 2015-11-17 15:49:37 +0000
2620@@ -135,7 +135,6 @@
2621 property bool opened: toolbar.opened
2622 property bool animating: toolbar.animating
2623
2624- theme.version: Toolkit.Ubuntu.toolkitVersion
2625 styleName: "ToolbarStyle"
2626 }
2627
2628
2629=== modified file 'src/Ubuntu/Components/1.3/ToolbarButton.qml'
2630--- src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-05-21 10:50:35 +0000
2631+++ src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-11-17 15:49:37 +0000
2632@@ -84,6 +84,5 @@
2633 height: parent ? parent.height : undefined
2634 width: units.gu(5)
2635
2636- theme.version: Ubuntu.toolkitVersion
2637 styleName: "ToolbarButtonStyle"
2638 }
2639
2640=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
2641--- src/Ubuntu/Components/ComponentModule.pro 2015-10-02 22:48:13 +0000
2642+++ src/Ubuntu/Components/ComponentModule.pro 2015-11-17 15:49:37 +0000
2643@@ -132,7 +132,6 @@
2644 1.3/UbuntuListView.qml \
2645 1.3/UbuntuNumberAnimation.qml \
2646 1.3/ListItemPopover.qml \
2647- 1.3/BottomEdgeHint.qml \
2648 1.3/PageColumn.qml \
2649 1.3/PageColumnsLayout.qml \
2650 1.3/ProgressionSlot.qml \
2651@@ -141,7 +140,6 @@
2652 OTHER_FILES+= qmldir \
2653 1.3/CrossFadeImage.qdoc \
2654 1.3/UbuntuListView11.qdoc \
2655- 1.3/Page.qdoc \
2656 1.3/PageHeadConfiguration.qdoc \
2657 1.3/MainView.qdoc \
2658 1.3/Icon.qdoc
2659
2660=== modified file 'src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml'
2661--- src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-05-22 13:54:38 +0000
2662+++ src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-11-17 15:49:37 +0000
2663@@ -216,7 +216,6 @@
2664 right: parent.right
2665 }
2666 state: itemSelector.expanded ? "expanded" : "collapsed"
2667- theme.version: Ubuntu.toolkitVersion
2668 styleName: "ListItemOptionSelectorStyle"
2669
2670 states: [ State {
2671
2672=== modified file 'src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml'
2673--- src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-05-22 13:54:38 +0000
2674+++ src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-11-17 15:49:37 +0000
2675@@ -25,6 +25,5 @@
2676 property bool showSplit: false
2677 property real splitMargin
2678
2679- theme.version: Ubuntu.toolkitVersion
2680 styleName: "ProgressionVisualStyle"
2681 }
2682
2683=== modified file 'src/Ubuntu/Components/Pickers/1.3/DatePicker.qml'
2684--- src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-05-22 13:54:38 +0000
2685+++ src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-11-17 15:49:37 +0000
2686@@ -420,7 +420,6 @@
2687 }
2688 }
2689
2690- theme.version: Ubuntu.toolkitVersion
2691 styleName: "DatePickerStyle"
2692 Binding {
2693 target: __styleInstance
2694
2695=== modified file 'src/Ubuntu/Components/Pickers/1.3/Dialer.qml'
2696--- src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-05-22 13:54:38 +0000
2697+++ src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-11-17 15:49:37 +0000
2698@@ -145,7 +145,6 @@
2699 implicitHeight: size
2700 activeFocusOnPress: true
2701
2702- theme.version: Ubuntu.toolkitVersion
2703 styleName: "DialerStyle"
2704
2705 Item {
2706
2707=== modified file 'src/Ubuntu/Components/Pickers/1.3/DialerHand.qml'
2708--- src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-05-22 13:54:38 +0000
2709+++ src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-11-17 15:49:37 +0000
2710@@ -143,7 +143,6 @@
2711 width: parent.width
2712 height: parent.height
2713 activeFocusOnPress: true
2714- theme.version: Ubuntu.toolkitVersion
2715 styleName: "DialerHandStyle"
2716
2717 /*! \internal */
2718
2719=== modified file 'src/Ubuntu/Components/Pickers/1.3/Picker.qml'
2720--- src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-09-24 20:05:52 +0000
2721+++ src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-11-17 15:49:37 +0000
2722@@ -165,7 +165,6 @@
2723
2724 activeFocusOnPress: true
2725
2726- theme.version: Ubuntu.toolkitVersion
2727 styleName: "PickerStyle"
2728
2729 /*! \internal */
2730
2731=== modified file 'src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml'
2732--- src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-09-24 20:05:52 +0000
2733+++ src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-11-17 15:49:37 +0000
2734@@ -45,7 +45,6 @@
2735 internal.itemList.currentIndex = index;
2736 }
2737
2738- theme.version: Ubuntu.toolkitVersion
2739 styleName: "PickerDelegateStyle"
2740
2741 QtObject {
2742
2743=== modified file 'src/Ubuntu/Components/Popups/1.3/Dialog.qml'
2744--- src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-09-21 14:44:13 +0000
2745+++ src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-11-17 15:49:37 +0000
2746@@ -213,7 +213,6 @@
2747 }
2748 }
2749
2750- theme.version: Ubuntu.toolkitVersion
2751 styleName: "DialogForegroundStyle"
2752 }
2753 }
2754
2755=== modified file 'src/Ubuntu/Components/Popups/1.3/Popover.qml'
2756--- src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-08-12 19:53:20 +0000
2757+++ src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-11-17 15:49:37 +0000
2758@@ -241,7 +241,6 @@
2759 signal showCompleted()
2760 signal hideCompleted()
2761
2762- theme.version: Ubuntu.toolkitVersion
2763 styleName: "PopoverForegroundStyle"
2764 }
2765
2766
2767=== modified file 'src/Ubuntu/Components/Popups/1.3/SheetBase.qml'
2768--- src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-05-22 13:54:38 +0000
2769+++ src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-11-17 15:49:37 +0000
2770@@ -109,7 +109,6 @@
2771 }
2772 }
2773
2774- theme.version: Ubuntu.toolkitVersion
2775 styleName: "SheetForegroundStyle"
2776 }
2777 }
2778
2779=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
2780--- src/Ubuntu/Components/Styles/Styles.pro 2015-10-08 21:19:56 +0000
2781+++ src/Ubuntu/Components/Styles/Styles.pro 2015-11-17 15:49:37 +0000
2782@@ -13,7 +13,3 @@
2783 load(ubuntu_qml_module)
2784
2785 OTHER_FILES+=qmldir
2786-
2787-
2788-
2789-
2790
2791=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml'
2792--- src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-04-24 14:52:19 +0000
2793+++ src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-11-17 15:49:37 +0000
2794@@ -20,6 +20,7 @@
2795
2796 Item {
2797 id: ambianceStyle
2798+ objectName: "OptionSelector12"
2799
2800 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
2801 property url tick: Qt.resolvedUrl("../artwork/tick.png")
2802
2803=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml'
2804--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-10-15 14:17:25 +0000
2805+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-11-17 15:49:37 +0000
2806@@ -34,7 +34,7 @@
2807 */
2808 defaultDelegate: AbstractButton {
2809 style: IconButtonStyle { }
2810- objectName: action.objectName + "_action_button"
2811+ objectName: action.objectName + "_button"
2812 height: parent ? parent.height : undefined
2813 action: modelData
2814 }
2815@@ -88,7 +88,7 @@
2816 iconSource: actionBarStyle.overflowIconSource
2817 iconName: actionBarStyle.overflowIconName
2818 text: actionBarStyle.overflowText
2819- objectName: "overflow"
2820+ objectName: "overflow_action"
2821 visible: numberOfSlots.requested > numberOfSlots.available
2822 onTriggered: {
2823 var overflowButton = actionsRepeater.itemAt(actionsRepeater.count - 1);
2824
2825=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml'
2826--- src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 1970-01-01 00:00:00 +0000
2827+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 2015-11-17 15:49:37 +0000
2828@@ -0,0 +1,149 @@
2829+/*
2830+ * Copyright 2015 Canonical Ltd.
2831+ *
2832+ * This program is free software; you can redistribute it and/or modify
2833+ * it under the terms of the GNU Lesser General Public License as published by
2834+ * the Free Software Foundation; version 3.
2835+ *
2836+ * This program is distributed in the hope that it will be useful,
2837+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2838+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2839+ * GNU Lesser General Public License for more details.
2840+ *
2841+ * You should have received a copy of the GNU Lesser General Public License
2842+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2843+ */
2844+
2845+import QtQuick 2.4
2846+import Ubuntu.Components 1.3
2847+import Ubuntu.Components.ListItems 1.3
2848+
2849+Item {
2850+ id: bottomEdgeHintStyle
2851+ implicitWidth: styledItem.parent.width
2852+ implicitHeight: units.gu(4)
2853+
2854+ readonly property BottomEdgeHint hint: styledItem
2855+
2856+ // translate hint status into state
2857+ state: {
2858+ switch (hint.status) {
2859+ case BottomEdgeHint.Hidden: return "Hidden";
2860+ case BottomEdgeHint.Inactive: return "Inactive"
2861+ case BottomEdgeHint.Active: return "Active"
2862+ case BottomEdgeHint.Locked: return "Locked"
2863+ }
2864+ }
2865+
2866+ states: [
2867+ State {
2868+ name: "Inactive"
2869+ extend: ""
2870+ },
2871+ State {
2872+ name: "Active"
2873+ PropertyChanges {
2874+ target: h1
2875+ anchors.verticalCenterOffset: styledItem.height / 2
2876+ }
2877+ PropertyChanges {
2878+ target: h2
2879+ anchors.topMargin: 0
2880+ }
2881+ },
2882+ State {
2883+ name: "Hidden"
2884+ PropertyChanges {
2885+ target: styledItem
2886+ opacity: 0.0
2887+ }
2888+ },
2889+ State {
2890+ name: "Locked"
2891+ PropertyChanges {
2892+ target: h1
2893+ anchors.verticalCenterOffset: styledItem.height / 2
2894+ }
2895+ PropertyChanges {
2896+ target: h2
2897+ anchors.topMargin: 0
2898+ }
2899+ }
2900+ ]
2901+ transitions: [
2902+ Transition {
2903+ from: "*"
2904+ to: "Active"
2905+ reversible: true
2906+ UbuntuNumberAnimation {
2907+ targets: [h1, h2]
2908+ properties: "anchors.verticalCenterOffset, anchors.topMargin"
2909+ }
2910+ },
2911+ Transition {
2912+ from: "*"
2913+ to: "Hidden"
2914+ reversible: true
2915+ UbuntuNumberAnimation {
2916+ target: styledItem
2917+ property: "opacity"
2918+ duration: UbuntuAnimation.SlowDuration
2919+ }
2920+ }
2921+ ]
2922+
2923+ clip: true
2924+
2925+ Icon {
2926+ id: h1
2927+ width: units.gu(2)
2928+ height: width
2929+ anchors {
2930+ centerIn: parent
2931+ topMargin: styledItem.height
2932+ }
2933+ name: "up"
2934+ }
2935+
2936+ Rectangle {
2937+ id: h2
2938+ anchors {
2939+ top: parent.top
2940+ left: parent.left
2941+ right: parent.right
2942+ topMargin: styledItem.height
2943+ }
2944+ height: styledItem.height
2945+ color: theme.palette.normal.overlay
2946+ ThinDivider {
2947+ anchors.top: parent.top
2948+ }
2949+
2950+ Row {
2951+ anchors {
2952+ top: parent.top
2953+ bottom: parent.bottom
2954+ horizontalCenter: parent.horizontalCenter
2955+ }
2956+ spacing: units.gu(1)
2957+ Icon {
2958+ id: icon
2959+ name: styledItem.iconName
2960+ source: styledItem.iconSource
2961+ width: height
2962+ height: units.gu(2)
2963+ anchors.verticalCenter: parent.verticalCenter
2964+ color: theme.palette.normal.overlayText
2965+ }
2966+ Label {
2967+ id: label
2968+ text: styledItem.text
2969+ textSize: Label.Medium
2970+ color: theme.palette.normal.overlayText
2971+ height: styledItem.height
2972+ anchors.verticalCenter: parent.verticalCenter
2973+ verticalAlignment: Text.AlignVCenter
2974+ }
2975+ }
2976+ }
2977+}
2978
2979=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml'
2980--- src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-07-22 13:14:43 +0000
2981+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-11-17 15:49:37 +0000
2982@@ -20,6 +20,7 @@
2983
2984 Item {
2985 id: ambianceStyle
2986+ objectName: "OptionSelector13"
2987
2988 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
2989 property url tick: Qt.resolvedUrl("../artwork/tick.png")
2990
2991=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
2992--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-10-13 21:55:11 +0000
2993+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-11-17 15:49:37 +0000
2994@@ -21,7 +21,7 @@
2995 id: pageHeaderStyle
2996
2997 foregroundColor: theme.palette.selected.backgroundText
2998- backgroundColor: "white"
2999+ backgroundColor: theme.palette.normal.background
3000 dividerColor: Qt.rgba(0, 0, 0, 0.1)
3001 property int fontWeight: Font.Light
3002 property int textSize: Label.Large
3003@@ -31,7 +31,7 @@
3004
3005 defaultActionDelegate: AbstractButton {
3006 style: IconButtonStyle { }
3007- objectName: action.objectName + "_action_button"
3008+ objectName: action.objectName + "_button"
3009 height: parent ? parent.height : undefined
3010 action: modelData
3011 StyleHints {
3012
3013=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
3014--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-10-02 22:48:13 +0000
3015+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-11-17 15:49:37 +0000
3016@@ -113,6 +113,9 @@
3017 1.3/ToolbarStyle.qml \
3018 1.3/IconButtonStyle.qml \
3019 1.3/PageHeaderStyle.qml \
3020+ 1.3/BottomEdgeHintStyle.qml \
3021 $$ARTWORK_FILES
3022
3023 load(ubuntu_qml_module)
3024+
3025+OTHER_FILES+=qmldir
3026
3027=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
3028--- src/Ubuntu/Components/plugin/plugin.cpp 2015-10-01 12:34:29 +0000
3029+++ src/Ubuntu/Components/plugin/plugin.cpp 2015-11-17 15:49:37 +0000
3030@@ -70,6 +70,7 @@
3031 #include "ucheader.h"
3032 #include "uclabel.h"
3033 #include "uclistitemlayout.h"
3034+#include "ucbottomedgehint.h"
3035
3036 #include <sys/types.h>
3037 #include <unistd.h>
3038@@ -230,7 +231,6 @@
3039 qmlRegisterType<UCUbuntuShapeOverlay>(uri, 1, 2, "UbuntuShapeOverlay");
3040
3041 // register 1.3 API
3042- qmlRegisterType<UCItemAttached>();
3043 qmlRegisterType<UCListItem, 1>(uri, 1, 3, "ListItem");
3044 qmlRegisterType<UCListItemExpansion>();
3045 qmlRegisterType<UCTheme>(uri, 1, 3, "ThemeSettings");
3046@@ -249,6 +249,7 @@
3047 qmlRegisterType<UCListItemLayout>(uri, 1, 3, "ListItemLayout");
3048 qmlRegisterType<UCHeader>(uri, 1, 3, "Header");
3049 qmlRegisterType<UCLabel>(uri, 1, 3, "Label");
3050+ qmlRegisterType<UCBottomEdgeHint>(uri, 1, 3, "BottomEdgeHint");
3051 }
3052
3053 void UbuntuComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
3054
3055=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
3056--- src/Ubuntu/Components/plugin/plugin.pri 2015-10-01 08:47:31 +0000
3057+++ src/Ubuntu/Components/plugin/plugin.pri 2015-11-17 15:49:37 +0000
3058@@ -91,7 +91,10 @@
3059 $$PWD/ucheader.h \
3060 $$PWD/uclabel.h \
3061 $$PWD/uclistitemlayout.h \
3062- $$PWD/privates/threelabelsslot_p.h
3063+ $$PWD/privates/threelabelsslot_p.h \
3064+ $$PWD/ucimportversionchecker_p.h \
3065+ $$PWD/ucbottomedgehint.h \
3066+ $$PWD/privates/gesturedetector.h
3067
3068 SOURCES += $$PWD/plugin.cpp \
3069 $$PWD/uctheme.cpp \
3070@@ -153,7 +156,10 @@
3071 $$PWD/ucheader.cpp \
3072 $$PWD/uclabel.cpp \
3073 $$PWD/uclistitemlayout.cpp \
3074- $$PWD/privates/threelabelsslot_p.cpp
3075+ $$PWD/privates/threelabelsslot_p.cpp \
3076+ $$PWD/ucimportversionchecker_p.cpp \
3077+ $$PWD/ucbottomedgehint.cpp \
3078+ $$PWD/privates/gesturedetector.cpp
3079
3080 # adapters
3081 SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp
3082
3083=== added file 'src/Ubuntu/Components/plugin/privates/gesturedetector.cpp'
3084--- src/Ubuntu/Components/plugin/privates/gesturedetector.cpp 1970-01-01 00:00:00 +0000
3085+++ src/Ubuntu/Components/plugin/privates/gesturedetector.cpp 2015-11-17 15:49:37 +0000
3086@@ -0,0 +1,142 @@
3087+/*
3088+ * Copyright 2015 Canonical Ltd.
3089+ *
3090+ * This program is free software; you can redistribute it and/or modify
3091+ * it under the terms of the GNU Lesser General Public License as published by
3092+ * the Free Software Foundation; version 3.
3093+ *
3094+ * This program is distributed in the hope that it will be useful,
3095+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3096+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3097+ * GNU Lesser General Public License for more details.
3098+ *
3099+ * You should have received a copy of the GNU Lesser General Public License
3100+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3101+ *
3102+ * Authors: Zsombor Egri <zsombor.egri@canonical.com>
3103+ */
3104+
3105+#include "gesturedetector.h"
3106+#include "ucunits.h"
3107+#include <QtCore/QEvent>
3108+#include <QtCore/QRectF>
3109+#include <QtGui/QTouchEvent>
3110+#include <QtQuick/QQuickItem>
3111+#include <QtGui/QGuiApplication>
3112+#include <QtGui/QStyleHints>
3113+
3114+#define DETECTION_AREA_THICKNESS_GU 1.2
3115+
3116+GestureDetector::GestureDetector(QObject *parent)
3117+ : QObject(parent)
3118+ , m_owner(qobject_cast<QQuickItem*>(parent))
3119+ , m_status(Ready)
3120+ , m_bottomUpSwipeDetected(false)
3121+{
3122+ Q_ASSERT(m_owner);
3123+}
3124+GestureDetector::~GestureDetector()
3125+{
3126+ Q_FOREACH(QObject *object, m_filteredItems) {
3127+ object->removeEventFilter(this);
3128+ }
3129+ m_filteredItems.clear();
3130+}
3131+
3132+void GestureDetector::onFilteredItemDeleted(QObject *object)
3133+{
3134+ if (object) {
3135+ object->removeEventFilter(this);
3136+ m_filteredItems.removeAll(object);
3137+ }
3138+}
3139+
3140+void GestureDetector::setStatus(Status status)
3141+{
3142+ if (status == m_status) {
3143+ return;
3144+ }
3145+ m_status = status;
3146+ Q_EMIT statusChanged(m_status);
3147+}
3148+
3149+bool GestureDetector::isDetecting()
3150+{
3151+ return (m_status > Ready && m_status < Completed);
3152+}
3153+
3154+void GestureDetector::setItemFilter(QObject *item)
3155+{
3156+ m_filteredItems.append(item);
3157+ item->installEventFilter(this);
3158+ connect(item, &QObject::destroyed, this, &GestureDetector::onFilteredItemDeleted);
3159+}
3160+
3161+void GestureDetector::removeItemFilter(QObject *item)
3162+{
3163+ m_filteredItems.removeAll(item);
3164+ item->removeEventFilter(this);
3165+ disconnect(item, &QObject::destroyed, this, &GestureDetector::onFilteredItemDeleted);
3166+}
3167+
3168+bool GestureDetector::handleTouchEvent(QObject *target, QTouchEvent *event)
3169+{
3170+ switch (event->type()) {
3171+ case QEvent::TouchBegin: {
3172+ setStatus(Ready);
3173+ QPointF itemPoint = m_owner->mapFromScene(event->touchPoints()[0].scenePos());
3174+ qreal thickness = UCUnits::instance().gu(DETECTION_AREA_THICKNESS_GU);
3175+ QRectF detectionArea(0.0, m_owner->height() - thickness, m_owner->width(), thickness);
3176+ if (detectionArea.contains(itemPoint)) {
3177+ m_startPoint = itemPoint;
3178+ setStatus(Started);
3179+ if (target == parent()) {
3180+ event->accept();
3181+ return true;
3182+ }
3183+ }
3184+ return false;
3185+ }
3186+ case QEvent::TouchEnd:
3187+ {
3188+ m_startPoint = QPointF();
3189+ setStatus(Completed);
3190+ return false;
3191+ }
3192+ case QEvent::TouchCancel: {
3193+ m_startPoint = QPointF();
3194+ setStatus(Ready);
3195+ return false;
3196+ }
3197+ case QEvent::TouchUpdate: {
3198+ if (m_status == Started) {
3199+ QPointF itemPoint = m_owner->mapFromScene(event->touchPoints()[0].scenePos());
3200+ if (abs(m_startPoint.y() - itemPoint.y()) >= qApp->styleHints()->startDragDistance()) {
3201+ setStatus(Detected);
3202+ Q_EMIT bottomUpSwipeDetected();
3203+ }
3204+ }
3205+ return false;
3206+ }
3207+ default: return false;
3208+ }
3209+}
3210+
3211+bool GestureDetector::eventFilter(QObject *target, QEvent *event)
3212+{
3213+ if (m_filteredItems.contains(target)) {
3214+ QEvent::Type type = event->type();
3215+ if (type == QEvent::TouchBegin
3216+ || type == QEvent::TouchUpdate
3217+ || type == QEvent::TouchEnd
3218+ || type == QEvent::TouchCancel) {
3219+ QTouchEvent *touch = static_cast<QTouchEvent*>(event);
3220+ return handleTouchEvent(target, touch);
3221+ } else {
3222+ // pass it on
3223+ return false;
3224+ }
3225+ } else {
3226+ return QObject::eventFilter(target, event);
3227+ }
3228+}
3229
3230=== added file 'src/Ubuntu/Components/plugin/privates/gesturedetector.h'
3231--- src/Ubuntu/Components/plugin/privates/gesturedetector.h 1970-01-01 00:00:00 +0000
3232+++ src/Ubuntu/Components/plugin/privates/gesturedetector.h 2015-11-17 15:49:37 +0000
3233@@ -0,0 +1,75 @@
3234+/*
3235+ * Copyright 2015 Canonical Ltd.
3236+ *
3237+ * This program is free software; you can redistribute it and/or modify
3238+ * it under the terms of the GNU Lesser General Public License as published by
3239+ * the Free Software Foundation; version 3.
3240+ *
3241+ * This program is distributed in the hope that it will be useful,
3242+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3243+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3244+ * GNU Lesser General Public License for more details.
3245+ *
3246+ * You should have received a copy of the GNU Lesser General Public License
3247+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3248+ *
3249+ * Authors: Zsombor Egri <zsombor.egri@canonical.com>
3250+ */
3251+
3252+#ifndef GESTUREDETECTOR_H
3253+#define GESTUREDETECTOR_H
3254+
3255+#include <QtCore/QObject>
3256+#include <QtCore/QPointF>
3257+#include <QtCore/QList>
3258+
3259+/*
3260+ * A simple gesture detection filter class that can be used in components to detect
3261+ * various gestures. Yet swipe from bottom up is the only gesture handled.
3262+ * It does not grab or consume the event from the environment, acts as a filter.
3263+ */
3264+class QTouchEvent;
3265+class QQuickItem;
3266+class GestureDetector : public QObject
3267+{
3268+ Q_OBJECT
3269+public:
3270+ enum Status {
3271+ Ready,
3272+ Started,
3273+ Detected,
3274+ Completed
3275+ };
3276+ explicit GestureDetector(QObject *parent = 0);
3277+ ~GestureDetector();
3278+
3279+ bool isDetecting();
3280+
3281+ void setItemFilter(QObject *item);
3282+ void removeItemFilter(QObject *item);
3283+
3284+ bool handleTouchEvent(QObject *target, QTouchEvent *event);
3285+
3286+Q_SIGNALS:
3287+ void statusChanged(Status status);
3288+
3289+ void bottomUpSwipeDetected();
3290+
3291+public Q_SLOTS:
3292+
3293+protected:
3294+ bool eventFilter(QObject *target, QEvent *event);
3295+
3296+ void setStatus(Status status);
3297+
3298+private:
3299+ QList<QObject*> m_filteredItems;
3300+ QPointF m_startPoint;
3301+ QQuickItem *m_owner;
3302+ Status m_status;
3303+ bool m_bottomUpSwipeDetected:1;
3304+
3305+ void onFilteredItemDeleted(QObject *object);
3306+};
3307+
3308+#endif // GESTUREDETECTOR_H
3309
3310=== modified file 'src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp'
3311--- src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp 2015-10-12 14:32:17 +0000
3312+++ src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp 2015-11-17 15:49:37 +0000
3313@@ -143,7 +143,7 @@
3314 Q_D(UCThreeLabelsSlot);
3315 if (d->m_title == Q_NULLPTR) {
3316 d->m_title = new UCLabel(this);
3317- QQmlData::get(d->m_title, true);
3318+ QQmlEngine::setContextForObject(d->m_title, qmlContext(this));
3319 d->m_title->init();
3320
3321 QQuickAnchors *titleAnchors = QQuickItemPrivate::get(d->m_title)->anchors();
3322@@ -180,7 +180,7 @@
3323 Q_D(UCThreeLabelsSlot);
3324 if (d->m_subtitle == Q_NULLPTR) {
3325 d->m_subtitle = new UCLabel(this);
3326- QQmlData::get(d->m_subtitle, true);
3327+ QQmlEngine::setContextForObject(d->m_subtitle, qmlContext(this));
3328 d->m_subtitle->init();
3329
3330 QQuickAnchors *subtitleAnchors = QQuickItemPrivate::get(d->m_subtitle)->anchors();
3331@@ -202,7 +202,7 @@
3332 Q_D(UCThreeLabelsSlot);
3333 if (d->m_summary == Q_NULLPTR) {
3334 d->m_summary = new UCLabel(this);
3335- QQmlData::get(d->m_summary, true);
3336+ QQmlEngine::setContextForObject(d->m_summary, qmlContext(this));
3337 d->m_summary->init();
3338
3339 QQuickAnchors *summaryAnchors = QQuickItemPrivate::get(d->m_summary)->anchors();
3340
3341=== modified file 'src/Ubuntu/Components/plugin/quickutils.cpp'
3342--- src/Ubuntu/Components/plugin/quickutils.cpp 2015-08-24 12:55:50 +0000
3343+++ src/Ubuntu/Components/plugin/quickutils.cpp 2015-11-17 15:49:37 +0000
3344@@ -32,7 +32,8 @@
3345
3346 QuickUtils::QuickUtils(QObject *parent) :
3347 QObject(parent),
3348- m_rootView(0)
3349+ m_rootView(0),
3350+ m_mouseAttached(true)
3351 {
3352 QGuiApplication::instance()->installEventFilter(this);
3353 m_omitIM << "ibus" << "none" << "compose";
3354
3355=== modified file 'src/Ubuntu/Components/plugin/quickutils.h'
3356--- src/Ubuntu/Components/plugin/quickutils.h 2015-08-24 12:55:50 +0000
3357+++ src/Ubuntu/Components/plugin/quickutils.h 2015-11-17 15:49:37 +0000
3358@@ -31,6 +31,7 @@
3359 Q_PROPERTY(QQuickItem *rootObject READ rootObject NOTIFY rootObjectChanged)
3360 Q_PROPERTY(QString inputMethodProvider READ inputMethodProvider)
3361 Q_PROPERTY(bool touchScreenAvailable READ touchScreenAvailable NOTIFY touchScreenAvailableChanged)
3362+ Q_PROPERTY(bool mouseAttached MEMBER m_mouseAttached NOTIFY mouseAttachedChanged)
3363 public:
3364 static QuickUtils& instance()
3365 {
3366@@ -48,11 +49,17 @@
3367 QObject* createQmlObject(const QUrl &url, QQmlEngine *engine);
3368 static bool showDeprecationWarnings();
3369
3370+ bool mouseAttached()
3371+ {
3372+ return m_mouseAttached;
3373+ }
3374+
3375 Q_SIGNALS:
3376 void rootObjectChanged();
3377 void activated();
3378 void deactivated();
3379 void touchScreenAvailableChanged();
3380+ void mouseAttachedChanged();
3381
3382 protected:
3383 bool eventFilter(QObject *, QEvent *);
3384@@ -61,6 +68,7 @@
3385 explicit QuickUtils(QObject *parent = 0);
3386 QPointer<QQuickView> m_rootView;
3387 QStringList m_omitIM;
3388+ bool m_mouseAttached;
3389
3390 void lookupQuickView();
3391 };
3392
3393=== added file 'src/Ubuntu/Components/plugin/ucbottomedgehint.cpp'
3394--- src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 1970-01-01 00:00:00 +0000
3395+++ src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-11-17 15:49:37 +0000
3396@@ -0,0 +1,347 @@
3397+/*
3398+ * Copyright 2015 Canonical Ltd.
3399+ *
3400+ * This program is free software; you can redistribute it and/or modify
3401+ * it under the terms of the GNU Lesser General Public License as published by
3402+ * the Free Software Foundation; version 3.
3403+ *
3404+ * This program is distributed in the hope that it will be useful,
3405+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3406+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3407+ * GNU Lesser General Public License for more details.
3408+ *
3409+ * You should have received a copy of the GNU Lesser General Public License
3410+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3411+ *
3412+ * Authors: Zsombor Egri <zsombor.egri@canonical.com>
3413+ */
3414+
3415+#include "ucbottomedgehint.h"
3416+#include "ucstyleditembase_p.h"
3417+#include "quickutils.h"
3418+#include "ucunits.h"
3419+#include <QtQml/private/qqmlproperty_p.h>
3420+#include <QtQuick/private/qquickflickable_p.h>
3421+
3422+/*!
3423+ \qmltype BottomEdgeHint
3424+ \inqmlmodule Ubuntu.Components 1.3
3425+ \ingroup ubuntu
3426+ \inherits StyledItem
3427+ \brief The BottomEdgeHint shows the availability of extra features
3428+ available from the bottom edge of the application.
3429+
3430+ It displays a label and/or an icon at the bottom of the component it is
3431+ attached to.
3432+
3433+ When used with a mouse it acts like a button. The typical action associated
3434+ with clicking on it should be revealing the extra features provided by the
3435+ bottom edge.
3436+
3437+ Example:
3438+ \qml
3439+ BottomEdgeHint {
3440+ id: bottomEdgeHint
3441+ text: i18n.tr("Favorites")
3442+ onClicked: revealBottomEdge()
3443+ }
3444+ \endqml
3445+
3446+ The component is styled through \b BottomEdgeHintStyle.
3447+*/
3448+UCBottomEdgeHint::UCBottomEdgeHint(QQuickItem *parent)
3449+ : UCStyledItemBase(parent)
3450+ , m_gestureDetector(this)
3451+ , m_flickable(Q_NULLPTR)
3452+ , m_deactivateTimeout(800)
3453+ // FIXME: we need QInputDeviceInfo to be complete with the locked!!
3454+ , m_status(QuickUtils::instance().mouseAttached() ? Locked : Inactive)
3455+ , m_pressed(false)
3456+{
3457+ /*
3458+ * we cannot use setStyleName as that will trigger style loading
3459+ * and the qmlEngine is not known at this phase of the of the initialization
3460+ * Therefore we simply set the style name default. Style loading will
3461+ * happen during component completion.
3462+ */
3463+ UCStyledItemBasePrivate::get(this)->styleDocument = "BottomEdgeHintStyle";
3464+
3465+ // connect old stateChanged
3466+ connect(this, &QQuickItem::stateChanged, this, &UCBottomEdgeHint::stateChanged);
3467+
3468+ // connect to gesture detection
3469+ connect(&m_gestureDetector, &GestureDetector::bottomUpSwipeDetected,
3470+ this, &UCBottomEdgeHint::onBottomUpSwipeDetected);
3471+ connect(&m_gestureDetector, &GestureDetector::statusChanged,
3472+ this, &UCBottomEdgeHint::onGestureStatusChanged);
3473+
3474+ // FIXME: use QInputDeviceInfo once available
3475+ connect(&QuickUtils::instance(), &QuickUtils::mouseAttachedChanged, [this]() {
3476+ setStatus(QuickUtils::instance().mouseAttached() ? Locked : Active);
3477+ if (m_status == Active) {
3478+ m_deactivationTimer.start(m_deactivateTimeout, this);
3479+ }
3480+ });
3481+
3482+ // accept mouse events
3483+ setAcceptedMouseButtons(Qt::LeftButton);
3484+}
3485+
3486+void UCBottomEdgeHint::itemChange(ItemChange change, const ItemChangeData &data)
3487+{
3488+ UCStyledItemBase::itemChange(change, data);
3489+ if (change == ItemParentHasChanged) {
3490+ QQmlProperty bottomAnchors(this, "anchors.bottom", qmlContext(this));
3491+ if (data.item && !QQmlPropertyPrivate::binding(bottomAnchors)) {
3492+ QQuickAnchors *anchors = QQuickItemPrivate::get(this)->anchors();
3493+ anchors->setBottom(QQuickItemPrivate::get(data.item)->bottom());
3494+ }
3495+ }
3496+}
3497+
3498+void UCBottomEdgeHint::timerEvent(QTimerEvent *event)
3499+{
3500+ UCStyledItemBase::timerEvent(event);
3501+ if (event->timerId() == m_deactivationTimer.timerId()) {
3502+ setStatus(Inactive);
3503+ m_deactivationTimer.stop();
3504+ }
3505+}
3506+
3507+// handle clicked event when locked and enter or return is pressed
3508+void UCBottomEdgeHint::keyPressEvent(QKeyEvent *event)
3509+{
3510+ UCStyledItemBase::keyPressEvent(event);
3511+ if ((status() >= Active) && (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)) {
3512+ Q_EMIT clicked();
3513+ }
3514+}
3515+
3516+// handle gesture detection
3517+void UCBottomEdgeHint::touchEvent(QTouchEvent *event)
3518+{
3519+ UCStyledItemBase::touchEvent(event);
3520+ m_gestureDetector.handleTouchEvent(this, event);
3521+}
3522+
3523+// handle click event
3524+void UCBottomEdgeHint::mousePressEvent(QMouseEvent *event)
3525+{
3526+ if (contains(event->localPos()) && (m_status >= Active)) {
3527+ m_pressed = true;
3528+ } else {
3529+ UCStyledItemBase::mousePressEvent(event);
3530+ }
3531+}
3532+void UCBottomEdgeHint::mouseReleaseEvent(QMouseEvent *event)
3533+{
3534+ UCStyledItemBase::mouseReleaseEvent(event);
3535+ if (m_pressed && (m_status >= Active)) {
3536+ Q_EMIT clicked();
3537+ }
3538+}
3539+
3540+// watch gesture detection status changes
3541+void UCBottomEdgeHint::onBottomUpSwipeDetected()
3542+{
3543+ m_deactivationTimer.stop();
3544+ setStatus(Active);
3545+}
3546+
3547+void UCBottomEdgeHint::onGestureStatusChanged(GestureDetector::Status status)
3548+{
3549+ if (status == GestureDetector::Completed) {
3550+ if (m_status == Active) {
3551+ m_deactivationTimer.start(m_deactivateTimeout, this);
3552+ }
3553+ }
3554+}
3555+
3556+/*!
3557+ \qmlsignal void BottomEdgeHint::clicked()
3558+ This handler is called when there is a mouse click on the BottomEdgeHint
3559+ and the BottomEdgeHint is not disabled.
3560+*/
3561+
3562+/*!
3563+ \qmlproperty string BottomEdgeHint::text
3564+ The label displayed by the BottomEdgeHint.
3565+ */
3566+
3567+/*!
3568+ \qmlproperty url BottomEdgeHint::iconSource
3569+ The icon displayed by the BottomEdgeHint.
3570+
3571+ This is the URL of any image file.
3572+ If both iconSource and \l iconName are defined, \l iconName will be ignored.
3573+ */
3574+
3575+/*!
3576+ \qmlproperty string BottomEdgeHint::iconName
3577+ The icon associated with the BottomEdgeHint in the icon theme.
3578+
3579+ If both \l iconSource and iconName are defined, iconName will be ignored.
3580+ */
3581+
3582+/*!
3583+ \qmlproperty Flickable BottomEdgeHint::flickable
3584+ The property holds the flickable, which when flicked hides the hint.
3585+ \e Hidden state is reached when this property is set to a Flickable
3586+ which is flicking or moving. It is recommended to set the property
3587+ when the hint is placed above a flickable content. Defaults to null.
3588+ */
3589+void UCBottomEdgeHint::setFlickable(QQuickFlickable *flickable)
3590+{
3591+ if (flickable == m_flickable) {
3592+ return;
3593+ }
3594+ if (m_flickable) {
3595+ disconnect(m_flickable, &QQuickFlickable::flickingChanged,
3596+ this, &UCBottomEdgeHint::handleFlickableActivation);
3597+ disconnect(m_flickable, &QQuickFlickable::movingChanged,
3598+ this, &UCBottomEdgeHint::handleFlickableActivation);
3599+ m_gestureDetector.removeItemFilter(m_flickable);
3600+ }
3601+ m_flickable = flickable;
3602+ if (m_flickable) {
3603+ connect(m_flickable, &QQuickFlickable::flickingChanged,
3604+ this, &UCBottomEdgeHint::handleFlickableActivation, Qt::DirectConnection);
3605+ connect(m_flickable, &QQuickFlickable::movingChanged,
3606+ this, &UCBottomEdgeHint::handleFlickableActivation, Qt::DirectConnection);
3607+ m_gestureDetector.setItemFilter(m_flickable);
3608+ }
3609+ Q_EMIT flickableChanged();
3610+}
3611+
3612+// flickable moves hide the hint only if the current status is not Locked
3613+void UCBottomEdgeHint::handleFlickableActivation()
3614+{
3615+ if (m_status < Locked && !m_gestureDetector.isDetecting() && !m_deactivationTimer.isActive()) {
3616+ bool moving = m_flickable->isFlicking() || m_flickable->isMoving();
3617+ if (moving) {
3618+ setStatus(Hidden);
3619+ } else if (m_status == Hidden) {
3620+ setStatus(Inactive);
3621+ }
3622+ }
3623+}
3624+
3625+/*!
3626+ \qmlproperty string BottomEdgeHint::state
3627+ \deprecated
3628+ BottomEdgeHint can take 2 states of visibility: \e Hidden, \e Visible.
3629+ \table
3630+ \header
3631+ \li State
3632+ \li Description
3633+ \row
3634+ \li Hidden
3635+ \li The hint is not shown at all and cannot be activated.
3636+ \row
3637+ \li Visible
3638+ \li The hint is in a state where it is visible but not active. \l clicked
3639+ signal is not emitted.
3640+ \endtable
3641+
3642+ Defaults to \e Visible.
3643+ */
3644+QString UCBottomEdgeHint::state() const
3645+{
3646+ return QQuickItem::state();
3647+}
3648+void UCBottomEdgeHint::setState(const QString &state)
3649+{
3650+ QQuickItem::setState(state);
3651+
3652+ qmlInfo(this) << "Overloaded 'state' property deprecated, will be removed from 1.3 release. Use 'status' instead.";
3653+ QQuickItem *style = UCStyledItemBasePrivate::get(this)->styleItem;
3654+ if (!style) {
3655+ return;
3656+ }
3657+ if (state == "Hidden") {
3658+ setStatus(Hidden);
3659+ }
3660+ if (state == "Visible") {
3661+ setStatus(Inactive);
3662+ }
3663+}
3664+
3665+/*!
3666+ \qmlproperty Status BottomEdgeHint::status
3667+ The property represents the status of the hint. The property is writable so it
3668+ can be set to any of the following values programatically:
3669+ \table
3670+ \header
3671+ \li Status
3672+ \li Description
3673+ \row
3674+ \li Hidden
3675+ \li The hint is not shown. Equivalent with setting \e visible to \c false,
3676+ however visuals may do animations when altering this property. It can
3677+ only be set if the current status is not \e Locked.
3678+ \row
3679+ \li Inactive
3680+ \li The hint is shown and inactive. Styles can represent this state with
3681+ different visuals. When inactive, \l clicked signal cannot be emitted.
3682+ \row
3683+ \li Active
3684+ \li The hint is shown and active, meaning \l clicked signal is emitted when
3685+ clicked with mouse.
3686+ \row
3687+ \li Locked
3688+ \li Similar to \e Active the hint is shown and active, but no automatic transition
3689+ to any other state is allowed. This is relevant for style implementations.
3690+ \endtable
3691+ \note \e Locked status value is set automatically when the system detects a
3692+ mouse attached. In this case any change into other state value than \e Locked
3693+ is rejected.
3694+ Defaults to
3695+ \list
3696+ \li Inactive if no mouse is attached or
3697+ \li Locked if there is a mouse detected.
3698+ \endlist
3699+ */
3700+UCBottomEdgeHint::Status UCBottomEdgeHint::status()
3701+{
3702+ // FIXME: we won't need this once we get the QInputDeviceInfo reporting mouse attach/detach
3703+ if (QuickUtils::instance().mouseAttached()) {
3704+ m_status = Locked;
3705+ }
3706+ return m_status;
3707+}
3708+
3709+void UCBottomEdgeHint::setStatus(Status status)
3710+{
3711+ // FIXME: we need QInputDeviceInfo to complete this!
3712+ // cannot unlock if mouse is attached or we don't have touch screen available
3713+ if (status == m_status || (status != Locked && QuickUtils::instance().mouseAttached())) {
3714+ return;
3715+ }
3716+ m_status = status;
3717+ // make sure we stop the deactivation timer if Inactive or Locked
3718+ if (status != Active && m_deactivationTimer.isActive()) {
3719+ m_deactivationTimer.stop();
3720+ }
3721+ Q_EMIT statusChanged();
3722+}
3723+
3724+/*!
3725+ * \qmlproperty int BottomEdgeHint::deactivateTimeout
3726+ * The property specifies the timeout interval in milliseconds the \l status
3727+ * is set to \e Inactive after a gesture based activation. Gesture based activation
3728+ * is only possible when mouse is not attached to the device. Defaults to 800
3729+ * milliseconds.
3730+ */
3731+
3732+void UCBottomEdgeHint::setDeactivateTimeout(int timeout)
3733+{
3734+ if (timeout == m_deactivateTimeout || timeout < 0) {
3735+ return;
3736+ }
3737+ m_deactivateTimeout = timeout;
3738+ if (m_deactivationTimer.isActive()) {
3739+ m_deactivationTimer.stop();
3740+ m_deactivationTimer.start(m_deactivateTimeout, this);
3741+ }
3742+ Q_EMIT deactivateTimeoutChanged();
3743+}
3744
3745=== added file 'src/Ubuntu/Components/plugin/ucbottomedgehint.h'
3746--- src/Ubuntu/Components/plugin/ucbottomedgehint.h 1970-01-01 00:00:00 +0000
3747+++ src/Ubuntu/Components/plugin/ucbottomedgehint.h 2015-11-17 15:49:37 +0000
3748@@ -0,0 +1,92 @@
3749+/*
3750+ * Copyright 2015 Canonical Ltd.
3751+ *
3752+ * This program is free software; you can redistribute it and/or modify
3753+ * it under the terms of the GNU Lesser General Public License as published by
3754+ * the Free Software Foundation; version 3.
3755+ *
3756+ * This program is distributed in the hope that it will be useful,
3757+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3758+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3759+ * GNU Lesser General Public License for more details.
3760+ *
3761+ * You should have received a copy of the GNU Lesser General Public License
3762+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3763+ *
3764+ * Authors: Zsombor Egri <zsombor.egri@canonical.com>
3765+ */
3766+
3767+#ifndef UCBOTTOMEDGEHINT_H
3768+#define UCBOTTOMEDGEHINT_H
3769+
3770+#include "ucstyleditembase.h"
3771+#include "privates/gesturedetector.h"
3772+
3773+class QQuickFlickable;
3774+class UCBottomEdgeHint : public UCStyledItemBase
3775+{
3776+ Q_OBJECT
3777+ Q_ENUMS(Status)
3778+ Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL)
3779+ Q_PROPERTY(QUrl iconSource MEMBER m_iconSource NOTIFY iconSourceChanged FINAL)
3780+ Q_PROPERTY(QString iconName MEMBER m_iconName NOTIFY iconNameChanged FINAL)
3781+ Q_PROPERTY(QQuickFlickable *flickable MEMBER m_flickable WRITE setFlickable NOTIFY flickableChanged FINAL)
3782+ Q_PROPERTY(Status status MEMBER m_status WRITE setStatus NOTIFY statusChanged FINAL)
3783+ Q_PROPERTY(int deactivateTimeout MEMBER m_deactivateTimeout WRITE setDeactivateTimeout NOTIFY deactivateTimeoutChanged FINAL)
3784+ // deprecated
3785+ Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
3786+public:
3787+ enum Status {
3788+ Hidden,
3789+ Inactive,
3790+ Active,
3791+ Locked
3792+ };
3793+ explicit UCBottomEdgeHint(QQuickItem *parent = 0);
3794+
3795+ void setFlickable(QQuickFlickable *flickable);
3796+ Status status();
3797+ void setStatus(Status status);
3798+
3799+ // deprecated
3800+ QString state() const;
3801+ void setState(const QString &state);
3802+ void setDeactivateTimeout(int timeout);
3803+
3804+Q_SIGNALS:
3805+ void textChanged();
3806+ void iconSourceChanged();
3807+ void iconNameChanged();
3808+ void flickableChanged();
3809+ void statusChanged();
3810+ void deactivateTimeoutChanged();
3811+
3812+ void clicked();
3813+
3814+ // deprecated
3815+ void stateChanged();
3816+protected:
3817+ void itemChange(ItemChange change, const ItemChangeData &data);
3818+ void timerEvent(QTimerEvent *event);
3819+ void keyPressEvent(QKeyEvent *event);
3820+ void touchEvent(QTouchEvent *event);
3821+ void mousePressEvent(QMouseEvent *event);
3822+ void mouseReleaseEvent(QMouseEvent *event);
3823+
3824+ void handleFlickableActivation();
3825+ void onBottomUpSwipeDetected();
3826+ void onGestureStatusChanged(GestureDetector::Status status);
3827+
3828+private:
3829+ GestureDetector m_gestureDetector;
3830+ QBasicTimer m_deactivationTimer;
3831+ QString m_text;
3832+ QUrl m_iconSource;
3833+ QString m_iconName;
3834+ QQuickFlickable *m_flickable;
3835+ int m_deactivateTimeout;
3836+ Status m_status;
3837+ bool m_pressed:1;
3838+};
3839+
3840+#endif // UCBOTTOMEDGEHINT_H
3841
3842=== modified file 'src/Ubuntu/Components/plugin/ucheader.cpp'
3843--- src/Ubuntu/Components/plugin/ucheader.cpp 2015-10-01 21:23:04 +0000
3844+++ src/Ubuntu/Components/plugin/ucheader.cpp 2015-11-17 15:49:37 +0000
3845@@ -208,6 +208,7 @@
3846 }
3847
3848 void UCHeader::show(bool animate) {
3849+ if (m_exposed && !m_moving && y() == 0.0) return;
3850 if (!m_exposed) {
3851 m_exposed = true;
3852 Q_EMIT exposedChanged();
3853@@ -233,6 +234,7 @@
3854 }
3855
3856 void UCHeader::hide(bool animate) {
3857+ if (!m_exposed && !m_moving && y() == -1.0*height()) return;
3858 if (m_exposed) {
3859 m_exposed = false;
3860 Q_EMIT exposedChanged();
3861
3862=== added file 'src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp'
3863--- src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp 1970-01-01 00:00:00 +0000
3864+++ src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp 2015-11-17 15:49:37 +0000
3865@@ -0,0 +1,58 @@
3866+/*
3867+ * Copyright 2015 Canonical Ltd.
3868+ *
3869+ * This program is free software; you can redistribute it and/or modify
3870+ * it under the terms of the GNU Lesser General Public License as published by
3871+ * the Free Software Foundation; version 3.
3872+ *
3873+ * This program is distributed in the hope that it will be useful,
3874+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3875+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3876+ * GNU Lesser General Public License for more details.
3877+ *
3878+ * You should have received a copy of the GNU Lesser General Public License
3879+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3880+ *
3881+ * Author: Zsombor Egri <zsombor.egri@canonical.com>
3882+ */
3883+
3884+#include "ucimportversionchecker_p.h"
3885+#include "ucnamespace.h"
3886+
3887+#include <QtQuick>
3888+#include <QtQml/private/qqmldata_p.h>
3889+#include <QtQml/private/qqmlcontext_p.h>
3890+#include <QtQml/private/qqmlpropertycache_p.h>
3891+#include <QtQml/private/qqmlmetatype_p.h>
3892+
3893+/*!
3894+ * \internal
3895+ *
3896+ * The function returns the version the module is imported with based on a QML
3897+ * component instance. It only checks till reaches 1.2 version. Implementations
3898+ * must implement the propertyForVersion method and must probvide a property for
3899+ * each version requested.
3900+ */
3901+quint16 UCImportVersionChecker::importVersion(QObject *object)
3902+{
3903+ QQmlData *data = QQmlData::get(object);
3904+ Q_ASSERT(data);
3905+ QQmlContextData *cdata = QQmlContextData::get(qmlContext(object));
3906+ Q_ASSERT(cdata);
3907+ QQmlEngine *engine = qmlEngine(object);
3908+ Q_ASSERT(engine);
3909+
3910+ // start from the highest available version till we reach 1.2
3911+ for (quint16 minor = MINOR_VERSION(LATEST_UITK_VERSION); minor > 2; minor--) {
3912+ quint16 version = BUILD_VERSION(1, minor);
3913+ const QString property(propertyForVersion(version));
3914+ Q_ASSERT(!property.isEmpty());
3915+ QQmlPropertyData l;
3916+ QQmlPropertyData *p = QQmlPropertyCache::property(engine, object, property, cdata, l);
3917+ if (data->propertyCache->isAllowedInRevision(p)) {
3918+ return version;
3919+ }
3920+ }
3921+ // if none found, simply fall back to 1.2
3922+ return BUILD_VERSION(1, 2);
3923+}
3924
3925=== added file 'src/Ubuntu/Components/plugin/ucimportversionchecker_p.h'
3926--- src/Ubuntu/Components/plugin/ucimportversionchecker_p.h 1970-01-01 00:00:00 +0000
3927+++ src/Ubuntu/Components/plugin/ucimportversionchecker_p.h 2015-11-17 15:49:37 +0000
3928@@ -0,0 +1,34 @@
3929+/*
3930+ * Copyright 2015 Canonical Ltd.
3931+ *
3932+ * This program is free software; you can redistribute it and/or modify
3933+ * it under the terms of the GNU Lesser General Public License as published by
3934+ * the Free Software Foundation; version 3.
3935+ *
3936+ * This program is distributed in the hope that it will be useful,
3937+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3938+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3939+ * GNU Lesser General Public License for more details.
3940+ *
3941+ * You should have received a copy of the GNU Lesser General Public License
3942+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3943+ *
3944+ * Author: Zsombor Egri <zsombor.egri@canonical.com>
3945+ */
3946+
3947+#ifndef UCIMPORTVERSIONCHECKER_P_H
3948+#define UCIMPORTVERSIONCHECKER_P_H
3949+
3950+#include <QtCore>
3951+
3952+class UCImportVersionChecker
3953+{
3954+public:
3955+ UCImportVersionChecker() {}
3956+
3957+ virtual QString propertyForVersion(quint16 version) const = 0;
3958+
3959+ virtual quint16 importVersion(QObject *object);
3960+};
3961+
3962+#endif // UCIMPORTVERSIONCHECKER_P_H
3963
3964=== modified file 'src/Ubuntu/Components/plugin/uclabel.cpp'
3965--- src/Ubuntu/Components/plugin/uclabel.cpp 2015-09-28 16:18:19 +0000
3966+++ src/Ubuntu/Components/plugin/uclabel.cpp 2015-11-17 15:49:37 +0000
3967@@ -78,6 +78,7 @@
3968 */
3969 UCLabel::UCLabel(QQuickItem* parent)
3970 : QQuickText(parent)
3971+ , UCThemingExtension(this)
3972 , m_textSize(Medium)
3973 , m_flags(0)
3974 {
3975@@ -91,7 +92,6 @@
3976
3977 void UCLabel::init()
3978 {
3979- initTheming(this);
3980 postThemeChanged();
3981 updatePixelSize();
3982 m_defaultFont = font();
3983@@ -103,13 +103,6 @@
3984 connect(this, &UCLabel::colorChanged, this, &UCLabel::_q_customColor, Qt::DirectConnection);
3985 }
3986
3987-void UCLabel::customEvent(QEvent *event)
3988-{
3989- if (UCThemeEvent::isThemeEvent(event)) {
3990- handleThemeEvent(static_cast<UCThemeEvent*>(event));
3991- }
3992-}
3993-
3994 void UCLabel::postThemeChanged()
3995 {
3996 if (m_flags & ColorSet) {
3997
3998=== modified file 'src/Ubuntu/Components/plugin/uclabel.h'
3999--- src/Ubuntu/Components/plugin/uclabel.h 2015-10-01 12:34:29 +0000
4000+++ src/Ubuntu/Components/plugin/uclabel.h 2015-11-17 15:49:37 +0000
4001@@ -23,7 +23,7 @@
4002 class UCLabel : public QQuickText, public UCThemingExtension
4003 {
4004 Q_OBJECT
4005-
4006+ Q_INTERFACES(UCThemingExtension)
4007 Q_ENUMS(TextSize)
4008 Q_PROPERTY(TextSize textSize MEMBER m_textSize WRITE setTextSize NOTIFY textSizeChanged FINAL)
4009
4010@@ -61,7 +61,6 @@
4011 protected:
4012 // from QQuickItem
4013 void classBegin();
4014- void customEvent(QEvent *event);
4015
4016 // from UCItemExtension
4017 void preThemeChanged(){}
4018
4019=== modified file 'src/Ubuntu/Components/plugin/uclistitem.cpp'
4020--- src/Ubuntu/Components/plugin/uclistitem.cpp 2015-10-12 14:32:17 +0000
4021+++ src/Ubuntu/Components/plugin/uclistitem.cpp 2015-11-17 15:49:37 +0000
4022@@ -61,7 +61,7 @@
4023 QColor colorFrom;
4024 QColor colorTo;
4025 QGradientStops gradient;
4026- UCListItemPrivate *listItem;
4027+ UCListItem *listItem;
4028 };
4029
4030 UCListItemDivider::UCListItemDivider(UCListItem *parent)
4031@@ -77,14 +77,16 @@
4032 {
4033 Q_D(UCListItemDivider);
4034 QQml_setParent_noEvent(this, listItem);
4035- d->listItem = UCListItemPrivate::get(listItem);
4036+ d->listItem = listItem;
4037 setParentItem(listItem);
4038 // anchor to left/right/bottom of the ListItem
4039 QQuickAnchors *anchors = d->anchors();
4040- anchors->setLeft(d->listItem->left());
4041- anchors->setRight(d->listItem->right());
4042- anchors->setBottom(d->listItem->bottom());
4043+ UCListItemPrivate *pListItem = UCListItemPrivate::get(listItem);
4044+ anchors->setLeft(pListItem->left());
4045+ anchors->setRight(pListItem->right());
4046+ anchors->setBottom(pListItem->bottom());
4047 // connect visible change so we relayout contentItem
4048+ // FIXME: do this with itemChange!!!
4049 connect(this, SIGNAL(visibleChanged()), listItem, SLOT(_q_relayout()));
4050 }
4051
4052@@ -132,7 +134,8 @@
4053 dividerNode = d->sceneGraphContext()->createRectangleNode();
4054 }
4055
4056- bool lastItem = d->listItem->countOwner ? (d->listItem->index() == (d->listItem->countOwner->property("count").toInt() - 1)): false;
4057+ UCListItemPrivate *pListItem = UCListItemPrivate::get(d->listItem);
4058+ bool lastItem = pListItem->countOwner ? (pListItem->index() == (pListItem->countOwner->property("count").toInt() - 1)): false;
4059 if (!lastItem && (d->gradient.size() > 0) && ((d->colorFrom.alphaF() >= (1.0f / 255.0f)) || (d->colorTo.alphaF() >= (1.0f / 255.0f)))) {
4060 dividerNode->setRect(boundingRect());
4061 dividerNode->setGradientStops(d->gradient);
4062@@ -195,6 +198,7 @@
4063 , xAxisMoveThresholdGU(DEFAULT_SWIPE_THRESHOLD_GU)
4064 , button(Qt::NoButton)
4065 , highlighted(false)
4066+ , swipeEnabled(true)
4067 , contentMoved(false)
4068 , swiped(false)
4069 , suppressClick(false)
4070@@ -1174,7 +1178,7 @@
4071 {
4072 Q_Q(UCListItem);
4073 // themes 1.2 and below should not have context menu support, so leave
4074- quint16 version(getTheme()->version());
4075+ quint16 version(importVersion(q));
4076 if (version <= BUILD_VERSION(1, 2)) {
4077 return;
4078 }
4079@@ -1252,10 +1256,15 @@
4080 // returns true if the mouse is swiped over the threshold value
4081 bool UCListItemPrivate::swipedOverThreshold(const QPointF &mousePos, const QPointF relativePos)
4082 {
4083+ if ((!leadingActions || UCListItemActionsPrivate::get(leadingActions)->actions.size() <= 0) &&
4084+ (!trailingActions || UCListItemActionsPrivate::get(trailingActions)->actions.size() <= 0))
4085+ {
4086+ return false;
4087+ }
4088 qreal threshold = UCUnits::instance().gu(xAxisMoveThresholdGU);
4089 qreal mouseX = mousePos.x();
4090 qreal pressedX = relativePos.x();
4091- return ((mouseX < (pressedX - threshold)) || (mouseX > (pressedX + threshold)));
4092+ return swipeEnabled && ((mouseX < (pressedX - threshold)) || (mouseX > (pressedX + threshold)));
4093 }
4094
4095 void UCListItem::mouseMoveEvent(QMouseEvent *event)
4096@@ -1270,7 +1279,7 @@
4097
4098 // accept the tugging only if the move is within the threshold
4099 // use saved button because MouseMove has no button() and buttons() isn't reliable
4100- if (d->button == Qt::LeftButton && d->highlighted && !d->swiped && (d->leadingActions || d->trailingActions)) {
4101+ if (d->button == Qt::LeftButton && d->highlighted && !d->swiped) {
4102 // check if we can initiate the drag at all
4103 // only X direction matters, if Y-direction leaves the threshold, but X not, the tug is not valid
4104 if (d->swipedOverThreshold(event->localPos(), d->pressedPos)) {
4105@@ -1643,7 +1652,7 @@
4106 {
4107 Q_D(UCListItem);
4108 d->customColor = false;
4109- d->highlightColor = d->getTheme()->getPaletteColor("selected", "background");
4110+ d->highlightColor = getTheme()->getPaletteColor("selected", "background");
4111 update();
4112 Q_EMIT highlightColorChanged();
4113 }
4114@@ -1794,4 +1803,49 @@
4115 }
4116 }
4117
4118+/*!
4119+ * \qmlproperty bool ListItem::swipeEnabled
4120+ * \since Ubuntu.Components 1.3
4121+ * The property enables the swiping of the leading- or trailing actions. This
4122+ * is useful when an overlay component needs to handle mouse moves or drag events
4123+ * without the ListItem to steal the events. Defaults to true.
4124+ * \qml
4125+ * import QtQuick 2.4
4126+ * import Ubuntu.Components 1.3
4127+ *
4128+ * ListView {
4129+ * width: units.gu(40)
4130+ * height: units.gu(70)
4131+ * model: 25
4132+ * delegate: ListItem {
4133+ * swipeEnabled: !mouseArea.drag.active
4134+ * Rectangle {
4135+ * color: "red"
4136+ * width: units.gu(2)
4137+ * height: width
4138+ * MouseArea {
4139+ * id: mouseArea
4140+ * anchors.fill: parent
4141+ * drag.target: parent
4142+ * }
4143+ * }
4144+ * }
4145+ * }
4146+ * \endqml
4147+ */
4148+bool UCListItem::isSwipeEnabled() const
4149+{
4150+ Q_D(const UCListItem);
4151+ return d->swipeEnabled;
4152+}
4153+void UCListItem::setSwipeEnabled(bool swipeEnabled)
4154+{
4155+ Q_D(UCListItem);
4156+ if (d->swipeEnabled == swipeEnabled) {
4157+ return;
4158+ }
4159+ d->swipeEnabled = swipeEnabled;
4160+ Q_EMIT swipeEnabledChanged();
4161+}
4162+
4163 #include "moc_uclistitem.cpp"
4164
4165=== modified file 'src/Ubuntu/Components/plugin/uclistitem.h'
4166--- src/Ubuntu/Components/plugin/uclistitem.h 2015-09-23 14:31:26 +0000
4167+++ src/Ubuntu/Components/plugin/uclistitem.h 2015-11-17 15:49:37 +0000
4168@@ -47,6 +47,7 @@
4169 Q_CLASSINFO("DefaultProperty", "listItemData")
4170 // 1.3
4171 Q_PROPERTY(UCListItemExpansion* expansion READ expansion CONSTANT REVISION 1)
4172+ Q_PROPERTY(bool swipeEnabled READ isSwipeEnabled WRITE setSwipeEnabled NOTIFY swipeEnabledChanged FINAL REVISION 1)
4173 public:
4174 explicit UCListItem(QQuickItem *parent = 0);
4175 ~UCListItem();
4176@@ -65,6 +66,8 @@
4177 void resetHighlightColor();
4178 // 1.3
4179 UCListItemExpansion *expansion();
4180+ bool isSwipeEnabled() const;
4181+ void setSwipeEnabled(bool swipeEnabled);
4182
4183 protected:
4184 virtual QObject *attachedViewItems(QObject *object, bool create);
4185@@ -92,6 +95,7 @@
4186 void selectModeChanged();
4187 void actionChanged();
4188 void listItemChildrenChanged();
4189+ Q_REVISION(1) void swipeEnabledChanged();
4190
4191 void clicked();
4192 void pressAndHold();
4193
4194=== modified file 'src/Ubuntu/Components/plugin/uclistitem_p.h'
4195--- src/Ubuntu/Components/plugin/uclistitem_p.h 2015-09-23 14:31:26 +0000
4196+++ src/Ubuntu/Components/plugin/uclistitem_p.h 2015-11-17 15:49:37 +0000
4197@@ -95,6 +95,7 @@
4198 qreal xAxisMoveThresholdGU;
4199 Qt::MouseButton button;
4200 bool highlighted:1;
4201+ bool swipeEnabled:1;
4202 bool contentMoved:1;
4203 bool swiped:1;
4204 bool suppressClick:1;
4205
4206=== modified file 'src/Ubuntu/Components/plugin/uclistitemlayout.cpp'
4207--- src/Ubuntu/Components/plugin/uclistitemlayout.cpp 2015-10-01 08:47:31 +0000
4208+++ src/Ubuntu/Components/plugin/uclistitemlayout.cpp 2015-11-17 15:49:37 +0000
4209@@ -212,16 +212,7 @@
4210 UCListItemLayout::UCListItemLayout(QQuickItem *parent)
4211 : UCSlotsLayout(parent)
4212 {
4213- //don't set the parent, we have to create qqmldata first
4214- UCThreeLabelsSlot *main = new UCThreeLabelsSlot();
4215-
4216- //create QML data for mainSlot otherwise qmlAttachedProperties
4217- //calls in SlotsLayout will fail
4218- QQmlData::get(main, true);
4219- main->setParent(this);
4220-
4221- //this will also set the parentItem
4222- UCSlotsLayout::setMainSlot(main);
4223+
4224 }
4225
4226 /*!
4227@@ -269,7 +260,25 @@
4228 return qobject_cast<UCThreeLabelsSlot *>(mainSlot())->summary();
4229 }
4230
4231-void UCListItemLayout::setMainSlot(QQuickItem *slot) {
4232+QQuickItem *UCListItemLayout::mainSlot() {
4233+ if (UCSlotsLayout::mainSlot() == Q_NULLPTR) {
4234+ //don't set the parent, we have to create qqmldata first
4235+ UCThreeLabelsSlot *main = new UCThreeLabelsSlot();
4236+
4237+ //create QML data for mainSlot otherwise qmlAttachedProperties
4238+ //calls in SlotsLayout will fail (setContextForObject will create the QQmlData)
4239+ QQmlEngine::setContextForObject(main, qmlContext(this));
4240+ main->setParent(this);
4241+
4242+ //this will also set the parentItem
4243+ UCSlotsLayout::setMainSlot(main, false);
4244+ }
4245+
4246+ return UCSlotsLayout::mainSlot();
4247+}
4248+
4249+void UCListItemLayout::setMainSlot(QQuickItem *slot, bool fireSignal) {
4250 Q_UNUSED(slot);
4251+ Q_UNUSED(fireSignal);
4252 qmlInfo(this) << "Setting a different mainSlot on ListItemLayout is not supported. Please use SlotsLayout instead.";
4253 }
4254
4255=== modified file 'src/Ubuntu/Components/plugin/uclistitemlayout.h'
4256--- src/Ubuntu/Components/plugin/uclistitemlayout.h 2015-09-30 15:53:49 +0000
4257+++ src/Ubuntu/Components/plugin/uclistitemlayout.h 2015-11-17 15:49:37 +0000
4258@@ -30,9 +30,10 @@
4259 public:
4260 explicit UCListItemLayout(QQuickItem *parent = 0);
4261
4262+ QQuickItem *mainSlot() override;
4263 //we don't allow changing the main slot on ListItemLayout because otherwise
4264 //accessing title/subtitle/summary would lead to a crash
4265- void setMainSlot(QQuickItem *slot) override;
4266+ void setMainSlot(QQuickItem *slot, bool fireSignal = true) override;
4267
4268 UCLabel *title();
4269 UCLabel *subtitle();
4270
4271=== modified file 'src/Ubuntu/Components/plugin/ucqquickimageextension.cpp'
4272--- src/Ubuntu/Components/plugin/ucqquickimageextension.cpp 2015-05-22 19:39:01 +0000
4273+++ src/Ubuntu/Components/plugin/ucqquickimageextension.cpp 2015-11-17 15:49:37 +0000
4274@@ -41,7 +41,7 @@
4275 m_image(static_cast<QQuickImageBase*>(parent))
4276 {
4277 QObject::connect(&UCUnits::instance(), SIGNAL(gridUnitChanged()),
4278- this, SLOT(reloadSource()), Qt::UniqueConnection);
4279+ this, SLOT(reloadSource()));
4280 // connect sourceChanged signal to extendedSourceChanged
4281 QObject::connect(m_image, &QQuickImageBase::sourceChanged,
4282 this, &UCQQuickImageExtension::extendedSourceChanged);
4283
4284=== modified file 'src/Ubuntu/Components/plugin/ucslotslayout.cpp'
4285--- src/Ubuntu/Components/plugin/ucslotslayout.cpp 2015-10-12 14:32:17 +0000
4286+++ src/Ubuntu/Components/plugin/ucslotslayout.cpp 2015-11-17 15:49:37 +0000
4287@@ -990,13 +990,18 @@
4288 }
4289 \endqml
4290 */
4291+QQuickItem *UCSlotsLayout::mainSlot()
4292+{
4293+ Q_D(const UCSlotsLayout);
4294+ return d->mainSlot;
4295+}
4296 QQuickItem *UCSlotsLayout::mainSlot() const
4297 {
4298 Q_D(const UCSlotsLayout);
4299 return d->mainSlot;
4300 }
4301
4302-void UCSlotsLayout::setMainSlot(QQuickItem *item)
4303+void UCSlotsLayout::setMainSlot(QQuickItem *item, bool fireSignal)
4304 {
4305 Q_D(UCSlotsLayout);
4306 if (d->mainSlot != item && item != Q_NULLPTR) {
4307@@ -1008,7 +1013,10 @@
4308 }
4309 d->mainSlot = item;
4310 d->mainSlot->setParentItem(this);
4311- Q_EMIT mainSlotChanged();
4312+
4313+ if (fireSignal) {
4314+ Q_EMIT mainSlotChanged();
4315+ }
4316 }
4317 }
4318
4319
4320=== modified file 'src/Ubuntu/Components/plugin/ucslotslayout.h'
4321--- src/Ubuntu/Components/plugin/ucslotslayout.h 2015-09-30 15:53:49 +0000
4322+++ src/Ubuntu/Components/plugin/ucslotslayout.h 2015-11-17 15:49:37 +0000
4323@@ -36,8 +36,9 @@
4324 public:
4325 explicit UCSlotsLayout(QQuickItem *parent = 0);
4326
4327- QQuickItem *mainSlot() const;
4328- virtual void setMainSlot(QQuickItem *item);
4329+ virtual QQuickItem *mainSlot();
4330+ virtual QQuickItem *mainSlot() const;
4331+ virtual void setMainSlot(QQuickItem *item, bool fireSignal = true);
4332
4333 UCSlotsLayoutPadding *padding();
4334
4335
4336=== modified file 'src/Ubuntu/Components/plugin/ucstyleditembase.cpp'
4337--- src/Ubuntu/Components/plugin/ucstyleditembase.cpp 2015-10-06 07:16:37 +0000
4338+++ src/Ubuntu/Components/plugin/ucstyleditembase.cpp 2015-11-17 15:49:37 +0000
4339@@ -28,7 +28,7 @@
4340 UCStyledItemBasePrivate::UCStyledItemBasePrivate()
4341 : styleComponent(Q_NULLPTR)
4342 , styleItem(Q_NULLPTR)
4343- , styleVersion(LATEST_UITK_VERSION)
4344+ , styleVersion(0)
4345 , activeFocusOnPress(false)
4346 , wasStyleLoaded(false)
4347 {
4348@@ -108,6 +108,7 @@
4349 */
4350 UCStyledItemBase::UCStyledItemBase(QQuickItem *parent)
4351 : QQuickItem(*(new UCStyledItemBasePrivate), parent)
4352+ , UCThemingExtension(this)
4353 {
4354 Q_D(UCStyledItemBase);
4355 d->init();
4356@@ -115,6 +116,7 @@
4357
4358 UCStyledItemBase::UCStyledItemBase(UCStyledItemBasePrivate &dd, QQuickItem *parent)
4359 : QQuickItem(dd, parent)
4360+ , UCThemingExtension(this)
4361 {
4362 Q_D(UCStyledItemBase);
4363 d->init();
4364@@ -308,7 +310,7 @@
4365 // either styleComponent or styleName is valid
4366 QQmlComponent *component = styleComponent;
4367 if (!component) {
4368- component = getTheme()->createStyleComponent(styleDocument + ".qml", q, styleVersion);
4369+ component = q->getTheme()->createStyleComponent(styleDocument + ".qml", q, styleVersion);
4370 }
4371 if (!component) {
4372 return false;
4373@@ -442,41 +444,38 @@
4374 * if any, or to the system default theme.
4375 */
4376
4377-void UCStyledItemBasePrivate::preThemeChanged()
4378+void UCStyledItemBase::preThemeChanged()
4379 {
4380- wasStyleLoaded = (styleItem != Q_NULLPTR);
4381- preStyleChanged();
4382+ Q_D(UCStyledItemBase);
4383+ d->wasStyleLoaded = (d->styleItem != Q_NULLPTR);
4384+ d->preStyleChanged();
4385 }
4386-void UCStyledItemBasePrivate::postThemeChanged()
4387+void UCStyledItemBase::postThemeChanged()
4388 {
4389- Q_EMIT q_func()->themeChanged();
4390- if (!wasStyleLoaded) {
4391+ Q_EMIT themeChanged();
4392+ Q_D(UCStyledItemBase);
4393+ if (!d->wasStyleLoaded) {
4394 return;
4395 }
4396- postStyleChanged();
4397- loadStyleItem();
4398+ d->postStyleChanged();
4399+ d->loadStyleItem();
4400 }
4401
4402-void UCStyledItemBase::classBegin()
4403+QString UCStyledItemBasePrivate::propertyForVersion(quint16 version) const
4404 {
4405- QQuickItem::classBegin();
4406- d_func()->initTheming(this);
4407+ switch (MINOR_VERSION(version)) {
4408+ case 3: return QStringLiteral("theme");
4409+ default: return QString();
4410+ }
4411 }
4412
4413 void UCStyledItemBase::componentComplete()
4414 {
4415 QQuickItem::componentComplete();
4416 Q_D(UCStyledItemBase);
4417-
4418- QQmlData *data = QQmlData::get(this);
4419- QQmlContextData *cdata = QQmlContextData::get(qmlContext(this));
4420- QQmlPropertyData l;
4421- QQmlPropertyData *pdata = QQmlPropertyCache::property(qmlEngine(this), this, QStringLiteral("theme"), cdata, l);
4422- // FIXME MainView internal styler uses theme property, meaning imports13 will be true,
4423- // therefore we must check the type of the property as well in case anyone else overrides it
4424- d->styleVersion = data->propertyCache->isAllowedInRevision(pdata) && (property("theme").type() != QVariant::String)
4425- ? BUILD_VERSION(1, 3)
4426- : BUILD_VERSION(1, 2);
4427+ // make sure the theme version is up to date
4428+ d->styleVersion = d->importVersion(this);
4429+ UCTheme::checkMixedVersionImports(this, d->styleVersion);
4430 // no animation at this time
4431 // prepare style context if not been done yet
4432 d->postStyleChanged();
4433@@ -509,13 +508,4 @@
4434 return QQuickItem::childMouseEventFilter(child, event);
4435 }
4436
4437-// catch UCThemeEvent
4438-void UCStyledItemBase::customEvent(QEvent *event)
4439-{
4440- Q_D(UCStyledItemBase);
4441- if (UCThemeEvent::isThemeEvent(event)) {
4442- d->handleThemeEvent(static_cast<UCThemeEvent*>(event));
4443- }
4444-}
4445-
4446 #include "moc_ucstyleditembase.cpp"
4447
4448=== modified file 'src/Ubuntu/Components/plugin/ucstyleditembase.h'
4449--- src/Ubuntu/Components/plugin/ucstyleditembase.h 2015-09-14 11:26:44 +0000
4450+++ src/Ubuntu/Components/plugin/ucstyleditembase.h 2015-11-17 15:49:37 +0000
4451@@ -20,20 +20,22 @@
4452 #define UCSTYLEDITEMBASE_H
4453
4454 #include <QtQuick/QQuickItem>
4455+#include "ucthemingextension.h"
4456
4457 class UCStyledItemBasePrivate;
4458 class UCTheme;
4459 class UCStyleHints;
4460-class UCStyledItemBase : public QQuickItem
4461+class UCStyledItemBase : public QQuickItem, public UCThemingExtension
4462 {
4463 Q_OBJECT
4464+ Q_INTERFACES(UCThemingExtension)
4465 Q_PROPERTY(bool activeFocusOnPress
4466 READ activefocusOnPress WRITE setActiveFocusOnPress
4467 NOTIFY activeFocusOnPressChanged REVISION 1)
4468 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QQmlComponent *style READ style WRITE setStyle RESET resetStyle NOTIFY styleChanged FINAL DESIGNABLE false)
4469 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QQuickItem *__styleInstance READ styleInstance NOTIFY styleInstanceChanged FINAL DESIGNABLE false)
4470 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QString styleName READ styleName WRITE setStyleName NOTIFY styleNameChanged FINAL REVISION 2)
4471- Q_PRIVATE_PROPERTY(d_func(), UCTheme *theme READ getTheme WRITE setTheme RESET resetTheme NOTIFY themeChanged FINAL REVISION 2)
4472+ Q_PROPERTY(UCTheme *theme READ getTheme WRITE setTheme RESET resetTheme NOTIFY themeChanged FINAL REVISION 2)
4473 public:
4474 explicit UCStyledItemBase(QQuickItem *parent = 0);
4475
4476@@ -53,11 +55,13 @@
4477 protected:
4478 UCStyledItemBase(UCStyledItemBasePrivate &, QQuickItem *parent);
4479
4480- void classBegin();
4481+ // from UCThemingExtension interface
4482+ virtual void preThemeChanged();
4483+ virtual void postThemeChanged();
4484+
4485 void componentComplete();
4486 void mousePressEvent(QMouseEvent *event);
4487 bool childMouseEventFilter(QQuickItem *child, QEvent *event);
4488- void customEvent(QEvent *event);
4489
4490 private:
4491 Q_DECLARE_PRIVATE(UCStyledItemBase)
4492
4493=== modified file 'src/Ubuntu/Components/plugin/ucstyleditembase_p.h'
4494--- src/Ubuntu/Components/plugin/ucstyleditembase_p.h 2015-10-06 07:16:37 +0000
4495+++ src/Ubuntu/Components/plugin/ucstyleditembase_p.h 2015-11-17 15:49:37 +0000
4496@@ -22,11 +22,13 @@
4497 #include <QtQuick/private/qquickitem_p.h>
4498 #include "ucstyleditembase.h"
4499 #include "ucthemingextension.h"
4500+#include "ucimportversionchecker_p.h"
4501
4502 class QQuickMouseArea;
4503 class UCStyledItemBase;
4504-class UCStyledItemBasePrivate : public QQuickItemPrivate, public UCThemingExtension
4505+class UCStyledItemBasePrivate : public QQuickItemPrivate, public UCImportVersionChecker
4506 {
4507+ Q_INTERFACES(UCThemingExtension)
4508 Q_DECLARE_PUBLIC(UCStyledItemBase)
4509 public:
4510
4511@@ -55,8 +57,8 @@
4512 virtual void postStyleChanged() {}
4513 virtual bool loadStyleItem(bool animated = true);
4514
4515- virtual void preThemeChanged();
4516- virtual void postThemeChanged();
4517+ // from UCImportVersionChecker
4518+ virtual QString propertyForVersion(quint16 version) const;
4519
4520 public:
4521
4522
4523=== modified file 'src/Ubuntu/Components/plugin/uctheme.cpp'
4524--- src/Ubuntu/Components/plugin/uctheme.cpp 2015-09-21 13:29:17 +0000
4525+++ src/Ubuntu/Components/plugin/uctheme.cpp 2015-11-17 15:49:37 +0000
4526@@ -44,6 +44,8 @@
4527 #include <QtQml/private/qqmlbinding_p.h>
4528 #undef foreach
4529
4530+
4531+quint16 UCTheme::previousVersion = 0;
4532 /*!
4533 * \qmltype ThemeSettings
4534 * \instantiates UCTheme
4535@@ -345,7 +347,6 @@
4536 : QObject(parent)
4537 , m_palette(UCTheme::defaultTheme().m_palette)
4538 , m_engine(UCTheme::defaultTheme().m_engine)
4539- , m_version(UCTheme::defaultTheme().m_version)
4540 , m_defaultStyle(false)
4541 {
4542 init();
4543@@ -355,7 +356,6 @@
4544 : QObject(parent)
4545 , m_palette(NULL)
4546 , m_engine(NULL)
4547- , m_version(LATEST_UITK_VERSION)
4548 , m_defaultStyle(defaultStyle)
4549 {
4550 init();
4551@@ -460,6 +460,7 @@
4552 }
4553 loadPalette();
4554 Q_EMIT nameChanged();
4555+ updateThemedItems();
4556 }
4557 void UCTheme::resetName()
4558 {
4559@@ -625,52 +626,41 @@
4560
4561 void UCTheme::attachItem(QQuickItem *item, bool attach)
4562 {
4563- UCItemAttached *theming = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(item, false));
4564- if (!theming) {
4565- return;
4566- }
4567 if (attach) {
4568- connect(this, SIGNAL(nameChanged()), theming, SLOT(reloadTheme()), Qt::DirectConnection);
4569- connect(this, SIGNAL(versionChanged()), theming, SLOT(reloadTheme()), Qt::DirectConnection);
4570+ m_attachedItems.append(item);
4571 } else {
4572- disconnect(this, SIGNAL(nameChanged()), theming, SLOT(reloadTheme()));
4573- disconnect(this, SIGNAL(versionChanged()), theming, SLOT(reloadTheme()));
4574- }
4575-}
4576-
4577-/*!
4578- * \qmlproperty uint16 ThemeSettings::version
4579- * \since Ubuntu.Components 1.3
4580- * The property specifies the version of the toolkit the component is declared.
4581- * This equivalent with the toolkit version the component document imports. Themes,
4582- * starting of version 1.3, should follow the same versioning as the toolkit does.
4583- * If a component's style is not found under the given version, styling will try
4584- * to locate the style with a lower minor version until it finds a match.
4585- *
4586- * The current version of an imported toolkit module is reported by the
4587- * \l Ubuntu::toolkitVersion property. If a document imports Ubuntu.Components 1.2,
4588- * the components will load the system or application themes associated to that
4589- * version, and \l Ubuntu::toolkitVersion will report that version. If the document
4590- * imports 1.3 version, the components will load 1.3 themes. Setting this property
4591- * will initiate a full theme reload.
4592- *
4593- * Usually developers do not need to set this property on toolkit components as
4594- * those already set the version. However themes provided by applications should
4595- * take care of versioning the styles and on how to do theming.
4596- *
4597- * \sa Ubuntu::toolkitVersion, Ubuntu::version, {Themes}
4598+ m_attachedItems.removeOne(item);
4599+ }
4600+}
4601+
4602+void UCTheme::updateThemedItems()
4603+{
4604+ for (int i = 0; i < m_attachedItems.count(); i++) {
4605+ UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(m_attachedItems[i]);
4606+ if (extension) {
4607+ extension->itemThemeReloaded(this);
4608+ }
4609+ }
4610+}
4611+
4612+/*
4613+ * Updates the version used by the toolkit/application
4614 */
4615-quint16 UCTheme::version()
4616-{
4617- return m_version;
4618-}
4619-void UCTheme::setVersion(quint16 version)
4620-{
4621- if (m_version == version) {
4622- return;
4623+void UCTheme::checkMixedVersionImports(QQuickItem *item, quint16 version)
4624+{
4625+ static bool wasShown = false;
4626+ if (version != previousVersion && previousVersion && !wasShown) {
4627+ // the first change is due to the first import detection, any further changes would mean there are
4628+ // multiple version imports
4629+ QString msg = QStringLiteral("Mixing of Ubuntu.Components module versions %1.%2 and %3.%4 detected!")
4630+ .arg(MAJOR_VERSION(version))
4631+ .arg(MINOR_VERSION(version))
4632+ .arg(MAJOR_VERSION(previousVersion))
4633+ .arg(MINOR_VERSION(previousVersion));
4634+ qmlInfo(item) << msg;
4635+ wasShown = true;
4636 }
4637- m_version = version;
4638- Q_EMIT versionChanged();
4639+ previousVersion = version;
4640 }
4641
4642 /*
4643@@ -680,10 +670,7 @@
4644 QQmlComponent* UCTheme::createStyleComponent(const QString& styleName, QObject* parent, quint16 version)
4645 {
4646 QQmlComponent *component = NULL;
4647-
4648- if (!version) {
4649- version = m_version;
4650- }
4651+ Q_ASSERT(version);
4652
4653 if (parent != NULL) {
4654 QQmlEngine* engine = qmlEngine(parent);
4655@@ -732,7 +719,7 @@
4656 m_palette = 0;
4657 }
4658 // theme may not have palette defined
4659- QUrl paletteUrl = styleUrl("Palette.qml", m_version);
4660+ QUrl paletteUrl = styleUrl("Palette.qml", previousVersion ? previousVersion : LATEST_UITK_VERSION);
4661 if (paletteUrl.isValid()) {
4662 m_palette = QuickUtils::instance().createQmlObject(paletteUrl, m_engine);
4663 if (m_palette) {
4664
4665=== modified file 'src/Ubuntu/Components/plugin/uctheme.h'
4666--- src/Ubuntu/Components/plugin/uctheme.h 2015-09-21 07:21:36 +0000
4667+++ src/Ubuntu/Components/plugin/uctheme.h 2015-11-17 15:49:37 +0000
4668@@ -28,6 +28,8 @@
4669 #include <QtQml/QQmlParserStatus>
4670 #include <QtQml/QQmlProperty>
4671
4672+#include <QtQml/private/qpodvector_p.h>
4673+
4674 #include "ucdefaulttheme.h"
4675
4676 class UCStyledItemBase;
4677@@ -40,8 +42,9 @@
4678 Q_PROPERTY(UCTheme *parentTheme READ parentTheme NOTIFY parentThemeChanged FINAL)
4679 Q_PROPERTY(QString name READ name WRITE setName RESET resetName NOTIFY nameChanged FINAL)
4680 Q_PROPERTY(QObject* palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged FINAL)
4681- Q_PROPERTY(quint16 version READ version WRITE setVersion NOTIFY versionChanged FINAL)
4682 public:
4683+
4684+ static quint16 previousVersion;
4685 struct ThemeRecord {
4686 ThemeRecord() :
4687 shared(false), deprecated(false)
4688@@ -75,8 +78,7 @@
4689 void resetName();
4690 QObject* palette();
4691 void setPalette(QObject *config);
4692- quint16 version();
4693- void setVersion(quint16 version);
4694+ static void checkMixedVersionImports(QQuickItem *item, quint16 version);
4695
4696 // internal, used by the deprecated Theme.createStyledComponent()
4697 QQmlComponent* createStyleComponent(const QString& styleName, QObject* parent, quint16 version = 0);
4698@@ -110,6 +112,7 @@
4699 void updateThemePaths();
4700 QUrl styleUrl(const QString& styleName, quint16 version, bool *isFallback = NULL);
4701 void loadPalette(bool notify = true);
4702+ void updateThemedItems();
4703
4704 class PaletteConfig
4705 {
4706@@ -161,8 +164,8 @@
4707 QPointer<QObject> m_palette; // the palette might be from the default style if the theme doesn't define palette
4708 QList<ThemeRecord> m_themePaths;
4709 UCDefaultTheme m_defaultTheme;
4710+ QPODVector<QQuickItem*, 4> m_attachedItems;
4711 QQmlEngine *m_engine;
4712- quint16 m_version;
4713 bool m_defaultStyle:1;
4714 bool m_completed:1;
4715
4716
4717=== modified file 'src/Ubuntu/Components/plugin/ucthemingextension.cpp'
4718--- src/Ubuntu/Components/plugin/ucthemingextension.cpp 2015-10-08 10:48:10 +0000
4719+++ src/Ubuntu/Components/plugin/ucthemingextension.cpp 2015-11-17 15:49:37 +0000
4720@@ -23,103 +23,85 @@
4721 #include <QtGui/QGuiApplication>
4722
4723 /*
4724- * The UCThemingExtension class provides theme handling on Items extending an existing
4725+ * The UCThemingExtension interface provides theme handling on Items extending an existing
4726 * QQuickItem derivate class. Items subject fo theming should derive from this class
4727- * and implement the virtual methods, as well as add the following two methods:
4728- * 1) classBegin(item) should be called from the QQuickItem::classBegin() method
4729- * 2) handleThemeEvent() should be called from QQuickItem::customEvent() method
4730+ * and implement the pure virtual methods.
4731 * The item can expose the theme property and use the getters defined by the
4732 * class.
4733- * Iin case the item exposes the theme property, it can use the getters from the
4734+ * In case the item exposes the theme property, it can use the getters from the
4735 * extension and declare the themeChanged signal.
4736 */
4737
4738-static int themeUpdatedId = QEvent::registerEventType();
4739-static int themeReloadedId = QEvent::registerEventType();
4740-
4741-UCThemeEvent::UCThemeEvent(UCTheme *reloadedTheme)
4742- : QEvent((QEvent::Type)themeReloadedId)
4743- , m_oldTheme(Q_NULLPTR)
4744- , m_newTheme(reloadedTheme)
4745-{
4746- setAccepted(false);
4747-}
4748-
4749-UCThemeEvent::UCThemeEvent(UCTheme *oldTheme, UCTheme *newTheme)
4750- : QEvent((QEvent::Type)themeUpdatedId)
4751- , m_oldTheme(oldTheme)
4752- , m_newTheme(newTheme)
4753-{
4754- setAccepted(false);
4755-}
4756-
4757-UCThemeEvent::UCThemeEvent(const UCThemeEvent &other)
4758- : QEvent(other.type())
4759- , m_oldTheme(other.m_oldTheme)
4760- , m_newTheme(other.m_newTheme)
4761-{
4762- setAccepted(false);
4763-}
4764-
4765-bool UCThemeEvent::isThemeEvent(const QEvent *event)
4766-{
4767- return ((int)event->type() == themeUpdatedId) || ((int)event->type() == themeReloadedId);
4768-}
4769-
4770-void UCThemingExtension::forwardEvent(QQuickItem *item, UCThemeEvent *event)
4771-{
4772- Q_FOREACH(QQuickItem *child, item->childItems()) {
4773- QGuiApplication::sendEvent(child, event);
4774- // StyledItem will handle the broadcast itself depending on whether the theme change was appropriate or not
4775- // and will complete the ascendantStyled/theme itself
4776- if (child->childItems().size() > 0 && !UCItemAttached::isThemed(child)) {
4777- forwardEvent(child, event);
4778- }
4779- }
4780-}
4781-
4782-void UCThemingExtension::broadcastThemeChange(QQuickItem *item, UCTheme *oldTheme, UCTheme *newTheme)
4783-{
4784- UCThemeEvent event(oldTheme, newTheme);
4785- forwardEvent(item, &event);
4786-}
4787-
4788-void UCThemingExtension::broadcastThemeReloaded(QQuickItem *item, UCTheme *theme)
4789-{
4790- UCThemeEvent event(theme);
4791- forwardEvent(item, &event);
4792+void notifyThemeChange(QQuickItem *item, UCTheme *oldTheme, UCTheme *newTheme)
4793+{
4794+ Q_FOREACH(QQuickItem *child, item->childItems()) {
4795+ UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(child);
4796+ if (extension) {
4797+ extension->itemThemeChanged(oldTheme, newTheme);
4798+ }
4799+ // StyledItem will handle the broadcast itself depending on whether the theme change was appropriate or not
4800+ // and will complete the ascendantStyled/theme itself
4801+ if (!extension) {
4802+ notifyThemeChange(child, oldTheme, newTheme);
4803+ }
4804+ }
4805+}
4806+
4807+void notifyThemeReloaded(QQuickItem *item, UCTheme *theme)
4808+{
4809+ Q_FOREACH(QQuickItem *child, item->childItems()) {
4810+ UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(child);
4811+ if (extension) {
4812+ extension->itemThemeReloaded(theme);
4813+ }
4814+ // StyledItem will handle the broadcast itself depending on whether the theme change was appropriate or not
4815+ // and will complete the ascendantStyled/theme itself
4816+ if (!extension) {
4817+ notifyThemeReloaded(child, theme);
4818+ }
4819+ }
4820 }
4821
4822 /*************************************************************************
4823 * Attached to every Item in the system
4824 */
4825-UCItemAttached::UCItemAttached(QObject *owner)
4826- : QObject(owner)
4827- , m_item(static_cast<QQuickItem*>(owner))
4828+static uint xdata = QObject::registerUserData();
4829+class UCItemAttached : public QObjectUserData, public QQuickItemChangeListener
4830+{
4831+public:
4832+ explicit UCItemAttached(QQuickItem *owner = 0);
4833+ ~UCItemAttached();
4834+
4835+ QQuickItem *m_item;
4836+ QQuickItem *m_prevParent;
4837+
4838+ void itemParentChanged(QQuickItem *item, QQuickItem *newParent);
4839+
4840+private:
4841+
4842+ friend class UCThemingExtension;
4843+};
4844+
4845+UCItemAttached::UCItemAttached(QQuickItem *owner)
4846+ : m_item(owner)
4847 , m_prevParent(Q_NULLPTR)
4848- , m_extension(Q_NULLPTR)
4849 {
4850- // get parent item changes
4851- connect(m_item, &QQuickItem::parentChanged, this, &UCItemAttached::handleParentChanged);
4852+ QQuickItemPrivate::get(m_item)->addItemChangeListener(this, QQuickItemPrivate::Parent);
4853 }
4854
4855 UCItemAttached::~UCItemAttached()
4856 {
4857-}
4858-
4859-UCItemAttached *UCItemAttached::qmlAttachedProperties(QObject *owner)
4860-{
4861- return new UCItemAttached(owner);
4862-}
4863-
4864-bool UCItemAttached::isThemed(QQuickItem *item)
4865-{
4866- UCItemAttached *attached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(item, false));
4867- return attached && (attached->m_extension != Q_NULLPTR);
4868+ QQuickItemPrivate::get(m_item)->removeItemChangeListener(this, QQuickItemPrivate::Parent);
4869+}
4870+
4871+bool UCThemingExtension::isThemed(QQuickItem *item)
4872+{
4873+ UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(item);
4874+ return extension != Q_NULLPTR;
4875 }
4876
4877 // handle parent changes
4878-void UCItemAttached::handleParentChanged(QQuickItem *newParent)
4879+void UCItemAttached::itemParentChanged(QQuickItem *, QQuickItem *newParent)
4880 {
4881 if (newParent == m_prevParent || QQuickItemPrivate::get(m_item)->wasDeleted) {
4882 return;
4883@@ -128,45 +110,43 @@
4884 // make sure we have these handlers attached to each intermediate item
4885 QQuickItem *oldThemedAscendant = UCThemingExtension::ascendantThemed(m_prevParent);
4886 QQuickItem *newThemedAscendant = UCThemingExtension::ascendantThemed(newParent);
4887- UCItemAttached *oldAscendantAttached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(oldThemedAscendant, false));
4888- UCItemAttached *newAscendantAttached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(newThemedAscendant, false));
4889- UCThemingExtension *oldAscendantExtension = oldAscendantAttached ? oldAscendantAttached->m_extension : Q_NULLPTR;
4890- UCThemingExtension *newAscendantExtension = newAscendantAttached ? newAscendantAttached->m_extension : Q_NULLPTR;
4891- UCTheme *oldTheme = oldAscendantExtension ? oldAscendantExtension->getTheme() : &UCTheme::defaultTheme();
4892- UCTheme *newTheme = newAscendantExtension ? newAscendantExtension->getTheme() : &UCTheme::defaultTheme();
4893+ UCThemingExtension *oldExtension = qobject_cast<UCThemingExtension*>(oldThemedAscendant);
4894+ UCThemingExtension *newExtension = qobject_cast<UCThemingExtension*>(newThemedAscendant);
4895+ UCTheme *oldTheme = oldExtension ? oldExtension->getTheme() : &UCTheme::defaultTheme();
4896+ UCTheme *newTheme = newExtension ? newExtension->getTheme() : &UCTheme::defaultTheme();
4897
4898 if (oldTheme != newTheme) {
4899+ UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(m_item);
4900 // send the event to m_item first
4901- UCThemeEvent event(oldTheme, newTheme);
4902- if (m_extension) {
4903+ if (extension) {
4904 // only items with extensions should get this event
4905- m_extension->handleThemeEvent(&event);
4906+ extension->itemThemeChanged(oldTheme, newTheme);
4907 }
4908 // then broadcast to children, but only if the item is not a styled one
4909- if (!m_extension) {
4910- UCThemingExtension::forwardEvent(m_item, &event);
4911+ if (!extension) {
4912+ notifyThemeChange(m_item, oldTheme, newTheme);
4913 }
4914 }
4915 m_prevParent = newParent;
4916 }
4917
4918-void UCItemAttached::reloadTheme()
4919-{
4920- Q_ASSERT(m_extension);
4921- m_extension->preThemeChanged();
4922- m_extension->postThemeChanged();
4923- UCThemingExtension::broadcastThemeReloaded(m_item, static_cast<UCTheme*>(sender()));
4924-}
4925-
4926 /*************************************************************************
4927 *
4928 */
4929-UCThemingExtension::UCThemingExtension()
4930- : themedItem(Q_NULLPTR)
4931- , attachedThemer(Q_NULLPTR)
4932- , theme(&UCTheme::defaultTheme())
4933+UCThemingExtension::UCThemingExtension(QQuickItem *extendedItem)
4934+ : theme(&UCTheme::defaultTheme())
4935+ , themedItem(extendedItem)
4936 , themeType(Inherited)
4937 {
4938+ theme->attachItem(themedItem, true);
4939+ themedItem->setUserData(xdata, new UCItemAttached(themedItem));
4940+}
4941+
4942+UCThemingExtension::~UCThemingExtension()
4943+{
4944+ if (theme) {
4945+ theme->attachItem(themedItem, false);
4946+ }
4947 }
4948
4949 // set the parent of the theme if the themeType is Custom
4950@@ -176,47 +156,50 @@
4951 return;
4952 }
4953 QQuickItem *upperThemed = ascendantThemed(QQuickItemPrivate::get(themedItem)->parentItem);
4954- UCItemAttached *attached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(upperThemed));
4955- UCTheme *parentTheme = (attached && attached->m_extension) ? attached->m_extension->getTheme() : &UCTheme::defaultTheme();
4956+ UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(upperThemed);
4957+ UCTheme *parentTheme = extension ? extension->getTheme() : &UCTheme::defaultTheme();
4958 if (parentTheme != theme) {
4959 theme->setParentTheme(parentTheme);
4960 }
4961 }
4962
4963-void UCThemingExtension::initTheming(QQuickItem *item)
4964+void UCThemingExtension::itemThemeChanged(UCTheme*, UCTheme *newTheme)
4965 {
4966- themedItem = item;
4967- attachedThemer = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(themedItem));
4968- Q_ASSERT(attachedThemer);
4969- attachedThemer->m_extension = this;
4970- theme->attachItem(item, true);
4971+ switch (themeType) {
4972+ case Inherited: {
4973+ setTheme(newTheme, Inherited);
4974+ return;
4975+ }
4976+ case Custom: {
4977+ // set the theme's parent
4978+ theme->setParentTheme(newTheme);
4979+ return;
4980+ }
4981+ default: break;
4982+ }
4983 }
4984
4985-void UCThemingExtension::handleThemeEvent(UCThemeEvent *event)
4986+void UCThemingExtension::itemThemeReloaded(UCTheme *theme)
4987 {
4988- if ((int)event->type() == themeUpdatedId) {
4989- switch (themeType) {
4990- case Inherited: {
4991- setTheme(event->newTheme(), Inherited);
4992- return;
4993- }
4994- case Custom: {
4995- // set the theme's parent
4996- theme->setParentTheme(event->newTheme());
4997- return;
4998- }
4999- default: break;
5000- }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: