Merge lp:~tpeeters/ubuntu-ui-toolkit/fix-header-ap-landing into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Superseded
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/fix-header-ap-landing
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 19519 lines (+13595/-1705)
235 files modified
components.api (+148/-83)
debian/changelog (+101/-0)
debian/control (+24/-0)
debian/libubuntugestures-dev.install (+28/-0)
debian/libubuntugestures.install (+1/-0)
documentation/overview.qdoc (+7/-0)
examples/ubuntu-ui-toolkit-gallery/About.qml (+2/-3)
examples/ubuntu-ui-toolkit-gallery/BottomEdgePage.qml (+158/-14)
examples/ubuntu-ui-toolkit-gallery/Gallery.pro (+1/-0)
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 (+106/-85)
examples/ubuntu-ui-toolkit-gallery/Sections.qml (+7/-1)
examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml (+144/-0)
examples/ubuntu-ui-toolkit-gallery/Template.qml (+18/-7)
examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+7/-2)
examples/ubuntu-ui-toolkit-gallery/gallery (+2/-2)
examples/ubuntu-ui-toolkit-gallery/gallery-logging.config (+5/-0)
examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro (+3/-2)
export_modules_dir.sh (+4/-2)
features/ubuntu_qml_plugin.prf (+14/-0)
features/ubuntu_qt_module.prf (+22/-0)
gallery.sh (+0/-2)
src/Ubuntu/Components/1.2/DraggingArea.qml (+2/-2)
src/Ubuntu/Components/1.2/MainViewBase.qml (+4/-4)
src/Ubuntu/Components/1.2/Slider.qml (+0/-1)
src/Ubuntu/Components/1.2/TextArea.qml (+1/-2)
src/Ubuntu/Components/1.2/mathUtils.js (+0/-61)
src/Ubuntu/Components/1.2/scrollbarUtils.js (+0/-129)
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+82/-8)
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/DraggingArea.qml (+1/-0)
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 (+90/-18)
src/Ubuntu/Components/1.3/PageStack.qml (+18/-0)
src/Ubuntu/Components/1.3/PageTreeNode.qml (+0/-6)
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 (+3/-4)
src/Ubuntu/Components/1.3/TabBar.qml (+0/-1)
src/Ubuntu/Components/1.3/TextArea.qml (+9/-2)
src/Ubuntu/Components/1.3/TextCursor.qml (+0/-1)
src/Ubuntu/Components/1.3/TextField.qml (+14/-2)
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/1.3/mathUtils.js (+0/-61)
src/Ubuntu/Components/ComponentModule.pro (+1/-6)
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.2/Dialog.qml (+4/-1)
src/Ubuntu/Components/Popups/1.3/Dialog.qml (+4/-2)
src/Ubuntu/Components/Popups/1.3/Popover.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/SheetBase.qml (+0/-1)
src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml (+1/-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.2/ScrollbarStyle.qml (+88/-11)
src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml (+149/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeStyle.qml (+118/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+10/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+10/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml (+88/-11)
src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js (+0/-139)
src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro (+5/-1)
src/Ubuntu/Components/Themes/Ambiance/qmldir (+2/-1)
src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp (+46/-0)
src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h (+52/-0)
src/Ubuntu/Components/plugin/gestures/damper.cpp (+24/-0)
src/Ubuntu/Components/plugin/gestures/damper.h (+89/-0)
src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h (+24/-0)
src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp (+958/-0)
src/Ubuntu/Components/plugin/gestures/ucswipearea.h (+98/-0)
src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h (+157/-0)
src/Ubuntu/Components/plugin/i18n.cpp (+6/-0)
src/Ubuntu/Components/plugin/plugin.cpp (+12/-1)
src/Ubuntu/Components/plugin/plugin.pri (+22/-4)
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/ucabstractbutton.cpp (+1/-0)
src/Ubuntu/Components/plugin/ucaction.h (+6/-5)
src/Ubuntu/Components/plugin/ucbottomedge.cpp (+1077/-0)
src/Ubuntu/Components/plugin/ucbottomedge.h (+120/-0)
src/Ubuntu/Components/plugin/ucbottomedge_p.h (+112/-0)
src/Ubuntu/Components/plugin/ucbottomedgehint.cpp (+410/-0)
src/Ubuntu/Components/plugin/ucbottomedgehint.h (+100/-0)
src/Ubuntu/Components/plugin/ucbottomedgeregion.cpp (+253/-0)
src/Ubuntu/Components/plugin/ucbottomedgeregion.h (+78/-0)
src/Ubuntu/Components/plugin/ucbottomedgestyle.cpp (+65/-0)
src/Ubuntu/Components/plugin/ucbottomedgestyle.h (+60/-0)
src/Ubuntu/Components/plugin/ucheader.cpp (+7/-2)
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/ucmathutils.cpp (+80/-0)
src/Ubuntu/Components/plugin/ucmathutils.h (+40/-0)
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 (+53/-39)
src/Ubuntu/Components/plugin/ucstyleditembase.h (+18/-4)
src/Ubuntu/Components/plugin/ucstyleditembase_p.h (+7/-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 (+27/-23)
src/Ubuntu/Components/plugin/ucubuntushape.h (+8/-4)
src/Ubuntu/Components/plugin/unixsignalhandler_p.cpp (+1/-1)
src/Ubuntu/Components/plugin/unixsignalhandler_p.h (+1/-1)
src/Ubuntu/Components/qmldir (+0/-6)
src/Ubuntu/Test/UbuntuTestCase.qml (+5/-0)
src/Ubuntu/Test/plugin/plugin.pri (+4/-2)
src/Ubuntu/Test/plugin/testplugin.cpp (+10/-0)
src/Ubuntu/Test/plugin/ucmousetouchadaptor.cpp (+198/-0)
src/Ubuntu/Test/plugin/ucmousetouchadaptor.h (+60/-0)
src/Ubuntu/Test/plugin/uctestcase.cpp (+2/-1)
src/Ubuntu/Test/plugin/uctestcase.h (+1/-1)
src/Ubuntu/Test/plugin/uctestextras.cpp (+141/-3)
src/Ubuntu/Test/plugin/uctestextras.h (+13/-1)
src/Ubuntu/UbuntuGestures/UbuntuGestures.pro (+31/-0)
src/Ubuntu/UbuntuGestures/candidateinactivitytimer.cpp (+46/-0)
src/Ubuntu/UbuntuGestures/candidateinactivitytimer.h (+51/-0)
src/Ubuntu/UbuntuGestures/debughelpers.cpp (+95/-0)
src/Ubuntu/UbuntuGestures/debughelpers.h (+31/-0)
src/Ubuntu/UbuntuGestures/pool.h (+132/-0)
src/Ubuntu/UbuntuGestures/timer.cpp (+152/-0)
src/Ubuntu/UbuntuGestures/timer.h (+117/-0)
src/Ubuntu/UbuntuGestures/timesource.cpp (+47/-0)
src/Ubuntu/UbuntuGestures/timesource.h (+62/-0)
src/Ubuntu/UbuntuGestures/touchownershipevent.cpp (+35/-0)
src/Ubuntu/UbuntuGestures/touchownershipevent.h (+50/-0)
src/Ubuntu/UbuntuGestures/touchregistry.cpp (+520/-0)
src/Ubuntu/UbuntuGestures/touchregistry.h (+206/-0)
src/Ubuntu/UbuntuGestures/ubuntugesturesglobal.h (+23/-0)
src/Ubuntu/UbuntuGestures/unownedtouchevent.cpp (+39/-0)
src/Ubuntu/UbuntuGestures/unownedtouchevent.h (+45/-0)
src/src.pro (+18/-4)
sync.profile (+29/-0)
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/_actionbar.py (+2/-2)
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_header.py (+0/-14)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py (+2/-4)
tests/license/checklicense.sh (+1/-1)
tests/qmlapicheck.sh (+1/-1)
tests/tests.pro (+1/-1)
tests/unit/add_makecheck.pri (+1/-1)
tests/unit/add_qmlmakecheck.pri (+1/-1)
tests/unit/runtest.sh (+2/-0)
tests/unit/tst_components/tst_math_utils.qml (+63/-0)
tests/unit_x11/add_makecheck.pri (+1/-1)
tests/unit_x11/add_qmlmakecheck.pri (+1/-1)
tests/unit_x11/test-include.pri (+1/-1)
tests/unit_x11/tst_bottomedge/AddCustomRegionOnCompleted.qml (+41/-0)
tests/unit_x11/tst_bottomedge/AddCustomRegionOwnedByOtherBottomEdge.qml (+39/-0)
tests/unit_x11/tst_bottomedge/AddCustomRegionUsingDataProperty.qml (+33/-0)
tests/unit_x11/tst_bottomedge/AddCustomRegionUsingRegionsProperty.qml (+33/-0)
tests/unit_x11/tst_bottomedge/AlternateDefaultRegionContent.qml (+53/-0)
tests/unit_x11/tst_bottomedge/AlternateRegionContent.qml (+47/-0)
tests/unit_x11/tst_bottomedge/AutoCollapseInPageHeader.qml (+45/-0)
tests/unit_x11/tst_bottomedge/AutoCollapseInPageWithPageHeader.qml (+44/-0)
tests/unit_x11/tst_bottomedge/BottomEdgeInItem.qml (+36/-0)
tests/unit_x11/tst_bottomedge/ClearCustomRegions.qml (+42/-0)
tests/unit_x11/tst_bottomedge/Defaults.qml (+28/-0)
tests/unit_x11/tst_bottomedge/DifferentSizes.qml (+34/-0)
tests/unit_x11/tst_bottomedge/LastItem.qml (+46/-0)
tests/unit_x11/tst_bottomedge/LeanActiveRegionChange.qml (+45/-0)
tests/unit_x11/tst_bottomedge/OverlappingRegions.qml (+46/-0)
tests/unit_x11/tst_bottomedge/ShorterBottomEdge.qml (+39/-0)
tests/unit_x11/tst_bottomedge/UncoveredByRegion.qml (+48/-0)
tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp (+854/-0)
tests/unit_x11/tst_bottomedge/tst_bottomedge.pro (+24/-0)
tests/unit_x11/tst_components/tst_bottomedgehint.qml (+188/-20)
tests/unit_x11/tst_components/tst_focus.qml (+4/-3)
tests/unit_x11/tst_components/tst_header.qml (+54/-2)
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 (+73/-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_components/tst_textinput_common.qml (+22/-1)
tests/unit_x11/tst_components/tst_textinput_common13.qml (+70/-1)
tests/unit_x11/tst_deprecated_theme_engine/tst_deprecated_theme_engine.cpp (+1/-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 (+45/-33)
tests/unit_x11/tst_subtheming/tst_subtheming.pro (+2/-3)
tests/unit_x11/tst_swipearea/DownwardsLauncher.qml (+72/-0)
tests/unit_x11/tst_swipearea/GestureTest.cpp (+140/-0)
tests/unit_x11/tst_swipearea/GestureTest.h (+92/-0)
tests/unit_x11/tst_swipearea/LeftwardsLauncher.qml (+76/-0)
tests/unit_x11/tst_swipearea/RightwardsLauncher.qml (+76/-0)
tests/unit_x11/tst_swipearea/UpwardsLauncher.qml (+76/-0)
tests/unit_x11/tst_swipearea/tst_swipearea.cpp (+1305/-0)
tests/unit_x11/tst_swipearea/tst_swipearea.pro (+13/-0)
tests/unit_x11/tst_swipearea/tst_swipearea.qml (+77/-0)
tests/unit_x11/tst_touchregistry/tst_TouchRegistry.cpp (+915/-0)
tests/unit_x11/tst_touchregistry/tst_touchregistry.pro (+6/-0)
tests/unit_x11/unit_x11.pro (+4/-1)
ubuntu-sdk.pro (+4/-6)
ubuntu-ui-toolkit-launcher/launcher.cpp (+4/-3)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/fix-header-ap-landing
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+279781@code.launchpad.net

Description of the change

Fix several header CPO related issues.

To post a comment you must log in.

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-12-07 14:19:44 +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,61 @@
63 property var icon
64 property bool iconFrame
65 property bool progression
66-Ubuntu.Components.BottomEdgeHint 1.3: Item
67- property string iconName
68- property url iconSource
69+Ubuntu.Components.BottomEdge 1.3: StyledItem
70+ readonly property BottomEdgeRegion activeRegion
71+ property Component contentComponent
72+ readonly property Item contentItem
73+ property url contentUrl
74+ readonly property DragDirection dragDirection
75+ readonly property double dragProgress
76+ readonly property BottomEdgeHint hint
77+ signal dragProgressChanged(double dragProgress)
78+ signal dragDirectionChanged(BottomEdge.DragDirection direction)
79+ signal statusChanged(BottomEdge.Status status)
80+ signal contentChanged(url url)
81+ signal contentComponentChanged(Component component)
82+ signal activeRegionChanged(BottomEdgeRegion activeRegion)
83+ signal commitStarted()
84+ signal commitCompleted()
85+ signal collapseStarted()
86+ signal collapseCompleted()
87+ function commit()
88+ function collapse()
89+ property list<BottomEdgeRegion> regions
90+ readonly property Status status
91+Ubuntu.Components.BottomEdge.DragDirection: Enum
92+ Downwards
93+ Undefined
94+ Upwards
95+Ubuntu.Components.BottomEdge.Status: Enum
96+ Committed
97+ Hidden
98+ Revealed
99+Ubuntu.Components.BottomEdgeHint 1.3: ActionItem
100+ property int deactivateTimeout
101+ property Flickable flickable
102 signal clicked()
103- property string text
104+ property Status status
105+ readonly property SwipeArea swipeArea
106+Ubuntu.Components.BottomEdgeHint.Status: Enum
107+ Active
108+ Hidden
109+ Inactive
110+ Locked
111+Ubuntu.Components.BottomEdgeRegion 1.3: QtObject
112+ property Component contentComponent
113+ property url contentUrl
114+ property bool enabled
115+ property double from
116+ signal entered()
117+ signal exited()
118+ signal dragEnded()
119+ property double to
120+Ubuntu.Components.Styles.BottomEdgeStyle 1.3: Item
121+ property Item contentItem
122+ property Item panel
123+ property Animation panelAnimation
124+ property double revealThreshold
125 Ubuntu.Components.Button 1.0 0.1: AbstractButton
126 property color color
127 property QFont font
128@@ -221,14 +271,14 @@
129 Ubuntu.Components.ColorUtils 0.1 1.0
130 Ubuntu.Components.ComboButton 1.1: Button
131 property double collapsedHeight
132- default readonly property QtObject comboList
133+ default property list<QtObject> comboList
134 readonly property double comboListHeight
135 property color dropdownColor
136 property bool expanded
137 property double expandedHeight
138 Ubuntu.Components.ComboButton 1.3: Button
139 property double collapsedHeight
140- default readonly property QtObject comboList
141+ default property list<QtObject> comboList
142 readonly property double comboListHeight
143 property color dropdownColor
144 property bool expanded
145@@ -318,7 +368,7 @@
146 signal closeClicked()
147 signal doneClicked()
148 Ubuntu.Components.Pickers.Dialer 1.0 0.1: StyledItem
149- readonly property QtObject centerContent
150+ property list<QtObject> centerContent
151 readonly property Item centerItem
152 property double handSpace
153 readonly property var hands
154@@ -327,7 +377,7 @@
155 property double minimumValue
156 property double size
157 Ubuntu.Components.Pickers.Dialer 1.3: StyledItem
158- readonly property QtObject centerContent
159+ property list<QtObject> centerContent
160 readonly property Item centerItem
161 property double handSpace
162 readonly property var hands
163@@ -339,18 +389,18 @@
164 readonly property Dialer dialer
165 property DialerHandGroup hand
166 readonly property int index
167- default readonly property QtObject overlay
168+ default property list<QtObject> overlay
169 property double value
170 Ubuntu.Components.Pickers.DialerHand 1.3: StyledItem
171 readonly property Dialer dialer
172 property DialerHandGroup hand
173 readonly property int index
174- default readonly property QtObject overlay
175+ default property list<QtObject> overlay
176 property double value
177 Ubuntu.Components.Popups.Dialog 1.0 0.1: PopupBase
178 property Item caller
179 property double callerMargin
180- default readonly property QtObject contents
181+ default property list<QtObject> contents
182 property double edgeMargins
183 property bool modal
184 property Item pointerTarget
185@@ -359,34 +409,16 @@
186 Ubuntu.Components.Popups.Dialog 1.3: PopupBase
187 property Item caller
188 property double callerMargin
189- default readonly property QtObject contents
190+ default property list<QtObject> contents
191 property double edgeMargins
192 property bool modal
193 property Item pointerTarget
194 property string text
195 property string title
196 Ubuntu.Components.ListItems.Divider 1.0 0.1: QQuickImageBase
197- property FillMode fillMode
198- property HAlignment horizontalAlignment
199- signal horizontalAlignmentChanged(HAlignment alignment)
200- signal verticalAlignmentChanged(VAlignment alignment)
201- signal mipmapChanged(bool )
202- property bool mipmap
203- readonly property double paintedHeight
204- readonly property double paintedWidth
205- property VAlignment verticalAlignment
206 Ubuntu.Components.ListItems.Divider 1.3: QQuickImageBase
207- property FillMode fillMode
208- property HAlignment horizontalAlignment
209- signal horizontalAlignmentChanged(HAlignment alignment)
210- signal verticalAlignmentChanged(VAlignment alignment)
211- signal mipmapChanged(bool )
212- property bool mipmap
213- readonly property double paintedHeight
214- readonly property double paintedWidth
215- property VAlignment verticalAlignment
216 Ubuntu.Components.ListItems.Empty 1.0 0.1: AbstractButton
217- readonly property Item backgroundIndicator
218+ property list<Item> backgroundIndicator
219 property bool confirmRemoval
220 readonly property ThinDivider divider
221 property bool highlightWhenPressed
222@@ -398,7 +430,7 @@
223 readonly property string swipingState
224 readonly property bool waitingConfirmationForRemoval
225 Ubuntu.Components.ListItems.Empty 1.3: AbstractButton
226- readonly property Item backgroundIndicator
227+ property list<Item> backgroundIndicator
228 property bool confirmRemoval
229 readonly property ThinDivider divider
230 property bool highlightWhenPressed
231@@ -510,7 +542,7 @@
232 XxSmall
233 Ubuntu.Layouts.Layouts 1.0 0.1: Item
234 readonly property string currentLayout
235- readonly property ConditionalLayout layouts
236+ property list<ConditionalLayout> layouts
237 Ubuntu.Components.ListItem 1.3 1.2: StyledItem
238 property Action action
239 property color color
240@@ -523,18 +555,19 @@
241 property color highlightColor
242 readonly property bool highlighted
243 property ListItemActions leadingActions
244- readonly property Item listItemChildren
245- default readonly property QtObject listItemData
246+ property list<Item> listItemChildren
247+ default property list<QtObject> listItemData
248 signal clicked()
249 signal pressAndHold()
250 signal contentMovementStarted()
251 signal contentMovementEnded()
252 property bool selectMode
253 property bool selected
254+ property bool swipeEnabled 1.3
255 property ListItemActions trailingActions
256 Ubuntu.Components.ListItemActions 1.2: QtObject
257- readonly property Action actions
258- default readonly property QtObject data
259+ property list<Action> actions
260+ default property list<QtObject> data
261 property Component delegate
262 Ubuntu.Components.ListItemDrag 1.2: QtObject
263 property bool accept
264@@ -572,27 +605,31 @@
265 Second
266 Ubuntu.Components.MainView 1.0 0.1: MainViewBase
267 property bool automaticOrientation
268- default readonly property QtObject contentsItem
269+ default property list<QtObject> contentsItem
270 property bool useDeprecatedToolbar
271 Ubuntu.Components.MainView 1.2: MainViewBase
272 property bool automaticOrientation
273- default readonly property QtObject contentsItem
274+ default property list<QtObject> contentsItem
275 Ubuntu.Components.MainView 1.3: MainViewBase
276 property bool automaticOrientation
277- default readonly property QtObject contentsItem
278-Ubuntu.Components.MathUtils 0.1 1.0 1.3
279+ default property list<QtObject> contentsItem
280+Ubuntu.Components.MathUtils 1.0 0.1: QtObject singleton
281+ function double clamp(double x, double min, double max)
282+ function double lerp(double delta, double from, double to)
283+ function double projectValue(double x, double xmin, double xmax, double ymin, double ymax)
284+ function double clampAndProject(double x, double xmin, double xmax, double ymin, double ymax)
285 Ubuntu.Components.MimeData 1.0 0.1: QtObject
286 property color color
287 property var data
288 readonly property QStringList formats
289 property string html
290 property string text
291- property QList<QUrl> urls
292+ property list<url> urls
293 Ubuntu.Components.Mouse 1.0 0.1: QtObject
294 readonly property Qt.MouseButtons acceptedButtons
295 property int clickAndHoldThreshold
296 property bool enabled
297- readonly property Item forwardTo
298+ property list<Item> forwardTo
299 readonly property bool hoverEnabled
300 signal pressed(QQuickMouseEvent mouse, Item host)
301 signal released(QQuickMouseEvent mouse, Item host)
302@@ -606,12 +643,15 @@
303 Ubuntu.Components.Mouse.Priority: Enum
304 AfterItem
305 BeforeItem
306+Ubuntu.Test.MouseTouchAdaptor 1.0: QtObject singleton
307+ property bool enabled
308+ signal enabledChanged(bool value)
309 Ubuntu.Components.ListItems.MultiValue 1.0 0.1: Base
310 property var values
311 Ubuntu.Components.ListItems.MultiValue 1.3: Base
312 property var values
313 Ubuntu.Components.Object 1.0 0.1: QtObject
314- default readonly property QtObject children
315+ default property list<QtObject> children
316 Ubuntu.Components.OptionSelector 1.0 0.1: Empty
317 property bool colourImage
318 property double containerHeight
319@@ -665,11 +705,11 @@
320 readonly property bool rotating
321 property bool transitionEnabled
322 Ubuntu.Components.Page 1.0 0.1: PageTreeNode
323- readonly property Action actions
324+ property list<Action> actions
325 property Flickable flickable
326 property string title
327 property Item tools
328-Ubuntu.Components.Page 1.1: Page
329+Ubuntu.Components.Page 1.1: Page10
330 readonly property PageHeadConfiguration head
331 Ubuntu.Components.Page 1.3: PageTreeNode
332 property Flickable flickable
333@@ -682,17 +722,17 @@
334 property double minimumWidth
335 property double preferredWidth
336 Ubuntu.Components.PageColumnsLayout 1.3: QtObject
337- default readonly property PageColumn data
338+ default property list<PageColum> data
339 property bool when
340 Ubuntu.Components.PageHeadConfiguration 1.1: Object
341- readonly property Action actions
342+ property list<Action> actions
343 property Action backAction
344 property Item contents
345 property color foregroundColor
346 property string preset
347 readonly property PageHeadSections sections
348 Ubuntu.Components.PageHeadConfiguration 1.3: Object
349- readonly property Action actions
350+ property list<Action> actions
351 property Action backAction
352 property Item contents
353 property Flickable flickable
354@@ -707,17 +747,17 @@
355 property var model
356 property int selectedIndex
357 Ubuntu.Components.PageHeadSections 1.3: QtObject
358- readonly property Action actions
359+ property list<Action> actions
360 property bool enabled
361 property var model
362 property int selectedIndex
363 Ubuntu.Components.PageHeadState 1.1: State
364- readonly property Action actions
365+ property list<Action> actions
366 property Action backAction
367 property Item contents
368 property PageHeadConfiguration head
369 Ubuntu.Components.PageHeadState 1.3: State
370- readonly property Action actions
371+ property list<Action> actions
372 property Action backAction
373 property Item contents
374 property PageHeadConfiguration head
375@@ -742,7 +782,9 @@
376 property int textSize
377 Ubuntu.Components.PageHeader 1.3: Header
378 property Item contents
379+ property Item extension
380 readonly property ActionBar leadingActionBar
381+ property list<Action> navigationActions
382 readonly property Sections sections
383 property string title
384 readonly property ActionBar trailingActionBar
385@@ -799,7 +841,7 @@
386 property int align
387 property bool animate
388 readonly property bool animating
389- default readonly property QtObject contents
390+ default property list<QtObject> contents
391 property int hideTimeout
392 property double hintSize
393 property bool locked
394@@ -813,7 +855,7 @@
395 property int align
396 property bool animate
397 readonly property bool animating
398- default readonly property QtObject contents
399+ default property list<QtObject> contents
400 property int hideTimeout
401 property double hintSize
402 property bool locked
403@@ -854,7 +896,7 @@
404 property bool autoClose
405 property Item caller
406 property double callerMargin
407- default readonly property QtObject container
408+ default property list<QtObject> container
409 property double contentHeight
410 property double contentWidth
411 property double edgeMargins
412@@ -866,7 +908,7 @@
413 property bool autoClose
414 property Item caller
415 property double callerMargin
416- default readonly property QtObject container
417+ default property list<QtObject> container
418 property double contentHeight
419 property double contentWidth
420 property double edgeMargins
421@@ -935,9 +977,8 @@
422 Ubuntu.Components.Scrollbar 1.3: StyledItem
423 property int align
424 property Flickable flickableItem
425-Ubuntu.Components.ScrollbarUtils 0.1 1.0
426 Ubuntu.Components.Sections 1.3: StyledItem
427- readonly property Action actions
428+ property list<Action> actions
429 property var model
430 property int selectedIndex
431 Ubuntu.Components.ServiceProperties 1.1: QtObject
432@@ -958,13 +999,13 @@
433 Inactive
434 Synchronizing
435 Ubuntu.Components.Popups.SheetBase 1.0 0.1: PopupBase
436- default readonly property QtObject container
437+ default property list<QtObject> container
438 property double contentsHeight
439 property double contentsWidth
440 property bool modal
441 property string title
442 Ubuntu.Components.Popups.SheetBase 1.3: PopupBase
443- default readonly property QtObject container
444+ default property list<QtObject> container
445 property double contentsHeight
446 property double contentsWidth
447 property bool modal
448@@ -1040,6 +1081,7 @@
449 property bool ignoreUnknownProperties
450 Ubuntu.Components.StyledItem 1.3 1.3 1.1 1.0 0.1: Item
451 property bool activeFocusOnPress 1.3
452+ signal activeFocusOnTabChanged2() 1.3
453 function bool requestFocus(Qt.FocusReason reason) 1.3
454 function bool requestFocus() 1.3
455 property Component style
456@@ -1049,6 +1091,26 @@
457 property string subText
458 Ubuntu.Components.ListItems.Subtitled 1.3: Base
459 property string subText
460+Ubuntu.Components.SwipeArea 1.3: Item
461+ property Direction direction
462+ readonly property double distance
463+ readonly property bool dragging
464+ property bool immediateRecognition
465+ signal directionChanged(Direction direction)
466+ signal draggingChanged(bool dragging)
467+ signal pressedChanged(bool pressed)
468+ signal distanceChanged(double distance)
469+ signal touchPositionChanged(QPointF position)
470+ signal immediateRecognitionChanged(bool immediateRecognition)
471+ readonly property bool pressed
472+ readonly property QPointF touchPosition
473+Ubuntu.Components.SwipeArea.Direction: Enum
474+ Downwards
475+ Horizontal
476+ Leftwards
477+ Rightwards
478+ Upwards
479+ Vertical
480 Ubuntu.Components.SwipeEvent 1.2: QtObject
481 property QPointF content
482 readonly property QPointF from
483@@ -1094,14 +1156,14 @@
484 readonly property Tab selectedTab
485 property int selectedTabIndex
486 property TabBar tabBar
487- default readonly property QtObject tabChildren
488+ default property list<QtObject> tabChildren
489 Ubuntu.Components.Tabs 1.3: PageTreeNode
490 readonly property int count
491 readonly property Item currentPage
492 readonly property Tab selectedTab
493 property int selectedTabIndex
494 property TabBar tabBar
495- default readonly property QtObject tabChildren
496+ default property list<QtObject> tabChildren
497 Ubuntu.Test.TestExtras 1.0: QtObject singleton
498 function string openGLflavor()
499 function string cpuArchitecture()
500@@ -1115,6 +1177,10 @@
501 function touchMove(int touchId, Item item, Qt.point point)
502 function touchDrag(int touchId, Item item, Qt.point from, Qt.point delta, int steps)
503 function touchDrag(int touchId, Item item, Qt.point from, Qt.point delta)
504+ function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey, int steps, int delay)
505+ function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey, int steps)
506+ function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey)
507+ function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button)
508 readonly property bool touchPresent
509 Ubuntu.Components.TextArea 1.0 0.1: StyledItem
510 property bool autoExpand
511@@ -1284,10 +1350,10 @@
512 property bool persistentSelection
513 property string placeholderText
514 property var popover
515- readonly property QtObject primaryItem
516+ property list<QtObject> primaryItem
517 property bool readOnly
518 property int renderType
519- readonly property QtObject secondaryItem
520+ property list<QtObject> secondaryItem
521 property bool selectByMouse
522 readonly property string selectedText
523 property color selectedTextColor
524@@ -1345,10 +1411,10 @@
525 property bool persistentSelection
526 property string placeholderText
527 property var popover
528- readonly property QtObject primaryItem
529+ property list<QtObject> primaryItem
530 property bool readOnly
531 property int renderType
532- readonly property QtObject secondaryItem
533+ property list<QtObject> secondaryItem
534 property bool selectByMouse
535 readonly property string selectedText
536 property color selectedTextColor
537@@ -1363,7 +1429,6 @@
538 property string name
539 property QtObject palette
540 readonly property ThemeSettings parentTheme
541- property ushort version
542 Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle
543 Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle
544 Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem
545@@ -1384,13 +1449,13 @@
546 property string text
547 Ubuntu.Components.ToolbarItems 1.0 0.1: Item
548 property Item back
549- default readonly property QtObject contents
550+ default property list<QtObject> contents
551 property bool locked
552 property bool opened
553 property Item pageStack
554 Ubuntu.Components.ToolbarItems 1.3: Item
555 property Item back
556- default readonly property QtObject contents
557+ default property list<QtObject> contents
558 property bool locked
559 property bool opened
560 property Item pageStack
561@@ -1400,7 +1465,6 @@
562 Ubuntu.Components.UCFontUtils 1.0 0.1: QtObject
563 function double sizeToPixels(string size)
564 function double modularScale(string size)
565-UCItemAttached: QtObject
566 UCListItemDivider: Item
567 property color colorFrom
568 property color colorTo
569@@ -1531,6 +1595,7 @@
570 function var typeString(var string)
571 function var warningFormat(var line, var column, var message)
572 function var waitForHeaderAnimation(var mainView)
573+ readonly property QuickTestUtil testUtil
574 Ubuntu.Components.UriHandler 1.0 0.1: QtObject singleton
575 signal opened(QStringList uris)
576 Ubuntu.Components.ListItems.ValueSelector 1.0 0.1: Empty
577@@ -1551,12 +1616,12 @@
578 property var values
579 Ubuntu.Components.ViewItems 1.2: QtObject
580 property bool dragMode
581- property QList<int> expandedIndices
582+ property list<int> expandedIndices
583 property int expansionFlags
584 signal dragUpdated(ListItemDrag event)
585- signal expandedIndicesChanged(QList<int> indices)
586+ signal expandedIndicesChanged(list<int> indices)
587 property bool selectMode
588- property QList<int> selectedIndices
589+ property list<int> selectedIndices
590 Ubuntu.Components.ViewItems.ExpansionFlag: Enum
591 CollapseOnOutsidePress
592 Exclusive
593
594=== modified file 'debian/changelog'
595--- debian/changelog 2015-12-01 14:27:38 +0000
596+++ debian/changelog 2015-12-07 14:19:44 +0000
597@@ -1,3 +1,104 @@
598+ubuntu-ui-toolkit (1.3.1740+16.04.20151205-0ubuntu1) UNRELEASED; urgency=medium
599+
600+ [ Zoltán Balogh ]
601+ * Enable building the UITK tests in any case.
602+ * Remove Q_Q(UCStyledItemBase) because of unused variable warning.
603+ * Resolve Trusty specific compiler issue not resolving QPointer data on
604+ connections.
605+ * Use only the object name when selecting sections and labels in tests.
606+
607+ [Zsombor Egri ]
608+ * Update BottomEdge with UI/UX agreed during the sprint. Fixes LP: #1368811.
609+ * BottomEdge component. Fixes LP: #1368811.
610+ * Remove build failure on Xenial caused by deprecated Qt functions.
611+ * Fix BottomEdgeHint consumes activeFocusOnPress handling. Fixes LP: #1517777
612+ * Migrate DirectionalDragArea from Unity8, named as SwipeArea. Original code
613+ (from lp:unity8) by: Daniel d'Andrada <daniel.dandrada@canonical.com>.
614+ * Delete QQuickView when the application quits. Fixing segfault caused by the
615+ dangling objects in GestireDetector.
616+ * BottomEdgeHint API changes, deprecating state property, introducing locked
617+ property to drive visuals lock and click handling.
618+ * Fixing CheckBox and Switch getting checked property altered after clicked()
619+ signal is emitted. Fixes LP: #1510919.
620+ * Add ListItem.swipeEnabled property to block swiping when overlay MouseArea
621+ is used to drag content. Fixes swiping when leading/trailing actions list
622+ is empty. Fixes LP: #1500409, LP: #1500416.
623+ * Follow the new design in BottomEdgeHint.
624+ * Provide import version information for StyledItem and remove theme.version
625+ obsolete property.
626+ * Use QQuickItemChangeListener to listen parent changes, skipping the meta
627+ object model. Convert UCThemingExtension into a Q_INTERFACE so object_cast<>
628+ can work with it saving the need to memorise on an item whether it is an
629+ extended item or not.
630+
631+ [ Benjamin Zeller ]
632+ * Avoid unnecessary updates for i18n strings.
633+ * "MathUtils.clamp, min value should not be bigger than the max value".
634+ Fixes LP: #1520557.
635+ * Move MathUtils to Cpp.
636+
637+ [ Loïc Molinari ]
638+ * UbuntuShape - Fixed deprecation logging issues.
639+ * This fix prevents logging a deprecation warning for "image", "color" and
640+ "gradientColor" properties when the import version is less than 1.3. The
641+ logging of properties used internally (through the old image wrapper) have
642+ been removed too since the user might not even have used them.
643+ Fixes LP: #1519414.
644+
645+ [ Christian Dywan ]
646+ * Enable gallery target in qmake.
647+ * Don't set activeFocusOnPress on TextField but on child only.
648+ Fixes LP: #1486274, LP: #1513897.
649+ * Make runtest.sh work out of the box again.
650+ * Explicitly handle keyboard anchoring in dialog foreground.
651+ Fixes LP: #1376763.
652+ * Remove GestureDetector in favor of SwipeArea in BottomEdgeHint. Also make
653+ possible to assign Action to the component. Fixes LP: #1517771, LP: #1517798
654+ * Enforce !activeFocusOnPress on TextField primary/secondaryItem.
655+ Fixes LP: #1513897.
656+ * Only run ActivityIndicator if visible. Fixes LP: #1513450.
657+ * Use wait_select_single for _get_button in Popover CPO.
658+ * Include composite types in .api again.
659+ * More forgiving QML plugin/ version discovery.
660+ * Update toolkit and gallery po templates. Fixes LP: #1512924.
661+ * Improve handling of list types in apicheck.
662+ * Smaller handlers, entirely draggable caret. Fixes LP: #1450222.
663+ * Special-case leaked QQuickImageBase properties. Fixes LP: #1473890.
664+ * Don't use UniqueConnection in the image extension
665+ * Sync the height of the Page header with the other subheaders in the
666+ AdaptivePageLayout.
667+
668+ [ Tim Peeters ]
669+ * Add extension property to PageHeader.
670+ * Don't set the header.moving property when flickable contents height changes
671+ but the header does not actually move. Fixes LP: #1514143.
672+ * Fix the icon color in the AppHeader. Fixes LP: #1515593.
673+ * Use PageHeader in the UITK gallery.
674+ * Ensure PageHeader style works properly with run-time theme changes.
675+ * Add a back action to the Page.header automatically in PageStack and
676+ AdaptivePageLayout.
677+ * Add a navigationActions property to PageHeader.
678+ * Fix links to Page in the documentation.
679+
680+ [ Florian Boucault ]
681+ * DraggingArea: import Ubuntu.Components so that MathUtils is available and
682+ no warning is output.
683+
684+ [ Brendan Donegan ]
685+ * Account for presence of OSK in Flickable helpers and add a test for the same
686+
687+ [ Andrea Bernabei ]
688+ * ListItemLayout: set QML context of the predefined labels. Fixes lp1514173.
689+ Fixes LP: #1514173.
690+
691+ [ Timo Jyrinki ]
692+ * Change HandlerType from int[2] to QVector<int> to make it work with Qt 5.5
693+ Fixes LP: #1484004, LP: #1450346
694+ * Workaround 'emit' declaration in Qt 5.5 Fixes LP: #1507910
695+ * Build depend on libxkbcommon-dev Fixes LP: #1508447
696+
697+ -- Zoltán Balogh <zoltan@bakter.hu> Sat, 05 Dec 2015 12:22:04 +0200
698+
699 ubuntu-ui-toolkit (1.3.1705+16.04.20151120.1-0ubuntu2) xenial; urgency=medium
700
701 * Rebuild against Qt 5.5.1.
702
703=== modified file 'debian/control'
704--- debian/control 2015-10-09 08:23:09 +0000
705+++ debian/control 2015-12-07 14:19:44 +0000
706@@ -9,6 +9,7 @@
707 python3:any,
708 qml-module-qtgraphicaleffects | libqt5qml-graphicaleffects,
709 libinput-dev,
710+ libxkbcommon-dev,
711 qtbase5-dev,
712 qtbase5-private-dev,
713 qttools5-dev-tools,
714@@ -73,6 +74,7 @@
715 suru-icon-theme,
716 ttf-ubuntu-font-family,
717 ubuntu-ui-toolkit-theme (= ${binary:Version}),
718+ libubuntugestures (= ${binary:Version}),
719 ${misc:Depends},
720 ${shlibs:Depends},
721 Conflicts: qt-components-ubuntu
722@@ -84,6 +86,28 @@
723 .
724 This package contains the Ubuntu Components QML plugin.
725
726+
727+Package: libubuntugestures
728+Architecture: any
729+Multi-Arch: same
730+Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}
731+Depends: ${misc:Depends},
732+ ${shlibs:Depends},
733+Description: Ubuntu gestures library - SwipeArea
734+ Ubuntu gestures library with SwipeArea
735+
736+Package: libubuntugestures-dev
737+Architecture: any
738+Multi-Arch: same
739+Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}
740+Depends: ${misc:Depends},
741+ ${shlibs:Depends},
742+Description: Ubuntu gestures library development files
743+ This package contains the development files for
744+ Ubuntu gestures library with SwipeArea
745+
746+
747+
748 Package: ubuntu-ui-toolkit-theme
749 Architecture: any
750 Multi-Arch: foreign
751
752=== added file 'debian/libubuntugestures-dev.install'
753--- debian/libubuntugestures-dev.install 1970-01-01 00:00:00 +0000
754+++ debian/libubuntugestures-dev.install 2015-12-07 14:19:44 +0000
755@@ -0,0 +1,28 @@
756+usr/include/*/qt5/UbuntuGestures/ubuntugesturesglobal.h
757+usr/include/*/qt5/UbuntuGestures/CandidateInactivityTimer
758+usr/include/*/qt5/UbuntuGestures/TouchOwnershipEvent
759+usr/include/*/qt5/UbuntuGestures/UbuntuGestures
760+usr/include/*/qt5/UbuntuGestures/pool.h
761+usr/include/*/qt5/UbuntuGestures/unownedtouchevent.h
762+usr/include/*/qt5/UbuntuGestures/DebugHelpers
763+usr/include/*/qt5/UbuntuGestures/debughelpers.h
764+usr/include/*/qt5/UbuntuGestures/touchownershipevent.h
765+usr/include/*/qt5/UbuntuGestures/touchregistry.h
766+usr/include/*/qt5/UbuntuGestures/UbuntuGesturesDepends
767+usr/include/*/qt5/UbuntuGestures/timesource.h
768+usr/include/*/qt5/UbuntuGestures/TimeSource
769+usr/include/*/qt5/UbuntuGestures/timer.h
770+usr/include/*/qt5/UbuntuGestures/UnownedTouchEvent
771+usr/include/*/qt5/UbuntuGestures/TouchRegistry
772+usr/include/*/qt5/UbuntuGestures/Pool
773+usr/include/*/qt5/UbuntuGestures/ubuntugesturesversion.h
774+usr/include/*/qt5/UbuntuGestures/Timer
775+usr/include/*/qt5/UbuntuGestures/candidateinactivitytimer.h
776+usr/include/*/qt5/UbuntuGestures/UbuntuGesturesVersion
777+usr/lib/*/libUbuntuGestures.prl
778+usr/lib/*/libUbuntuGestures.la
779+usr/lib/*/libUbuntuGestures.so
780+usr/lib/*/pkgconfig/UbuntuGestures.pc
781+usr/lib/*/qt5/mkspecs/modules/qt_lib_UbuntuGestures.pri
782+usr/lib/*/qt5/mkspecs/modules/qt_lib_UbuntuGestures_private.pri
783+
784
785=== added file 'debian/libubuntugestures.install'
786--- debian/libubuntugestures.install 1970-01-01 00:00:00 +0000
787+++ debian/libubuntugestures.install 2015-12-07 14:19:44 +0000
788@@ -0,0 +1,1 @@
789+usr/lib/*/libUbuntuGestures.so.*
790
791=== modified file 'documentation/overview.qdoc'
792--- documentation/overview.qdoc 2015-04-15 06:40:40 +0000
793+++ documentation/overview.qdoc 2015-12-07 14:19:44 +0000
794@@ -37,6 +37,13 @@
795 \endcode
796 \annotatedlist ubuntu
797
798+ \part Gestures
799+ Available through:
800+ \code
801+ import Ubuntu.Components 1.3
802+ \endcode
803+ \annotatedlist ubuntu-gestures
804+
805 \part List views, list items
806 Components with standardized view items, with conditional actions, multiselect
807 and reordering support on scrollable views. Replaces the Ubuntu.Components.ListItems
808
809=== modified file 'examples/ubuntu-ui-toolkit-gallery/About.qml'
810--- examples/ubuntu-ui-toolkit-gallery/About.qml 2015-09-24 19:36:36 +0000
811+++ examples/ubuntu-ui-toolkit-gallery/About.qml 2015-12-07 14:19:44 +0000
812@@ -30,9 +30,8 @@
813 anchors.fill: parent
814 color: theme.palette.normal.background
815 }
816- head {
817- title: i18n.tr('About...')
818- foregroundColor: theme.palette.selected.foregroundText
819+ header: PageHeader {
820+ title: i18n.tr("About...")
821 }
822
823 Column {
824
825=== renamed file 'examples/ubuntu-ui-toolkit-gallery/BottomEdgeHint.qml' => 'examples/ubuntu-ui-toolkit-gallery/BottomEdgePage.qml'
826--- examples/ubuntu-ui-toolkit-gallery/BottomEdgeHint.qml 2015-08-11 14:14:50 +0000
827+++ examples/ubuntu-ui-toolkit-gallery/BottomEdgePage.qml 2015-12-07 14:19:44 +0000
828@@ -17,22 +17,166 @@
829 import QtQuick 2.4
830 import Ubuntu.Components 1.3
831
832-Page {
833+Template {
834+ id: page
835+ header: PageHeader {
836+ title: i18n.tr("Bottom Edge")
837+ trailingActionBar.actions: [
838+ bottomEdge.hint.action
839+ ]
840+ }
841+
842 TemplateSection {
843- title: "Bottom Edge Hint"
844+ title: "BottomEdgeHint"
845 className: "BottomEdgeHint"
846
847- anchors {
848- top: parent.top
849- left: parent.left
850- right: parent.right
851- margins: units.gu(2)
852- }
853- }
854-
855- BottomEdgeHint {
856- iconName: "stock_message"
857- text: "Compose a new message"
858- onClicked: state = "Hidden"
859+ TemplateRow {
860+ title: i18n.tr("On clicked")
861+ Row {
862+ spacing: units.gu(1)
863+ CheckBox {
864+ id: contentToLayout
865+ text: i18n.tr("push content into the layout")
866+ enabled: bottomEdge.hint.status >= BottomEdgeHint.Active
867+ }
868+ Label {
869+ text: contentToLayout.text
870+ anchors.verticalCenter: contentToLayout.verticalCenter
871+ }
872+ }
873+ }
874+ }
875+
876+ TemplateSection {
877+ title: "BottomEdge"
878+ className: "BottomEdge"
879+
880+ TemplateRow {
881+ title: i18n.tr("Top")
882+ Slider {
883+ id: bottomEdgeHeight
884+ maximumValue: page.height
885+ value: bottomEdge.height
886+ onValueChanged: bottomEdge.height = value
887+ }
888+ }
889+
890+ TemplateRow {
891+ title: i18n.tr("Regions")
892+ Slider {
893+ id: regionCount
894+ width: units.gu(20)
895+ maximumValue: 3.0
896+ live: true
897+ }
898+ }
899+ Repeater {
900+ id: regionConfig
901+ model: regionCount.value.toFixed(0)
902+ TemplateRow {
903+ title: i18n.tr("Region #%1").arg(index)
904+ property int regionIndex: index
905+ Repeater {
906+ model: ["from", "to"]
907+ Row {
908+ spacing: units.gu(2)
909+ Label {
910+ text: i18n.tr(modelData)
911+ }
912+ TextField {
913+ id: regionFrom
914+ text: bottomEdge.regions[regionIndex][modelData]
915+ validator: DoubleValidator {bottom: 0.0; top: 1.0; decimals: 2; locale: "d.d"}
916+ inputMethodHints: Qt.ImhPreferNumbers | Qt.ImhFormattedNumbersOnly
917+ width: units.gu(7)
918+ hasClearButton: false
919+ errorHighlight: true
920+ onAccepted: bottomEdge.regions[regionIndex][modelData] = text
921+ onTextChanged: {
922+ if (regionFrom.acceptableInput) {
923+ bottomEdge.regions[regionIndex][modelData] = parseFloat(text);
924+ }
925+ }
926+ onActiveFocusChanged: if (activeFocus) selectAll()
927+ }
928+ }
929+ }
930+ }
931+ }
932+ }
933+
934+ BottomEdge {
935+ id: bottomEdge
936+ // make sure it doesn't land inside the flickable
937+ parent: page
938+ // hint
939+ hint {
940+ action: Action {
941+ text: "Demo content"
942+ iconName: "stock_message"
943+ onTriggered: bottomEdge.commit()
944+ }
945+ flickable: page.flickable
946+ }
947+ contentComponent: bottomEdgeContent
948+
949+ onCommitCompleted: {
950+ if (contentToLayout.checked && contentToLayout.enabled) {
951+ page.pageStack.addPageToCurrentColumn(page, contentComponent);
952+ collapse();
953+ }
954+ }
955+
956+ regions: [
957+ BottomEdgeRegion {
958+ objectName: "CustomRegion1"
959+ enabled: regionConfig.model >= 1
960+ to: 0.3
961+ property color baseColor: UbuntuColors.lightGrey
962+ },
963+ BottomEdgeRegion {
964+ objectName: "CustomRegion2"
965+ enabled: regionConfig.model >= 2
966+ from: 0.3
967+ to: 0.6
968+ },
969+ BottomEdgeRegion {
970+ objectName: "CustomRegion3"
971+ enabled: regionConfig.model >= 3
972+ from: 0.6
973+ },
974+ // default region, mimics the default setup
975+ BottomEdgeRegion {
976+ objectName: "DefaultRegion"
977+ enabled: regionConfig.model <= 0
978+ from: 0.3
979+ }
980+ ]
981+
982+ Component {
983+ id: bottomEdgeContent
984+ Page {
985+ height: bottomEdge.height
986+ header: PageHeader {
987+ title: {
988+ var state = "UNDEFINED";
989+ switch (bottomEdge.status) {
990+ case BottomEdge.Hidden: state = "Hidden"; break;
991+ case BottomEdge.Revealed: state = "Revealed"; break;
992+ case BottomEdge.Committed: state = "Committed"; break;
993+ }
994+ return bottomEdge.activeRegion
995+ ? i18n.tr("Within region '%1', status: %2").arg(bottomEdge.activeRegion.objectName).arg(state)
996+ : i18n.tr("Not in any active region, status: %1").arg(state);
997+ }
998+ }
999+ Rectangle {
1000+ anchors.fill: parent
1001+ anchors.margins: units.gu(1)
1002+ color: bottomEdge.activeRegion && bottomEdge.activeRegion.hasOwnProperty("baseColor") ?
1003+ bottomEdge.activeRegion.baseColor : Qt.rgba(0.5, 1, bottomEdge.dragProgress, 1)
1004+ }
1005+ }
1006+ }
1007 }
1008 }
1009
1010=== added file 'examples/ubuntu-ui-toolkit-gallery/Gallery.pro'
1011--- examples/ubuntu-ui-toolkit-gallery/Gallery.pro 1970-01-01 00:00:00 +0000
1012+++ examples/ubuntu-ui-toolkit-gallery/Gallery.pro 2015-12-07 14:19:44 +0000
1013@@ -0,0 +1,1 @@
1014+TARGET = $$PWD/gallery
1015
1016=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml'
1017--- examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-09-30 21:14:25 +0000
1018+++ examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-12-07 14:19:44 +0000
1019@@ -28,7 +28,7 @@
1020
1021 ListItem {
1022 id: addressbookListItem
1023- height: addressbookLayout.height
1024+ height: addressbookLayout.height + (divider.visible ? divider.height : 0)
1025
1026 ListItemLayout {
1027 id: addressbookLayout
1028@@ -48,7 +48,7 @@
1029
1030 ListItem {
1031 id: addressbookDetailsListItem
1032- height: addressbookDetailsLayout.height + divider.height
1033+ height: addressbookDetailsLayout.height + (divider.visible ? divider.height : 0)
1034 ListItemLayout {
1035 id: addressbookDetailsLayout
1036
1037@@ -73,7 +73,7 @@
1038 ListItem {
1039 id: telegramContactsListItem
1040
1041- height: telegramContactsLayout.height
1042+ height: telegramContactsLayout.height + (divider.visible ? divider.height : 0)
1043
1044 ListItemLayout {
1045 id: telegramContactsLayout
1046@@ -92,7 +92,7 @@
1047
1048 ListItem {
1049 id: systemSettings1
1050- height: systemSettings1_layout.height
1051+ height: systemSettings1_layout.height + (divider.visible ? divider.height : 0)
1052
1053 ListItemLayout {
1054 id: systemSettings1_layout
1055@@ -110,7 +110,7 @@
1056
1057 ListItem {
1058 id: systemSettings2
1059- height: systemSettings2_layout.height
1060+ height: systemSettings2_layout.height + (divider.visible ? divider.height : 0)
1061
1062 ListItemLayout {
1063 id: systemSettings2_layout
1064@@ -129,7 +129,7 @@
1065
1066 ListItem {
1067 id: systemSettings3
1068- height: systemSettings3_layout.height
1069+ height: systemSettings3_layout.height + (divider.visible ? divider.height : 0)
1070
1071 ListItemLayout {
1072 id: systemSettings3_layout
1073@@ -157,7 +157,7 @@
1074 spacing: 0
1075
1076 ListItem {
1077- height: customLabelsLayout.height
1078+ height: customLabelsLayout.height + (divider.visible ? divider.height : 0)
1079
1080 ListItemLayout {
1081 id: customLabelsLayout
1082@@ -220,7 +220,7 @@
1083
1084 ListItem {
1085 id: dialerHistoryListItem
1086- height: dialerHistoryLayout.height
1087+ height: dialerHistoryLayout.height + (divider.visible ? divider.height : 0)
1088
1089 ListItemLayout {
1090 id: dialerHistoryLayout
1091
1092=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml'
1093--- examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-09-28 12:26:13 +0000
1094+++ examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-12-07 14:19:44 +0000
1095@@ -20,7 +20,7 @@
1096 ListItem {
1097 property alias title: layout.title
1098
1099- height: layout.height
1100+ height: layout.height + (divider.visible ? divider.height : 0)
1101 onPressAndHold: selectMode = !selectMode
1102
1103 ListItemLayout { id: layout }
1104
1105=== modified file 'examples/ubuntu-ui-toolkit-gallery/MainPage.qml'
1106--- examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-09-30 05:59:49 +0000
1107+++ examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-12-07 14:19:44 +0000
1108@@ -21,37 +21,54 @@
1109 id: mainPage
1110 title: "Ubuntu UI Toolkit"
1111
1112- head.actions: [
1113- Action {
1114- text: i18n.tr('Right to Left')
1115- iconName: 'flash-on'
1116- visible: !gallery.rtl
1117- onTriggered: gallery.rtl = !gallery.rtl
1118- },
1119- Action {
1120- text: i18n.tr('Left to Right')
1121- iconName: 'flash-off'
1122- visible: gallery.rtl
1123- onTriggered: gallery.rtl = !gallery.rtl
1124- },
1125- Action {
1126- text: i18n.tr('Use dark theme')
1127- iconName: 'torch-on'
1128- visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'
1129- onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'
1130- },
1131- Action {
1132- text: i18n.tr('Use light theme')
1133- iconName: 'torch-off'
1134- visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'
1135- onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'
1136- },
1137- Action {
1138- text: i18n.tr('About')
1139- iconName: "info"
1140- onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
1141- }
1142- ]
1143+ header: PageHeader {
1144+ title: mainPage.title
1145+ flickable: layout.columns === 1 ? widgetList : null
1146+ trailingActionBar.actions: [
1147+ Action {
1148+ text: i18n.tr('Right to Left')
1149+ iconName: 'flash-on'
1150+ visible: !gallery.rtl
1151+ onTriggered: gallery.rtl = !gallery.rtl
1152+ },
1153+ Action {
1154+ text: i18n.tr('Left to Right')
1155+ iconName: 'flash-off'
1156+ visible: gallery.rtl
1157+ onTriggered: gallery.rtl = !gallery.rtl
1158+ },
1159+ Action {
1160+ text: i18n.tr('Use dark theme')
1161+ iconName: 'torch-on'
1162+ visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'
1163+ onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'
1164+ },
1165+ Action {
1166+ text: i18n.tr('Use light theme')
1167+ iconName: 'torch-off'
1168+ visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'
1169+ onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'
1170+ },
1171+ Action {
1172+ id: aboutAction
1173+ text: i18n.tr('About')
1174+ iconName: "info"
1175+ onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
1176+ },
1177+ Action {
1178+ text: i18n.tr("Deactivate mouse")
1179+ iconName: "non-starred"
1180+ visible: QuickUtils.mouseAttached
1181+ onTriggered: QuickUtils.mouseAttached = false
1182+ },
1183+ Action {
1184+ text: i18n.tr("Activate mouse")
1185+ iconName: "starred"
1186+ visible: !QuickUtils.mouseAttached
1187+ onTriggered: QuickUtils.mouseAttached = true
1188+ }
1189+ ]
1190+ }
1191
1192 onActiveChanged: {
1193 if (layout.columns < 2) {
1194@@ -62,59 +79,63 @@
1195 }
1196 }
1197
1198- Rectangle {
1199- color: Qt.rgba(0.0, 0.0, 0.0, 0.01)
1200- anchors.fill: parent
1201-
1202- UbuntuListView {
1203- id: widgetList
1204- objectName: "widgetList"
1205- anchors.fill: parent
1206- model: WidgetsModel {}
1207- currentIndex: -1
1208-
1209- onCurrentIndexChanged: openPage()
1210-
1211- function openPage() {
1212- if (!mainPage.active || currentIndex < 0) return;
1213- var modelData = model.get(currentIndex);
1214- var source = Qt.resolvedUrl(modelData.source);
1215- mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});
1216- }
1217-
1218- delegate: ListItem {
1219- objectName: model.objectName
1220- contentItem {
1221- anchors.leftMargin: units.gu(2)
1222- anchors.rightMargin: units.gu(2)
1223- }
1224- enabled: source != ""
1225- // Used by Autopilot
1226- property string text: label
1227- onClicked: widgetList.currentIndex = index
1228- Label {
1229- id: labelItem
1230- anchors {
1231- fill: parent
1232- rightMargin: units.gu(4)
1233- }
1234- text: label
1235- verticalAlignment: Text.AlignVCenter
1236- }
1237- Icon {
1238- name: "next"
1239- width: units.gu(2)
1240- height: units.gu(2)
1241- anchors {
1242- verticalCenter: parent.verticalCenter
1243- right: parent.right
1244- }
1245- }
1246- }
1247- highlight: Rectangle {
1248- color: theme.palette.selected.background
1249- }
1250- highlightMoveDuration: 0
1251- }
1252+ UbuntuListView {
1253+ id: widgetList
1254+ objectName: "widgetList"
1255+ anchors {
1256+ fill: parent
1257+ topMargin: mainPage.header.flickable ? 0 : mainPage.header.height
1258+ }
1259+
1260+ model: WidgetsModel {}
1261+ currentIndex: -1
1262+
1263+ onCurrentIndexChanged: openPage()
1264+
1265+ function openPage() {
1266+ if (!mainPage.active || currentIndex < 0) return;
1267+ var modelData = model.get(currentIndex);
1268+ var source = Qt.resolvedUrl(modelData.source);
1269+ mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});
1270+ }
1271+
1272+ delegate: ListItem {
1273+ objectName: model.objectName
1274+ contentItem {
1275+ anchors.leftMargin: units.gu(2)
1276+ anchors.rightMargin: units.gu(2)
1277+ }
1278+ enabled: source != ""
1279+ // Used by Autopilot
1280+ property string text: label
1281+ onClicked: widgetList.currentIndex = index
1282+ Label {
1283+ id: labelItem
1284+ anchors {
1285+ fill: parent
1286+ rightMargin: units.gu(4)
1287+ }
1288+ text: label
1289+ verticalAlignment: Text.AlignVCenter
1290+ }
1291+ Icon {
1292+ name: "next"
1293+ width: units.gu(2)
1294+ height: units.gu(2)
1295+ anchors {
1296+ verticalCenter: parent.verticalCenter
1297+ right: parent.right
1298+ }
1299+ }
1300+ }
1301+ highlight: Rectangle {
1302+ color: theme.palette.selected.background
1303+ }
1304+ highlightMoveDuration: 0
1305+ }
1306+
1307+ BottomEdgeHint {
1308+ flickable: widgetList
1309+ action: aboutAction
1310 }
1311 }
1312
1313=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sections.qml'
1314--- examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-07-03 16:19:59 +0000
1315+++ examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-12-07 14:19:44 +0000
1316@@ -19,7 +19,13 @@
1317
1318 Template {
1319 objectName: "sectionsTemplate"
1320- head.sections.model: ["first", "second", "third"]
1321+ id: sectionsTemplate
1322+
1323+ header: PageHeader {
1324+ title: sectionsTemplate.title
1325+ sections.model: ["first", "second", "third"]
1326+ }
1327+
1328 TemplateSection {
1329 title: "Sections"
1330 className: "Sections"
1331
1332=== added file 'examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml'
1333--- examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml 1970-01-01 00:00:00 +0000
1334+++ examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml 2015-12-07 14:19:44 +0000
1335@@ -0,0 +1,144 @@
1336+/*
1337+ * Copyright 2015 Canonical Ltd.
1338+ *
1339+ * This program is free software; you can redistribute it and/or modify
1340+ * it under the terms of the GNU Lesser General Public License as published by
1341+ * the Free Software Foundation; version 3.
1342+ *
1343+ * This program is distributed in the hope that it will be useful,
1344+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1345+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1346+ * GNU Lesser General Public License for more details.
1347+ *
1348+ * You should have received a copy of the GNU Lesser General Public License
1349+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1350+ */
1351+
1352+import QtQuick 2.4
1353+import Ubuntu.Components 1.3
1354+
1355+Template {
1356+ objectName: "SwipeAreaTemplate"
1357+ scrollable: !(upwards.dragging | downwards.dragging |
1358+ rightwards.dragging | leftwards.dragging)
1359+
1360+ TemplateSection {
1361+ className: "SwipeArea"
1362+
1363+ TemplateRow {
1364+ title: i18n.tr("Upwards")
1365+ Rectangle {
1366+ width: units.gu(40)
1367+ height: units.gu(20)
1368+ color: theme.palette.normal.foreground
1369+
1370+ SwipeArea {
1371+ id: upwards
1372+ direction: SwipeArea.Upwards
1373+ anchors {
1374+ left: parent.left
1375+ right: parent.right
1376+ bottom: parent.bottom
1377+ }
1378+ height: units.gu(4)
1379+ Label {
1380+ text: i18n.tr("Upwards")
1381+ color: theme.palette.normal.foregroundText
1382+ anchors {
1383+ centerIn: parent
1384+ verticalCenterOffset: parent.dragging ? -parent.distance : 0
1385+ }
1386+ }
1387+ }
1388+ }
1389+ }
1390+
1391+ TemplateRow {
1392+ title: i18n.tr("Downwards")
1393+ Rectangle {
1394+ width: units.gu(40)
1395+ height: units.gu(20)
1396+ color: theme.palette.normal.foreground
1397+
1398+ SwipeArea {
1399+ id: downwards
1400+ direction: SwipeArea.Downwards
1401+ anchors {
1402+ left: parent.left
1403+ right: parent.right
1404+ top: parent.top
1405+ }
1406+ height: units.gu(5)
1407+ Label {
1408+ text: i18n.tr("Downwards")
1409+ color: theme.palette.normal.foregroundText
1410+ anchors {
1411+ centerIn: parent
1412+ verticalCenterOffset: parent.dragging ? parent.distance : 0
1413+ }
1414+ }
1415+ }
1416+ }
1417+ }
1418+
1419+ TemplateRow {
1420+ title: i18n.tr("Rightwards")
1421+ Rectangle {
1422+ width: units.gu(40)
1423+ height: units.gu(20)
1424+ color: theme.palette.normal.foreground
1425+
1426+ SwipeArea {
1427+ id: rightwards
1428+ direction: SwipeArea.Rightwards
1429+ anchors {
1430+ left: parent.left
1431+ top: parent.top
1432+ bottom: parent.bottom
1433+ }
1434+ width: units.gu(5)
1435+
1436+ Label {
1437+ text: i18n.tr("Rightwards")
1438+ rotation: -90
1439+ color: theme.palette.normal.foregroundText
1440+ anchors {
1441+ centerIn: parent
1442+ horizontalCenterOffset: parent.dragging ? parent.distance : 0
1443+ }
1444+ }
1445+ }
1446+ }
1447+ }
1448+
1449+ TemplateRow {
1450+ title: i18n.tr("Leftwards")
1451+ Rectangle {
1452+ width: units.gu(40)
1453+ height: units.gu(20)
1454+ color: theme.palette.normal.foreground
1455+
1456+ SwipeArea {
1457+ id: leftwards
1458+ direction: SwipeArea.Leftwards
1459+ anchors {
1460+ right: parent.right
1461+ top: parent.top
1462+ bottom: parent.bottom
1463+ }
1464+ width: units.gu(5)
1465+
1466+ Label {
1467+ text: i18n.tr("Leftwards")
1468+ rotation: 90
1469+ color: theme.palette.normal.foregroundText
1470+ anchors {
1471+ centerIn: parent
1472+ horizontalCenterOffset: parent.dragging ? -parent.distance : 0
1473+ }
1474+ }
1475+ }
1476+ }
1477+ }
1478+ }
1479+}
1480
1481=== modified file 'examples/ubuntu-ui-toolkit-gallery/Template.qml'
1482--- examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-07-16 09:12:55 +0000
1483+++ examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-12-07 14:19:44 +0000
1484@@ -20,20 +20,31 @@
1485 Page {
1486 id: template
1487
1488- default property alias content: layout.children
1489- property alias spacing: layout.spacing
1490+ default property alias content: column.children
1491+ property alias spacing: column.spacing
1492+ property alias scrollable: flickable.interactive
1493+ readonly property alias flickable: flickable
1494+
1495+ header: PageHeader {
1496+ title: template.title
1497+ flickable: layout.columns === 1 ? flickable : null
1498+ onFlickableChanged: exposed = true;
1499+ }
1500
1501 Flickable {
1502 id: flickable
1503 objectName: "TemplateFlickable"
1504- anchors.fill: parent
1505- anchors.topMargin: units.gu(2)
1506- anchors.bottomMargin: units.gu(2)
1507- contentHeight: layout.height
1508+ anchors {
1509+ fill: parent
1510+ topMargin: template.header.flickable ? units.gu(2) :
1511+ units.gu(2) + template.header.height
1512+ bottomMargin: units.gu(2)
1513+ }
1514+ contentHeight: column.height
1515 interactive: contentHeight > height
1516
1517 Column {
1518- id: layout
1519+ id: column
1520 spacing: units.gu(6)
1521 anchors.left: parent.left
1522 anchors.right: parent.right
1523
1524=== modified file 'examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml'
1525--- examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml 2015-04-25 08:18:45 +0000
1526+++ examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml 2015-12-07 14:19:44 +0000
1527@@ -26,7 +26,7 @@
1528 default property alias content: contentRow.children
1529
1530 height: Math.max(contentRow.height, label.height)
1531- width: parent.width
1532+ width: parent ? parent.width : 0
1533
1534 Label {
1535 id: label
1536
1537=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
1538--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-09-25 17:05:53 +0000
1539+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-12-07 14:19:44 +0000
1540@@ -102,9 +102,14 @@
1541 source: "CrossFadeImage.qml"
1542 }
1543 ListElement {
1544+ objectName: "swipeAreaElement"
1545+ label: "SwipeArea"
1546+ source: "SwipeAreaPage.qml"
1547+ }
1548+ ListElement {
1549 objectName: "bottomEdgeHintElement"
1550- label: "Bottom Edge Hint"
1551- source: "BottomEdgeHint.qml"
1552+ label: "Bottom Edge"
1553+ source: "BottomEdgePage.qml"
1554 }
1555
1556 ListElement {
1557
1558=== modified file 'examples/ubuntu-ui-toolkit-gallery/gallery'
1559--- examples/ubuntu-ui-toolkit-gallery/gallery 2015-09-14 14:10:37 +0000
1560+++ examples/ubuntu-ui-toolkit-gallery/gallery 2015-12-07 14:19:44 +0000
1561@@ -1,6 +1,6 @@
1562 #!/bin/bash
1563
1564-. `dirname $0`/../../build_paths.inc
1565+. `dirname ${BASH_SOURCE[0]}`/../../export_modules_dir.sh || exit 1
1566
1567 SCRIPT_DIRECTORY=`dirname $0`
1568-$BUILD_DIR/ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher $@ $SCRIPT_DIRECTORY/ubuntu-ui-toolkit-gallery.qml
1569+QT_LOGGING_CONF=$SCRIPT_DIRECTORY/gallery-logging.config $BUILD_DIR/ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher $@ $SCRIPT_DIRECTORY/ubuntu-ui-toolkit-gallery.qml
1570
1571=== added file 'examples/ubuntu-ui-toolkit-gallery/gallery-logging.config'
1572--- examples/ubuntu-ui-toolkit-gallery/gallery-logging.config 1970-01-01 00:00:00 +0000
1573+++ examples/ubuntu-ui-toolkit-gallery/gallery-logging.config 2015-12-07 14:19:44 +0000
1574@@ -0,0 +1,5 @@
1575+[Rules]
1576+libubuntugestures.TouchRegistry.debug=false
1577+ubuntu.components.SwipeArea.debug=false
1578+ubuntu.components.SwipeArea.ActiveTouchInfo.debug=false
1579+ubuntu.components.BottomEdge.debug=false
1580
1581=== modified file 'examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro'
1582--- examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro 2015-06-15 08:53:40 +0000
1583+++ examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro 2015-12-07 14:19:44 +0000
1584@@ -1,6 +1,6 @@
1585 TEMPLATE = subdirs
1586
1587-SUBDIRS += po
1588+SUBDIRS += Gallery.pro po
1589
1590 filetypes = qml png svg js jpg qmlproject desktop
1591
1592@@ -10,7 +10,8 @@
1593 OTHER_FILES += *.$$filetype
1594 }
1595
1596-OTHER_FILES += gallery
1597+OTHER_FILES += gallery \
1598+ gallery-logging.config
1599
1600 desktop_files.path = $$[QT_INSTALL_EXAMPLES]/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery
1601 desktop_files.files = ubuntu-ui-toolkit-gallery.desktop
1602
1603=== modified file 'export_modules_dir.sh'
1604--- export_modules_dir.sh 2015-05-19 07:55:27 +0000
1605+++ export_modules_dir.sh 2015-12-07 14:19:44 +0000
1606@@ -1,4 +1,4 @@
1607-#!/bin/sh
1608+#!/bin/bash
1609 #
1610 # Copyright 2012 - 2015 Canonical Ltd.
1611 #
1612@@ -15,10 +15,12 @@
1613 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1614 #
1615
1616-. `dirname $0`/build_paths.inc
1617+. `dirname ${BASH_SOURCE[0]}`/build_paths.inc || exit 1
1618 export QML_IMPORT_PATH=$BUILD_DIR/qml
1619 export QML2_IMPORT_PATH=$BUILD_DIR/qml
1620 export UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
1621+export LD_LIBRARY_PATH=$BUILD_DIR/lib
1622 /sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml
1623 /sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml
1624 /sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
1625+/sbin/initctl set-env --global LD_LIBRARY_PATH=$BUILD_DIR/lib
1626
1627=== modified file 'features/ubuntu_qml_plugin.prf'
1628--- features/ubuntu_qml_plugin.prf 2015-08-13 09:40:00 +0000
1629+++ features/ubuntu_qml_plugin.prf 2015-12-07 14:19:44 +0000
1630@@ -36,8 +36,19 @@
1631 membackend.name = ALARM_BACKEND
1632 membackend.value = memory
1633
1634+ #make sure qmlplugindump finds all libs
1635+ ld_lib_path.name = LD_LIBRARY_PATH
1636+ ld_lib_path.value =
1637+ for(qmod, QTREPOS) {
1638+ qmod = $$qmod/lib
1639+ exists($$qmod): ld_lib_path.value += $$shell_path($$qmod)
1640+ }
1641+ ld_lib_path.value += $$shell_path($$ROOT_BUILD_DIR/lib)
1642+ ld_lib_path.value = $$unique(ld_lib_path.value)
1643+
1644 qtAddToolEnv(QMLPLUGINDUMP, importpath)
1645 qtAddToolEnv(QMLPLUGINDUMP, membackend)
1646+ qtAddToolEnv(QMLPLUGINDUMP, ld_lib_path)
1647
1648 TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )
1649
1650@@ -68,3 +79,6 @@
1651
1652 QMAKE_CXXFLAGS += -Werror
1653
1654+#do not warn for deprecated declarations
1655+QMAKE_CXXFLAGS -= -Werror=deprecated-declarations
1656+
1657
1658=== added file 'features/ubuntu_qt_module.prf'
1659--- features/ubuntu_qt_module.prf 1970-01-01 00:00:00 +0000
1660+++ features/ubuntu_qt_module.prf 2015-12-07 14:19:44 +0000
1661@@ -0,0 +1,22 @@
1662+!build_with_qt: {
1663+ #enable autocreation of include directory
1664+ CONFIG += git_build
1665+}
1666+
1667+load(qt_module)
1668+
1669+CONFIG -= create_cmake
1670+
1671+# when building against the system Qt we pick up the CXX_FLAGS for a release build
1672+# reset them to the default debug build flags
1673+!build_with_qt: {
1674+ CONFIG(debug, debug|release) {
1675+ QMAKE_CFLAGS = $$QMAKE_CFLAGS_DEBUG
1676+ QMAKE_CXXFLAGS = $$QMAKE_CXXFLAGS_DEBUG
1677+ }
1678+}
1679+
1680+QMAKE_CXXFLAGS += -Werror
1681+
1682+#do not warn for deprecated declarations
1683+QMAKE_CXXFLAGS -= -Werror=deprecated-declarations
1684
1685=== modified file 'gallery.sh'
1686--- gallery.sh 2015-08-11 15:42:46 +0000
1687+++ gallery.sh 2015-12-07 14:19:44 +0000
1688@@ -15,8 +15,6 @@
1689 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1690 #
1691
1692-source export_modules_dir.sh
1693-
1694 if [ "$1" == "--autopilot" ]
1695 then
1696 examples/ubuntu-ui-toolkit-gallery/gallery -testability &
1697
1698=== modified file 'src/Ubuntu/Components/1.2/DraggingArea.qml'
1699--- src/Ubuntu/Components/1.2/DraggingArea.qml 2015-04-30 08:32:44 +0000
1700+++ src/Ubuntu/Components/1.2/DraggingArea.qml 2015-12-07 14:19:44 +0000
1701@@ -15,7 +15,7 @@
1702 */
1703
1704 import QtQuick 2.4
1705-import "mathUtils.js" as MathLocal
1706+import Ubuntu.Components 1.2
1707
1708 MouseArea {
1709 id: draggingArea
1710@@ -25,7 +25,7 @@
1711 property real dragVelocity: 0
1712 property real dragValue: (orientation == Qt.Vertical ? (mouseY - __pressedPosition.y)
1713 : (mouseX - __pressedPosition.x))
1714- property real lateralPosition: orientation == Qt.Horizontal ? MathLocal.clamp(mouseY, 0, height) : MathLocal.clamp(mouseX, 0, width)
1715+ property real lateralPosition: orientation == Qt.Horizontal ? MathUtils.clamp(mouseY, 0, height) : MathUtils.clamp(mouseX, 0, width)
1716 property point __pressedPosition: Qt.point(0, 0)
1717 property var __dragEvents: []
1718 property bool clickValidated: true
1719
1720=== modified file 'src/Ubuntu/Components/1.2/MainViewBase.qml'
1721--- src/Ubuntu/Components/1.2/MainViewBase.qml 2015-04-30 08:32:44 +0000
1722+++ src/Ubuntu/Components/1.2/MainViewBase.qml 2015-12-07 14:19:44 +0000
1723@@ -48,12 +48,12 @@
1724
1725 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
1726 */
1727- property string theme: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
1728+ property string themeName: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
1729 "Ambiance" : "SuruDark"
1730- onThemeChanged: {
1731+ onThemeNameChanged: {
1732 // only change the theme if the current one is a system one.
1733- if (theme !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
1734- Theme.name = "Ubuntu.Components.Themes.%1".arg(theme);
1735+ if (themeName !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
1736+ Theme.name = "Ubuntu.Components.Themes.%1".arg(themeName);
1737 }
1738 }
1739 }
1740
1741=== modified file 'src/Ubuntu/Components/1.2/Slider.qml'
1742--- src/Ubuntu/Components/1.2/Slider.qml 2015-04-30 08:32:44 +0000
1743+++ src/Ubuntu/Components/1.2/Slider.qml 2015-12-07 14:19:44 +0000
1744@@ -17,7 +17,6 @@
1745 // FIXME(loicm) Add support for keyboard shortcuts (basically left/right).
1746
1747 import QtQuick 2.4
1748-import "mathUtils.js" as MathUtils
1749 import Ubuntu.Components 1.2
1750
1751 /*!
1752
1753=== modified file 'src/Ubuntu/Components/1.2/TextArea.qml'
1754--- src/Ubuntu/Components/1.2/TextArea.qml 2015-04-30 08:32:44 +0000
1755+++ src/Ubuntu/Components/1.2/TextArea.qml 2015-12-07 14:19:44 +0000
1756@@ -17,7 +17,6 @@
1757 import QtQuick 2.4
1758 import Ubuntu.Components 1.2 as Ubuntu
1759 import Ubuntu.Components.Popups 1.0
1760-import "mathUtils.js" as MathUtils
1761
1762 /*!
1763 \qmltype TextArea
1764@@ -767,7 +766,7 @@
1765 var max = (control.maximumLineCount <= 0) ?
1766 control.lineCount :
1767 Math.min(control.maximumLineCount, control.lineCount);
1768- control.height = linesHeight(MathUtils.clamp(control.lineCount, 1, max));
1769+ control.height = linesHeight(Ubuntu.MathUtils.clamp(control.lineCount, 1, max));
1770 }
1771 }
1772 }
1773
1774=== removed file 'src/Ubuntu/Components/1.2/mathUtils.js'
1775--- src/Ubuntu/Components/1.2/mathUtils.js 2015-07-17 14:42:26 +0000
1776+++ src/Ubuntu/Components/1.2/mathUtils.js 1970-01-01 00:00:00 +0000
1777@@ -1,61 +0,0 @@
1778-/*
1779- * Copyright 2012 Canonical Ltd.
1780- *
1781- * This program is free software; you can redistribute it and/or modify
1782- * it under the terms of the GNU Lesser General Public License as published by
1783- * the Free Software Foundation; version 3.
1784- *
1785- * This program is distributed in the hope that it will be useful,
1786- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1787- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1788- * GNU Lesser General Public License for more details.
1789- *
1790- * You should have received a copy of the GNU Lesser General Public License
1791- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1792- */
1793-
1794-/*!
1795- \qmltype mathUtils
1796- \inqmlmodule Ubuntu.Components 1.2
1797- \ingroup ubuntu
1798- \brief Various mathematical utility functions.
1799- */
1800-
1801-.pragma library
1802-
1803-/*!
1804- \qmlmethod clamp(x, min, max)
1805- Ensure the value x is between min and max
1806- */
1807-function clamp(x, min, max) {
1808- if (min <= max) {
1809- return Math.max(min, Math.min(x, max));
1810- } else {
1811- // swap min/max if min > max
1812- return clamp(x, max, min);
1813- }
1814-}
1815-
1816-/*!
1817- \qmlmethod lerp(delta, from, to)
1818- Get the linear interpolation
1819- */
1820-function lerp(delta, from, to) {
1821- return ((1.0 - delta) * from) + (delta * to);
1822-}
1823-
1824-/*!
1825- \qmlmethod getFlickableChild(item)
1826- Linearly project a value x from [xmin, xmax] into [ymin, ymax]
1827- */
1828-function projectValue(x, xmin, xmax, ymin, ymax) {
1829- return ((x - xmin) * ymax - (x - xmax) * ymin) / (xmax - xmin)
1830-}
1831-
1832-/*!
1833- \qmlmethod clampAndProject(x, xmin, xmax, ymin, ymax)
1834- Linearly project a value x, but in addition to projectValue it's clamped to xmin/xmax first
1835- */
1836-function clampAndProject(x, xmin, xmax, ymin, ymax) {
1837- return projectValue(clamp(x, xmin, xmax), xmin, xmax, ymin, ymax)
1838-}
1839
1840=== removed file 'src/Ubuntu/Components/1.2/scrollbarUtils.js'
1841--- src/Ubuntu/Components/1.2/scrollbarUtils.js 2015-04-30 08:32:44 +0000
1842+++ src/Ubuntu/Components/1.2/scrollbarUtils.js 1970-01-01 00:00:00 +0000
1843@@ -1,129 +0,0 @@
1844-/*
1845- * Copyright 2012 Canonical Ltd.
1846- *
1847- * This program is free software; you can redistribute it and/or modify
1848- * it under the terms of the GNU Lesser General Public License as published by
1849- * the Free Software Foundation; version 3.
1850- *
1851- * This program is distributed in the hope that it will be useful,
1852- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1853- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1854- * GNU Lesser General Public License for more details.
1855- *
1856- * You should have received a copy of the GNU Lesser General Public License
1857- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1858- */
1859-
1860-.pragma library
1861-
1862-Qt.include("mathUtils.js")
1863-
1864-/*!
1865- \internal
1866- Object storing property names used in calculations.
1867- */
1868-var _obj = {
1869- scrollbar: null,
1870- vertical: false,
1871- propOrigin: "",
1872- propContent: "",
1873- propPosRatio: "",
1874- propSizeRatio: "",
1875- propCoordinate: "",
1876- propSize: "",
1877- refresh: function () {
1878- _obj.vertical = (_obj.scrollbar.align === Qt.AlignLeading) || (_obj.scrollbar.align === Qt.AlignTrailing)
1879- _obj.propOrigin = (_obj.vertical) ? "originY" : "originX";
1880- _obj.propContent = (_obj.vertical) ? "contentY" : "contentX";
1881- _obj.propPosRatio = (_obj.vertical) ? "yPosition" : "xPosition";
1882- _obj.propSizeRatio = (_obj.vertical) ? "heightRatio" : "widthRatio";
1883- _obj.propCoordinate = (_obj.vertical) ? "y" : "x";
1884- _obj.propSize = (_obj.vertical) ? "height" : "width";
1885- }
1886-}
1887-
1888-/*!
1889- \internal
1890- Checks whether the _obj is valid or not. Must be called in every function
1891- as those can be invoked prior to the host (style) component completion.
1892- */
1893-function __check(sb) {
1894- if (sb !== null && (_obj.scrollbar !== sb)) {
1895- _obj.scrollbar = sb;
1896- sb.flickableItemChanged.connect(_obj.refresh);
1897- sb.alignChanged.connect(_obj.refresh);
1898- _obj.refresh();
1899- }
1900-
1901- return _obj.scrollbar;
1902-}
1903-
1904-/*!
1905- Returns whether the scrollbar is vertical or horizontal.
1906- */
1907-function isVertical(scrollbar) {
1908- if (!__check(scrollbar)) return 0;
1909- return _obj.vertical;
1910-}
1911-
1912-/*!
1913- Calculates the slider position based on the visible area's ratios.
1914- */
1915-function sliderPos(scrollbar, min, max) {
1916- if (!__check(scrollbar)) return 0;
1917- return clamp(scrollbar.flickableItem.visibleArea[_obj.propPosRatio] * scrollbar.flickableItem[_obj.propSize], min, max);
1918-}
1919-
1920-/*!
1921- Calculates the slider size for ListViews based on the visible area's position
1922- and size ratios, clamping it between min and max.
1923-
1924- The function can be used in Scrollbar styles to calculate the size of the slider.
1925- */
1926-function sliderSize(scrollbar, min, max) {
1927- if (!__check(scrollbar)) return 0;
1928- var sizeRatio = scrollbar.flickableItem.visibleArea[_obj.propSizeRatio];
1929- var posRatio = scrollbar.flickableItem.visibleArea[_obj.propPosRatio];
1930- var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
1931- var startPos = posRatio * (max - sizeUnderflow)
1932- var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
1933- var overshootStart = startPos < 0 ? -startPos : 0
1934- var overshootEnd = endPos > max ? endPos - max : 0
1935-
1936- // overshoot adjusted start and end
1937- var adjustedStartPos = startPos + overshootStart
1938- var adjustedEndPos = endPos - overshootStart - overshootEnd
1939-
1940- // final position and size of thumb
1941- var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
1942- var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
1943-
1944- return result;
1945-}
1946-
1947-/*!
1948- The function calculates and clamps the position to be scrolled to the minimum
1949- and maximum values.
1950-
1951- The scroll and drag functions require a slider that does not have any minimum
1952- size set (meaning the minimum is set to 0.0). Implementations should consider
1953- using an invisible cursor to drag the slider and the ListView position.
1954- */
1955-function scrollAndClamp(scrollbar, amount, min, max) {
1956- if (!__check(scrollbar)) return 0;
1957- return scrollbar.flickableItem[_obj.propOrigin] +
1958- clamp(scrollbar.flickableItem[_obj.propContent] - scrollbar.flickableItem[_obj.propOrigin] + amount,
1959- min, max);
1960-}
1961-
1962-/*!
1963- The function calculates the new position of the dragged slider. The amount is
1964- relative to the contentSize, which is either the flickable's contentHeight or
1965- contentWidth or other calculated value, depending on its orientation. The pageSize
1966- specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
1967- */
1968-function dragAndClamp(scrollbar, cursor, contentSize, pageSize) {
1969- if (!__check(scrollbar)) return 0;
1970- scrollbar.flickableItem[_obj.propContent] =
1971- scrollbar.flickableItem[_obj.propOrigin] + cursor[_obj.propCoordinate] * contentSize / pageSize;
1972-}
1973
1974=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
1975--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-10-14 15:44:15 +0000
1976+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-12-07 14:19:44 +0000
1977@@ -166,6 +166,11 @@
1978 and the preferred width is set to 40 grid units. This width is set every time
1979 the layout is activated.
1980
1981+ When a \l Page with the \l Page::header property set is added to an
1982+ AdaptivePageLayout, the AdaptivePageLayout will synchronize the height of that
1983+ header with the height of the headers in other columns, i.e., the height of
1984+ each of the headers will be set to the maximum implicitHeight of all the headers.
1985+
1986 \sa PageStack, PageColumnsLayout, PageColumn
1987 */
1988
1989@@ -452,7 +457,17 @@
1990 // replace page holder's child
1991 var holder = body.children[targetColumn];
1992 holder.detachCurrentPage();
1993- holder.attachPage(pageWrapper);
1994+ holder.attachPage(pageWrapper); // sets pageWrapper.pageHolder
1995+
1996+ // set the back action for Page.header:
1997+ var page = pageWrapper.object;
1998+ if (page && page.hasOwnProperty("header") && page.header &&
1999+ page.header.hasOwnProperty("navigationActions")) {
2000+ // Page.header is an instance of PageHeader.
2001+ var backAction = backActionComponent.createObject(
2002+ pageWrapper, { 'wrapper': pageWrapper } );
2003+ page.header.navigationActions = [ backAction ] ;
2004+ }
2005 }
2006
2007 function getWrapper(page) {
2008@@ -644,6 +659,42 @@
2009 }
2010 }
2011
2012+ // An instance will be added to each Page with
2013+ Component {
2014+ id: backActionComponent
2015+
2016+ Action {
2017+ // used when the Page has a Page.header property set.
2018+ id: backAction
2019+ objectName: "apl_back_action"
2020+ iconName: "back"
2021+ text: "Back"
2022+
2023+ // set when backAction is created.
2024+ property PageWrapper wrapper
2025+ onTriggered: layout.removePages(wrapper.object)
2026+
2027+ visible: {
2028+ var parentWrapper;
2029+ try {
2030+ parentWrapper = d.tree.parent(wrapper);
2031+ } catch(err) {
2032+ // Root node has no parent node.
2033+ return false;
2034+ }
2035+ if (!wrapper.pageHolder) {
2036+ // columns are being re-arranged.
2037+ return false;
2038+ }
2039+ // wrapper.column is the virtual column, pageHolder.column the actual column.
2040+ var column = wrapper.pageHolder.column;
2041+ var nextInColumn = d.tree.top(column, column < d.columns - 1, 1);
2042+ return parentWrapper === nextInColumn;
2043+ }
2044+ }
2045+ }
2046+
2047+
2048 // Page holder component, can have only one Page as child at a time, all stacked pages
2049 // will be parented into hiddenPool
2050 Component {
2051@@ -670,6 +721,15 @@
2052 property var page: pageWrapper ? pageWrapper.object : null
2053 property bool customHeader: page && page.hasOwnProperty("header") &&
2054 page.header
2055+ onPageChanged: body.updateHeaderHeight(0)
2056+ Connections {
2057+ target: page
2058+ onHeaderChanged: body.updateHeaderHeight(0)
2059+ }
2060+ Connections {
2061+ target: page ? page.header : null
2062+ onImplicitHeightChanged: body.updateHeaderHeight(page.header.implicitHeight)
2063+ }
2064
2065 // prevent the pages from taking the app header height into account.
2066 __propagated: null
2067@@ -683,8 +743,6 @@
2068 right: parent.right
2069 rightMargin: dividerThickness
2070 }
2071- // we need to clip because the header does not have a background
2072- clip: true
2073 Item {
2074 id: hiddenItem
2075 anchors.fill: parent
2076@@ -692,6 +750,8 @@
2077 }
2078 }
2079
2080+ // subHeader is to be deprecated in UITK 1.4 and will be replaced
2081+ // by the Page.header property (introduced in 1.3).
2082 property alias head: subHeader
2083 StyledItem {
2084 id: subHeader
2085@@ -703,7 +763,6 @@
2086 height: body.headerHeight
2087
2088 styleName: "PageHeadStyle"
2089- theme.version: Ubuntu.toolkitVersion
2090 objectName: "Header" + column
2091
2092 property real preferredHeight: subHeader.__styleInstance ?
2093@@ -795,8 +854,8 @@
2094 onXChanged: holder.Layout.preferredWidth = x
2095 }
2096
2097- function attachPage(page) {
2098- pageWrapper = page;
2099+ function attachPage(wrapper) {
2100+ pageWrapper = wrapper;
2101 pageWrapper.parent = holderBody;
2102 pageWrapper.pageHolder = holder;
2103 pageWrapper.active = true;
2104@@ -854,17 +913,32 @@
2105 property real headerHeight: 0
2106
2107 function updateHeaderHeight(newHeight) {
2108+ var page;
2109+ var i;
2110 if (newHeight > body.headerHeight) {
2111 body.headerHeight = newHeight;
2112 } else {
2113 var h = 0;
2114 var subHeight = 0;
2115- for (var i = 0; i < children.length; i++) {
2116- subHeight = children[i].head.preferredHeight;
2117+ for (i = 0; i < children.length; i++) {
2118+ page = children[i].page;
2119+ if (page && page.hasOwnProperty("header") && page.header) {
2120+ subHeight = page.header.implicitHeight;
2121+ } else {
2122+ subHeight = children[i].head.preferredHeight;
2123+ }
2124 if (subHeight > h) h = subHeight;
2125 }
2126 body.headerHeight = h;
2127 }
2128+
2129+ // Update all the Page.header heights.
2130+ for (i = 0; i < body.children.length; i++) {
2131+ page = body.children[i].page;
2132+ if (page && page.hasOwnProperty("header") && page.header) {
2133+ page.header.height = headerHeight;
2134+ }
2135+ }
2136 }
2137
2138 onChildrenChanged: {
2139
2140=== modified file 'src/Ubuntu/Components/1.3/AnimatedItem.qml'
2141--- src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-04-25 08:54:58 +0000
2142+++ src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-12-07 14:19:44 +0000
2143@@ -25,14 +25,13 @@
2144 */
2145
2146 import QtQuick 2.4
2147-import Ubuntu.Components 1.3 as Toolkit
2148+import Ubuntu.Components 1.3
2149
2150-Toolkit.StyledItem {
2151+StyledItem {
2152 id: root
2153 /*!
2154 \deprecated
2155 Specifies whether the component is on the visible area of the Flickable or not.
2156 */
2157- theme.version: Toolkit.Ubuntu.toolkitVersion
2158 property bool onScreen: true
2159 }
2160
2161=== modified file 'src/Ubuntu/Components/1.3/AppHeader.qml'
2162--- src/Ubuntu/Components/1.3/AppHeader.qml 2015-10-01 21:23:04 +0000
2163+++ src/Ubuntu/Components/1.3/AppHeader.qml 2015-12-07 14:19:44 +0000
2164@@ -151,6 +151,5 @@
2165 }
2166 }
2167
2168- theme.version: Components.Ubuntu.toolkitVersion
2169 styleName: "PageHeadStyle"
2170 }
2171
2172=== removed file 'src/Ubuntu/Components/1.3/BottomEdgeHint.qml'
2173--- src/Ubuntu/Components/1.3/BottomEdgeHint.qml 2015-09-21 14:44:13 +0000
2174+++ src/Ubuntu/Components/1.3/BottomEdgeHint.qml 1970-01-01 00:00:00 +0000
2175@@ -1,155 +0,0 @@
2176-/*
2177- * Copyright 2015 Canonical Ltd.
2178- *
2179- * This program is free software; you can redistribute it and/or modify
2180- * it under the terms of the GNU Lesser General Public License as published by
2181- * the Free Software Foundation; version 3.
2182- *
2183- * This program is distributed in the hope that it will be useful,
2184- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2185- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2186- * GNU Lesser General Public License for more details.
2187- *
2188- * You should have received a copy of the GNU Lesser General Public License
2189- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2190- */
2191-
2192-import QtQuick 2.4
2193-import Ubuntu.Components 1.3
2194-
2195-/*!
2196- \qmlabstract BottomEdgeHint
2197- \inqmlmodule Ubuntu.Components 1.3
2198- \ingroup ubuntu
2199- \brief The BottomEdgeHint shows the availability of extra features
2200- available from the bottom edge of the application.
2201-
2202- It displays either a label or an icon at the bottom of the application.
2203-
2204- It has 2 states: hidden or visible. When hidden, part of it is still visible
2205- to hint at the existence of the bottom edge.
2206-
2207- When used with a mouse it acts like a button. The typical action associated
2208- with clicking on it should be revealing the extra features provided by the
2209- bottom edge.
2210-
2211- Example:
2212- \qml
2213- BottomEdgeHint {
2214- id: bottomEdgeHint
2215- text: i18n.tr("Favorites")
2216- onClicked: revealBottomEdge()
2217- }
2218- \endqml
2219-
2220-*/
2221-Item {
2222- id: bottomEdgeHint
2223-
2224- anchors {
2225- bottom: parent.bottom
2226- bottomMargin: bottomEdgeHint.state == "Hidden" ? -bottomEdgeHint.height + units.gu(1.5) : 0
2227- horizontalCenter: parent.horizontalCenter
2228- Behavior on bottomMargin { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
2229- }
2230-
2231- width: label.paintedWidth + units.gu(7)
2232- height: units.gu(4)
2233-
2234- /*!
2235- This handler is called when there is a mouse click on the BottomEdgeHint
2236- and the BottomEdgeHint is not disabled.
2237- */
2238- signal clicked()
2239-
2240- Keys.onEnterPressed: clicked()
2241- Keys.onReturnPressed: clicked()
2242-
2243- /*!
2244- The label displayed by the BottomEdgeHint.
2245- */
2246- property string text
2247-
2248- /*!
2249- The icon displayed by the BottomEdgeHint.
2250-
2251- This is the URL of any image file.
2252- If both iconSource and iconName are defined, iconName will be ignored.
2253- */
2254- property url iconSource: iconName ? "image://theme/" + iconName : ""
2255-
2256- /*!
2257- The icon associated with the BottomEdgeHint in the icon theme.
2258-
2259- If both iconSource and iconName are defined, iconName will be ignored.
2260- */
2261- property string iconName
2262-
2263- /*!
2264- BottomEdgeHint can take 2 states of visibility: "Hidden" and "Visible".
2265-
2266- When "Visible", the full hint with its content is shown.
2267-
2268- When "Hidden", only part of the hint is visible leaving more space for application content.
2269- */
2270- property string state: "Visible"
2271-
2272- MouseArea {
2273- id: mouseArea
2274- anchors.fill: parent
2275- hoverEnabled: true
2276- onEntered: bottomEdgeHint.state = "Visible"
2277- onClicked: {
2278- Haptics.play();
2279- bottomEdgeHint.clicked();
2280- mouse.accepted = false;
2281- }
2282- }
2283-
2284- clip: true
2285-
2286- UbuntuShape {
2287- id: background
2288-
2289- anchors {
2290- bottom: parent.bottom
2291- horizontalCenter: bottomEdgeHint.horizontalCenter
2292- bottomMargin: -units.gu(1)
2293- }
2294-
2295- width: bottomEdgeHint.width - 2 * hoverExpansion
2296- height: bottomEdgeHint.height + units.gu(1) - hoverExpansion
2297-
2298- property real hoverExpansion: mouseArea.containsMouse ? 0 : units.gu(0.5)
2299- Behavior on hoverExpansion { UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } }
2300-
2301- backgroundColor: theme.palette.normal.overlay
2302- }
2303-
2304- Label {
2305- id: label
2306-
2307- anchors {
2308- top: parent.top
2309- horizontalCenter: parent.horizontalCenter
2310- }
2311- text: icon.name ? "" : bottomEdgeHint.text
2312- textSize: Label.Medium
2313- height: bottomEdgeHint.height
2314- verticalAlignment: Text.AlignVCenter
2315- horizontalAlignment: Text.AlignHCenter
2316- }
2317-
2318- Icon {
2319- id: icon
2320-
2321- name: bottomEdgeHint.iconName
2322- anchors {
2323- bottom: parent.bottom
2324- bottomMargin: units.gu(0.5)
2325- horizontalCenter: parent.horizontalCenter
2326- }
2327- width: height
2328- height: units.gu(2)
2329- }
2330-}
2331
2332=== modified file 'src/Ubuntu/Components/1.3/Button.qml'
2333--- src/Ubuntu/Components/1.3/Button.qml 2015-08-20 06:56:44 +0000
2334+++ src/Ubuntu/Components/1.3/Button.qml 2015-12-07 14:19:44 +0000
2335@@ -121,6 +121,5 @@
2336 */
2337 property string iconPosition: "left"
2338
2339- theme.version: Ubuntu.toolkitVersion
2340 styleName: "ButtonStyle"
2341 }
2342
2343=== modified file 'src/Ubuntu/Components/1.3/CheckBox.qml'
2344--- src/Ubuntu/Components/1.3/CheckBox.qml 2015-09-16 16:58:51 +0000
2345+++ src/Ubuntu/Components/1.3/CheckBox.qml 2015-12-07 14:19:44 +0000
2346@@ -49,6 +49,5 @@
2347 */
2348 onTriggered: checked = !checked
2349
2350- theme.version: Ubuntu.toolkitVersion
2351 styleName: "CheckBoxStyle"
2352 }
2353
2354=== modified file 'src/Ubuntu/Components/1.3/DraggingArea.qml'
2355--- src/Ubuntu/Components/1.3/DraggingArea.qml 2015-04-25 08:54:58 +0000
2356+++ src/Ubuntu/Components/1.3/DraggingArea.qml 2015-12-07 14:19:44 +0000
2357@@ -15,6 +15,7 @@
2358 */
2359
2360 import QtQuick 2.4
2361+import Ubuntu.Components 1.3
2362
2363 MouseArea {
2364 id: draggingArea
2365
2366=== modified file 'src/Ubuntu/Components/1.3/OptionSelector.qml'
2367--- src/Ubuntu/Components/1.3/OptionSelector.qml 2015-09-07 10:05:58 +0000
2368+++ src/Ubuntu/Components/1.3/OptionSelector.qml 2015-12-07 14:19:44 +0000
2369@@ -225,7 +225,6 @@
2370 right: parent.right
2371 }
2372 state: optionSelector.expanded ? "expanded" : "collapsed"
2373- theme.version: Toolkit.Ubuntu.toolkitVersion
2374 styleName: "OptionSelectorStyle"
2375 states: [ State {
2376 name: "expanded"
2377
2378=== removed file 'src/Ubuntu/Components/1.3/Page.qdoc'
2379--- src/Ubuntu/Components/1.3/Page.qdoc 2015-04-25 08:54:58 +0000
2380+++ src/Ubuntu/Components/1.3/Page.qdoc 1970-01-01 00:00:00 +0000
2381@@ -1,132 +0,0 @@
2382-/*
2383- * Copyright 2014 Canonical Ltd.
2384- *
2385- * This program is free software; you can redistribute it and/or modify
2386- * it under the terms of the GNU Lesser General Public License as published by
2387- * the Free Software Foundation; version 3.
2388- *
2389- * This program is distributed in the hope that it will be useful,
2390- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2391- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2392- * GNU Lesser General Public License for more details.
2393- *
2394- * You should have received a copy of the GNU Lesser General Public License
2395- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2396- */
2397-
2398-/*!
2399- \qmltype Page
2400- \inqmlmodule Ubuntu.Components 1.1
2401- \ingroup ubuntu
2402- \brief A page is the basic Item that must be used inside the \l MainView,
2403- \l PageStack and \l Tabs.
2404- Anchors and height of a Page are automatically determined to align with
2405- the header of the \l MainView, but can be overridden.
2406-
2407- \l MainView provides a header for Pages it includes.
2408- The text and actions of the header are determined by the \l title
2409- and \l head properties of the page:
2410-
2411- \qml
2412- import QtQuick 2.4
2413- import Ubuntu.Components 1.2
2414-
2415- MainView {
2416- width: units.gu(48)
2417- height: units.gu(60)
2418-
2419- Page {
2420- title: i18n.tr("Example page")
2421-
2422- Label {
2423- anchors.centerIn: parent
2424- text: i18n.tr("Hello world!")
2425- }
2426-
2427- head.actions: [
2428- Action {
2429- iconName: "search"
2430- text: i18n.tr("Search")
2431- },
2432- Action {
2433- iconName: "contacts"
2434- text: i18n.tr("Contacts")
2435- }
2436- ]
2437- }
2438- }
2439- \endqml
2440- See \l MainView for more examples on how to use the header.
2441- Advanced navigation structures can be created by adding Pages to a \l PageStack or \l Tabs.
2442-
2443- The Page automatically anchors to the left and bottom of its parent. The width of the Page
2444- will be the full width of its parent \l MainView or \l PageStack or \l Tab,
2445- and the height will adapt to leave space for the header when needed. It is possible to
2446- use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
2447- so that the Page can control its width and height.
2448-*/
2449-
2450-/*!
2451- \qmlproperty string Page::title
2452- The title of the page. Will be shown in the header of the \l MainView.
2453- If the page is used inside a \l Tab, the default title is the \l Tab title.
2454- For a Page not inside a \l Tab, the default title is an empty string.
2455- */
2456-
2457-/*!
2458- \qmlproperty Item Page::tools
2459- \deprecated
2460- The toolbar items associated with this Page.
2461- DEPRECATED. Use \b head.actions instead.
2462- */
2463-
2464-/*!
2465- \qmlproperty PageHeadConfiguration Page::head
2466- \readonly
2467- Configuration of the header for this page.
2468- */
2469-
2470-/*!
2471- \qmlproperty Flickable Page::flickable
2472- Optional flickable that controls the header. This property
2473- is automatically set to the first child of the page that is Flickable
2474- and anchors to the top of the page or fills the page. For example:
2475- \qml
2476- import QtQuick 2.4
2477- import Ubuntu.Components 1.2
2478-
2479- MainView {
2480- width: units.gu(30)
2481- height: units.gu(50)
2482- Page {
2483- id: page
2484- title: "example"
2485- //flickable: null // uncomment for a fixed header
2486- Flickable {
2487- id: content
2488- anchors.fill: parent
2489- contentHeight: units.gu(70)
2490- Label {
2491- text: "hello"
2492- anchors.centerIn: parent
2493- }
2494- }
2495- }
2496- }
2497- \endqml
2498- In this example, page.flickable will automatically be set to content because it is
2499- a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
2500- hide the header.
2501-
2502- Set this property to null to avoid automatic flickable detection, which disables hiding
2503- of the header by scrolling in the Flickable. In cases where a flickable should control the header,
2504- but it is not automatically detected, the flickable property can be set.
2505- */
2506-
2507-/*!
2508- \qmlproperty list<Action> Page::actions
2509- Local actions. These actions will be made available outside the application
2510- (for example, to HUD) when the Page is active. For actions that are always available
2511- when the application is running, use the actions property of \l MainView.
2512- For actions in the header, see \l head.
2513-*/
2514
2515=== modified file 'src/Ubuntu/Components/1.3/Page.qml'
2516--- src/Ubuntu/Components/1.3/Page.qml 2015-10-15 10:07:59 +0000
2517+++ src/Ubuntu/Components/1.3/Page.qml 2015-12-07 14:19:44 +0000
2518@@ -19,8 +19,55 @@
2519 import "pageUtils.js" as Utils
2520
2521 /*!
2522- \internal
2523- Documentation is in Page.qdoc
2524+ \qmltype Page
2525+ \inqmlmodule Ubuntu.Components 1.1
2526+ \ingroup ubuntu
2527+ \brief A page is the basic Item that must be used inside the \l MainView,
2528+ \l PageStack and \l Tabs.
2529+ Anchors and height of a Page are automatically determined to align with
2530+ the header of the \l MainView, but can be overridden.
2531+
2532+
2533+ \l MainView provides a header for Pages it includes if no
2534+ \l header property was set.
2535+ The text and actions of the header are determined by the \l title
2536+ and \l head properties of the page:
2537+
2538+ \qml
2539+ import QtQuick 2.4
2540+ import Ubuntu.Components 1.2
2541+
2542+ MainView {
2543+ width: units.gu(48)
2544+ height: units.gu(60)
2545+
2546+ Page {
2547+ title: i18n.tr("Example page")
2548+
2549+ Label {
2550+ anchors.centerIn: parent
2551+ text: i18n.tr("Hello world!")
2552+ }
2553+
2554+ head.actions: [
2555+ Action {
2556+ iconName: "search"
2557+ text: i18n.tr("Search")
2558+ },
2559+ Action {
2560+ iconName: "contacts"
2561+ text: i18n.tr("Contacts")
2562+ }
2563+ ]
2564+ }
2565+ }
2566+ \endqml
2567+
2568+ The Page automatically anchors to the left and bottom of its parent. The width of the Page
2569+ will be the full width of its parent \l MainView or \l PageStack or \l Tab,
2570+ and the height will adapt to leave space for the header when needed. It is possible to
2571+ use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
2572+ so that the Page can control its width and height.
2573 */
2574 PageTreeNode {
2575 id: page
2576@@ -35,13 +82,13 @@
2577
2578 /*!
2579 The header property for this page. Setting this property will reparent the
2580- header to the page and disable the \l Mainview's application header.
2581+ header to the page and disable the \l MainView's application header.
2582 \qml
2583 Page {
2584 id: page
2585 title: "Page with header"
2586 header: PageHeader {
2587- title: page.header
2588+ title: page.title
2589 trailingActionBar.actions: [
2590 Action { iconName: "settings" },
2591 Action { iconName: "info" }
2592@@ -49,17 +96,65 @@
2593 }
2594 }
2595 \endqml
2596+ \sa PageHeader
2597 */
2598 property Item header
2599 onHeaderChanged: internal.updateHeader()
2600 Component.onCompleted: internal.updateHeader()
2601
2602+ /*! \internal */
2603 isLeaf: true
2604+
2605+ /*!
2606+ The title of the page. Will be shown in the header of the \l MainView.
2607+ If the page is used inside a \l Tab, the default title is the \l Tab title.
2608+ For a Page not inside a \l Tab, the default title is an empty string.
2609+ */
2610 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""
2611+
2612+ /*!
2613+ Optional flickable that controls the MainView header. This property
2614+ is automatically set to the first child of the page that is Flickable
2615+ and anchors to the top of the page or fills the page. For example:
2616+ \qml
2617+ import QtQuick 2.4
2618+ import Ubuntu.Components 1.2
2619+
2620+ MainView {
2621+ width: units.gu(30)
2622+ height: units.gu(50)
2623+ Page {
2624+ id: page
2625+ title: "example"
2626+ //flickable: null // uncomment for a fixed header
2627+ Flickable {
2628+ id: content
2629+ anchors.fill: parent
2630+ contentHeight: units.gu(70)
2631+ Label {
2632+ text: "hello"
2633+ anchors.centerIn: parent
2634+ }
2635+ }
2636+ }
2637+ }
2638+ \endqml
2639+ In this example, page.flickable will automatically be set to content because it is
2640+ a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
2641+ hide the header.
2642+
2643+ Set this property to null to avoid automatic flickable detection, which disables hiding
2644+ of the header by scrolling in the Flickable. In cases where a flickable should control the header,
2645+ but it is not automatically detected, the flickable property can be set.
2646+ */
2647 property Flickable flickable: Utils.getFlickableChild(page)
2648
2649 /*!
2650- \qmlproperty PageHeadConfiguration head
2651+ \qmlproperty PageHeadConfiguration Page::head
2652+ \readonly
2653+ \deprecated
2654+ Configuration of the header for this page.
2655+ Deprecated: This configuration will be replaced by setting the \l header property.
2656 */
2657 readonly property alias head: headerConfig
2658 Toolkit13.PageHeadConfiguration {
2659
2660=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
2661--- src/Ubuntu/Components/1.3/PageHeader.qml 2015-10-15 14:17:25 +0000
2662+++ src/Ubuntu/Components/1.3/PageHeader.qml 2015-12-07 14:19:44 +0000
2663@@ -40,8 +40,8 @@
2664 Header {
2665 id: header
2666 anchors {
2667- left: parent.left
2668- right: parent.right
2669+ left: parent ? parent.left : undefined
2670+ right: parent ? parent.right : undefined
2671 }
2672
2673 /*!
2674@@ -74,11 +74,11 @@
2675 */
2676 property Item contents
2677
2678- Component.onCompleted: holder.updateContents()
2679- onContentsChanged: holder.updateContents()
2680+ Component.onCompleted: contentsHolder.updateContents()
2681+ onContentsChanged: contentsHolder.updateContents()
2682
2683 Item {
2684- id: holder
2685+ id: contentsHolder
2686 anchors {
2687 left: leading.right
2688 right: trailing.left
2689@@ -95,23 +95,39 @@
2690 property Item previousContentsParent: null
2691
2692 function updateContents() {
2693- if (holder.previousContents) {
2694- holder.previousContents.parent = holder.previousContentsParent;
2695+ if (previousContents) {
2696+ previousContents.parent = previousContentsParent;
2697 }
2698- if (contents) {
2699+ if (header.contents) {
2700 titleLoader.sourceComponent = null;
2701- holder.previousContents = header.contents;
2702- holder.previousContentsParent = header.contents.parent;
2703- header.contents.parent = holder;
2704+ previousContents = header.contents;
2705+ previousContentsParent = header.contents.parent;
2706+ header.contents.parent = contentsHolder;
2707 } else {
2708- holder.previousContents = null;
2709- holder.previousContentsParent = null;
2710+ previousContents = null;
2711+ previousContentsParent = null;
2712 titleLoader.sourceComponent = __styleInstance.titleComponent;
2713 }
2714 }
2715+
2716+ // When the style changes, make sure that the titleLoader loads
2717+ // the new titleComponent.
2718+ property Item styleInstance: __styleInstance
2719+ onStyleInstanceChanged: updateContents()
2720 }
2721
2722 /*!
2723+ The actions to be shown in the leading action bar.
2724+ This property is automatically set by the
2725+ \l AdaptivePageLayout and other navigation components to configure the
2726+ back action for the \l Page.
2727+ Application developers should not set this property, because the
2728+ value may be overridden by Ubuntu components that have navigation.
2729+ Instead, set \l leadingActionBar's actions property.
2730+ */
2731+ property list<Action> navigationActions
2732+
2733+ /*!
2734 \qmlproperty ActionBar leadingActionBar
2735 The \l ActionBar for the leading navigation actions.
2736 Example:
2737@@ -125,6 +141,9 @@
2738 ]
2739 }
2740 \endqml
2741+ The default value of \l leadingActionBar actions is
2742+ \l navigationActions, but that value can be changed to show
2743+ different actions in front of the title.
2744 See \l ActionBar.
2745 */
2746 readonly property alias leadingActionBar: leading
2747@@ -138,7 +157,8 @@
2748 height: header.__styleInstance.contentHeight
2749 numberOfSlots: 1
2750 delegate: header.__styleInstance.defaultActionDelegate
2751- visible: actions.length > 0
2752+ actions: header.navigationActions
2753+ visible: leading.width > 0 // at least 1 visible action
2754 StyleHints {
2755 overflowIconName: "navigation-menu"
2756 }
2757@@ -182,7 +202,59 @@
2758 height: header.__styleInstance.contentHeight
2759 numberOfSlots: 3
2760 delegate: header.__styleInstance.defaultActionDelegate
2761- visible: actions.length > 0
2762+ visible: trailing.width > 0 // at least 1 visible action
2763+ }
2764+
2765+ /*!
2766+ Item shown at the bottom of the header.
2767+ The extension can be any Item, but it must have a height so that
2768+ the PageHeader correctly adjusts its height for the extension to fit.
2769+ The extension Item should anchor to the left, right and bottom of
2770+ its parent so that it will be automatically positioned above the
2771+ header divider. This property replaces the sections property. Sections
2772+ can now be added to the header as follows:
2773+ \qml
2774+ PageHeader {
2775+ title: "Header with sections"
2776+ extension: Sections {
2777+ anchors {
2778+ left: parent.left
2779+ leftMargin: units.gu(2)
2780+ bottom: parent.bottom
2781+ }
2782+ model: ["one", "two", "three"]
2783+ }
2784+ }
2785+ \endqml
2786+ */
2787+ property Item extension
2788+
2789+ onExtensionChanged: extensionHolder.updateExtension()
2790+ Item {
2791+ id: extensionHolder
2792+ anchors {
2793+ left: parent.left
2794+ right: parent.right
2795+ top: contentsHolder.bottom
2796+ }
2797+ height: header.extension ? header.extension.height : 0
2798+
2799+ property Item previousExtension: header.extension
2800+ property Item previousExtensionParent: null
2801+
2802+ function updateExtension() {
2803+ if (previousExtension) {
2804+ previousExtension.parent = previousExtensionParent;
2805+ }
2806+ if (header.extension) {
2807+ previousExtension = header.extension;
2808+ previousExtensionParent = header.extension.parent;
2809+ header.extension.parent = extensionHolder;
2810+ } else {
2811+ previousExtension = null;
2812+ previousExtensionParent = null;
2813+ }
2814+ }
2815 }
2816
2817 /*!
2818@@ -190,6 +262,7 @@
2819 Sections shown at the bottom of the header. By default,
2820 the sections will only be visible if its actions or model
2821 is set. See \l Sections.
2822+ \deprecated Use \l extension instead.
2823 */
2824 readonly property alias sections: sectionsItem
2825 Sections {
2826@@ -197,12 +270,11 @@
2827 anchors {
2828 left: parent.left
2829 leftMargin: units.gu(2)
2830- top: holder.bottom
2831+ top: contentsHolder.bottom
2832 }
2833- visible: model && model.length > 0
2834+ visible: model && model.length > 0 && !header.extension
2835 height: visible ? implicitHeight : 0
2836 }
2837
2838- theme.version: Ubuntu.toolkitVersion
2839 styleName: "PageHeaderStyle"
2840 }
2841
2842=== modified file 'src/Ubuntu/Components/1.3/PageStack.qml'
2843--- src/Ubuntu/Components/1.3/PageStack.qml 2015-07-10 07:42:38 +0000
2844+++ src/Ubuntu/Components/1.3/PageStack.qml 2015-12-07 14:19:44 +0000
2845@@ -16,6 +16,7 @@
2846
2847 import QtQuick 2.4
2848 import "../1.2/stack.js" as Stack
2849+import Ubuntu.Components 1.3
2850
2851 /*!
2852 \qmltype PageStack
2853@@ -171,6 +172,13 @@
2854 } else {
2855 internal.pushWrapperObject();
2856 }
2857+ // set the back action for Page.header:
2858+ if (pageObject && pageObject.hasOwnProperty("header") && pageObject.header &&
2859+ pageObject.header.hasOwnProperty("navigationActions")) {
2860+ // Page.header is an instance of PageHeader.
2861+ pageObject.header.navigationActions = [ backAction ];
2862+ }
2863+
2864 return pageObject;
2865 }
2866
2867@@ -206,6 +214,16 @@
2868 internal.stackUpdated();
2869 }
2870
2871+ Action {
2872+ // used when the Page has a Page.header property set.
2873+ id: backAction
2874+ visible: pageStack.depth > 0
2875+ iconName: "back"
2876+ text: "Back"
2877+ onTriggered: pageStack.pop()
2878+ objectName: "pagestack_back_action"
2879+ }
2880+
2881 QtObject {
2882 id: internal
2883 property Item headStyle: (pageStack.__propagated
2884
2885=== modified file 'src/Ubuntu/Components/1.3/PageTreeNode.qml'
2886--- src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-10-14 19:18:58 +0000
2887+++ src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-12-07 14:19:44 +0000
2888@@ -125,10 +125,6 @@
2889 if (i.isLeaf) {
2890 // children of a leaf are not part of the tree
2891 node = null;
2892- print("WARNING! " +
2893- "Do not put Page/Tabs/PageStack inside another "+
2894- "Page because that causes confusion which is the "+
2895- "active page that sets the title and actions.");
2896 } else {
2897 // current node is part of the tree with i as its parent.
2898 node = i;
2899@@ -148,6 +144,4 @@
2900 node.parentNode = internal.getParentPageTreeNode(node);
2901 }
2902 }
2903-
2904- theme.version: Toolkit.Ubuntu.toolkitVersion
2905 }
2906
2907=== modified file 'src/Ubuntu/Components/1.3/PageWrapper.qml'
2908--- src/Ubuntu/Components/1.3/PageWrapper.qml 2015-09-24 15:28:58 +0000
2909+++ src/Ubuntu/Components/1.3/PageWrapper.qml 2015-12-07 14:19:44 +0000
2910@@ -46,7 +46,7 @@
2911 property bool canDestroy: false
2912
2913 /*!
2914- Column number in MultiColumnView.
2915+ Column number in AdaptivePageLayout.
2916 */
2917 property int column: 0
2918
2919@@ -61,7 +61,7 @@
2920 property Item parentWrapper
2921
2922 /*!
2923- Page holder in MultiColumnView
2924+ Page holder in AdaptivePageLayout.
2925 */
2926 property Item pageHolder
2927
2928
2929=== modified file 'src/Ubuntu/Components/1.3/ProgressBar.qml'
2930--- src/Ubuntu/Components/1.3/ProgressBar.qml 2015-05-21 10:50:35 +0000
2931+++ src/Ubuntu/Components/1.3/ProgressBar.qml 2015-12-07 14:19:44 +0000
2932@@ -70,6 +70,5 @@
2933 */
2934 property bool showProgressPercentage: true
2935
2936- theme.version: Ubuntu.toolkitVersion
2937 styleName: "ProgressBarStyle"
2938 }
2939
2940=== modified file 'src/Ubuntu/Components/1.3/PullToRefresh.qml'
2941--- src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-05-21 10:50:35 +0000
2942+++ src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-12-07 14:19:44 +0000
2943@@ -222,7 +222,6 @@
2944 */
2945 signal refresh()
2946
2947- theme.version: Ubuntu.toolkitVersion
2948 styleName: "PullToRefreshStyle"
2949 implicitHeight: __styleInstance.implicitHeight
2950 anchors {
2951
2952=== modified file 'src/Ubuntu/Components/1.3/Scrollbar.qml'
2953--- src/Ubuntu/Components/1.3/Scrollbar.qml 2015-05-21 10:50:35 +0000
2954+++ src/Ubuntu/Components/1.3/Scrollbar.qml 2015-12-07 14:19:44 +0000
2955@@ -146,6 +146,5 @@
2956 }
2957 }
2958
2959- theme.version: Toolkit.Ubuntu.toolkitVersion
2960 styleName: "ScrollbarStyle"
2961 }
2962
2963=== modified file 'src/Ubuntu/Components/1.3/Sections.qml'
2964--- src/Ubuntu/Components/1.3/Sections.qml 2015-07-14 12:49:58 +0000
2965+++ src/Ubuntu/Components/1.3/Sections.qml 2015-12-07 14:19:44 +0000
2966@@ -29,7 +29,6 @@
2967 StyledItem {
2968 id: sections
2969 styleName: "SectionsStyle"
2970- theme.version: Ubuntu.toolkitVersion
2971
2972 /*!
2973 List of actions that represent the sections.
2974
2975=== modified file 'src/Ubuntu/Components/1.3/Slider.qml'
2976--- src/Ubuntu/Components/1.3/Slider.qml 2015-05-21 10:50:35 +0000
2977+++ src/Ubuntu/Components/1.3/Slider.qml 2015-12-07 14:19:44 +0000
2978@@ -159,7 +159,7 @@
2979 return Toolkit.MathUtils.clampAndProject(value, slider.minimumValue,
2980 slider.maximumValue, 1.0, 0.0);
2981 } else {
2982- return MathUtils.clampAndProject(value, slider.minimumValue,
2983+ return Toolkit.MathUtils.clampAndProject(value, slider.minimumValue,
2984 slider.maximumValue, 0.0, 1.0);
2985 }
2986
2987@@ -167,10 +167,10 @@
2988
2989 function valueFromNormalizedValue(normalizedValue) {
2990 if (Qt.application.layoutDirection == Qt.RightToLeft) {
2991- return MathUtils.lerp(MathUtils.clamp(normalizedValue, 0.0, 1.0),
2992+ return Toolkit.MathUtils.lerp(Toolkit.MathUtils.clamp(normalizedValue, 0.0, 1.0),
2993 slider.maximumValue, slider.minimumValue);
2994 } else {
2995- return MathUtils.lerp(MathUtils.clamp(normalizedValue, 0.0, 1.0),
2996+ return Toolkit.MathUtils.lerp(Toolkit.MathUtils.clamp(normalizedValue, 0.0, 1.0),
2997 slider.minimumValue, slider.maximumValue);
2998 }
2999 }
3000@@ -206,6 +206,5 @@
3001 onLiveValueChanged: if (isPressed) slider.requestFocus(Qt.MouseFocusReason)
3002 }
3003
3004- theme.version: Toolkit.Ubuntu.toolkitVersion
3005 styleName: "SliderStyle"
3006 }
3007
3008=== modified file 'src/Ubuntu/Components/1.3/TabBar.qml'
3009--- src/Ubuntu/Components/1.3/TabBar.qml 2015-05-21 10:50:35 +0000
3010+++ src/Ubuntu/Components/1.3/TabBar.qml 2015-12-07 14:19:44 +0000
3011@@ -97,7 +97,6 @@
3012
3013 implicitHeight: units.gu(7.5)
3014 activeFocusOnPress: true
3015- theme.version: Toolkit.Ubuntu.toolkitVersion
3016 styleName: "TabBarStyle"
3017
3018 QtObject {
3019
3020=== modified file 'src/Ubuntu/Components/1.3/TextArea.qml'
3021--- src/Ubuntu/Components/1.3/TextArea.qml 2015-09-07 10:05:58 +0000
3022+++ src/Ubuntu/Components/1.3/TextArea.qml 2015-12-07 14:19:44 +0000
3023@@ -538,6 +538,13 @@
3024 */
3025 property alias wrapMode:editor.wrapMode
3026
3027+ /*!
3028+ Whether the TextArea should gain active focus on a mouse press. By default
3029+ this is set to true.
3030+ \qmlproperty bool activeFocusOnPress
3031+ */
3032+ property alias activeFocusOnPress: editor.activeFocusOnPress
3033+
3034 // signals
3035 /*!
3036 This handler is called when the user clicks on a link embedded in the text.
3037@@ -752,6 +759,7 @@
3038
3039 opacity: enabled ? 1.0 : 0.3
3040 activeFocusOnPress: true
3041+ activeFocusOnTab: true
3042
3043 /*!\internal */
3044 onVisibleChanged: {
3045@@ -858,7 +866,7 @@
3046 wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
3047 mouseSelectionMode: TextEdit.SelectWords
3048 selectByMouse: true
3049- activeFocusOnPress: control.activeFocusOnPress
3050+ activeFocusOnPress: true
3051 onActiveFocusChanged: if (!activeFocus && inputHandler.popover) PopupUtils.close(inputHandler.popover)
3052 cursorDelegate: TextCursor {
3053 handler: inputHandler
3054@@ -886,6 +894,5 @@
3055 }
3056 }
3057
3058- theme.version: Ubuntu.Ubuntu.toolkitVersion
3059 styleName: "TextAreaStyle"
3060 }
3061
3062=== modified file 'src/Ubuntu/Components/1.3/TextCursor.qml'
3063--- src/Ubuntu/Components/1.3/TextCursor.qml 2015-10-30 13:38:52 +0000
3064+++ src/Ubuntu/Components/1.3/TextCursor.qml 2015-12-07 14:19:44 +0000
3065@@ -41,7 +41,6 @@
3066 handler.main.cursorDelegate :
3067 __styleInstance.cursorDelegate
3068
3069- theme.version: Ubuntu.Ubuntu.toolkitVersion
3070 styleName: "TextCursorStyle"
3071
3072 objectName: "textCursor"
3073
3074=== modified file 'src/Ubuntu/Components/1.3/TextField.qml'
3075--- src/Ubuntu/Components/1.3/TextField.qml 2015-09-07 10:05:58 +0000
3076+++ src/Ubuntu/Components/1.3/TextField.qml 2015-12-07 14:19:44 +0000
3077@@ -172,6 +172,13 @@
3078 property alias acceptableInput: editor.acceptableInput
3079
3080 /*!
3081+ Whether the TextField should gain active focus on a mouse press. By default
3082+ this is set to true.
3083+ \qmlproperty bool activeFocusOnPress
3084+ */
3085+ property alias activeFocusOnPress: editor.activeFocusOnPress
3086+
3087+ /*!
3088 Whether the TextField should scroll when the text is longer than the width.
3089 By default this is set to true.
3090
3091@@ -810,6 +817,7 @@
3092
3093 opacity: enabled ? 1.0 : 0.3
3094 activeFocusOnPress: true
3095+ activeFocusOnTab: true
3096
3097 /*! \internal */
3098 onVisibleChanged: {
3099@@ -870,6 +878,8 @@
3100 for (var i = 0; i < children.length; i++) {
3101 children[i].parent = leftPane;
3102 children[i].anchors.verticalCenter = verticalCenter;
3103+ children[i].activeFocusOnPress = false;
3104+ children[i].activeFocusOnTab = false;
3105 }
3106 }
3107 }
3108@@ -892,6 +902,8 @@
3109 for (var i = 0; i < children.length; i++) {
3110 children[i].parent = rightPane;
3111 children[i].anchors.verticalCenter = verticalCenter;
3112+ children[i].activeFocusOnPress = false;
3113+ children[i].activeFocusOnTab = false;
3114 }
3115 }
3116 }
3117@@ -900,6 +912,7 @@
3118 id: clearButton
3119 objectName: "clear_button"
3120 activeFocusOnPress: false
3121+ activeFocusOnTab: false
3122
3123 anchors {
3124 top: parent.top
3125@@ -993,7 +1006,7 @@
3126
3127 // overrides
3128 selectByMouse: true
3129- activeFocusOnPress: control.activeFocusOnPress
3130+ activeFocusOnPress: true
3131 onActiveFocusChanged: if (!activeFocus && inputHandler.popover) PopupUtils.close(inputHandler.popover)
3132
3133 // input selection and navigation handling
3134@@ -1013,6 +1026,5 @@
3135 cursorPosition = 0;
3136 }
3137
3138- theme.version: Ubuntu.Ubuntu.toolkitVersion
3139 styleName: "TextFieldStyle"
3140 }
3141
3142=== modified file 'src/Ubuntu/Components/1.3/TextInputPopover.qml'
3143--- src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-09-16 05:28:29 +0000
3144+++ src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-12-07 14:19:44 +0000
3145@@ -86,7 +86,6 @@
3146 width: Math.max(units.gu(5), implicitWidth) + units.gu(2)
3147 height: units.gu(6)
3148 action: actions[modelData]
3149- theme.version: Ubuntu.toolkitVersion
3150 styleName: "ToolbarButtonStyle"
3151 }
3152 }
3153
3154=== modified file 'src/Ubuntu/Components/1.3/Toolbar.qml'
3155--- src/Ubuntu/Components/1.3/Toolbar.qml 2015-05-21 10:50:35 +0000
3156+++ src/Ubuntu/Components/1.3/Toolbar.qml 2015-12-07 14:19:44 +0000
3157@@ -135,7 +135,6 @@
3158 property bool opened: toolbar.opened
3159 property bool animating: toolbar.animating
3160
3161- theme.version: Toolkit.Ubuntu.toolkitVersion
3162 styleName: "ToolbarStyle"
3163 }
3164
3165
3166=== modified file 'src/Ubuntu/Components/1.3/ToolbarButton.qml'
3167--- src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-05-21 10:50:35 +0000
3168+++ src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-12-07 14:19:44 +0000
3169@@ -84,6 +84,5 @@
3170 height: parent ? parent.height : undefined
3171 width: units.gu(5)
3172
3173- theme.version: Ubuntu.toolkitVersion
3174 styleName: "ToolbarButtonStyle"
3175 }
3176
3177=== removed file 'src/Ubuntu/Components/1.3/mathUtils.js'
3178--- src/Ubuntu/Components/1.3/mathUtils.js 2015-07-24 18:25:07 +0000
3179+++ src/Ubuntu/Components/1.3/mathUtils.js 1970-01-01 00:00:00 +0000
3180@@ -1,61 +0,0 @@
3181-/*
3182- * Copyright 2012-2015 Canonical Ltd.
3183- *
3184- * This program is free software; you can redistribute it and/or modify
3185- * it under the terms of the GNU Lesser General Public License as published by
3186- * the Free Software Foundation; version 3.
3187- *
3188- * This program is distributed in the hope that it will be useful,
3189- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3190- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3191- * GNU Lesser General Public License for more details.
3192- *
3193- * You should have received a copy of the GNU Lesser General Public License
3194- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3195- */
3196-
3197-/*!
3198- \qmltype mathUtils
3199- \inqmlmodule Ubuntu.Components 1.3
3200- \ingroup ubuntu
3201- \brief Various mathematical utility functions.
3202- */
3203-
3204-.pragma library
3205-
3206-/*!
3207- \qmlmethod mathUtils::clamp(x, min, max)
3208- Ensure the value x is between min and max
3209- */
3210-function clamp(x, min, max) {
3211- if (min <= max) {
3212- return Math.max(min, Math.min(x, max));
3213- } else {
3214- // swap min/max if min > max
3215- return clamp(x, max, min);
3216- }
3217-}
3218-
3219-/*!
3220- \qmlmethod mathUtils::lerp(delta, from, to)
3221- Get the linear interpolation
3222- */
3223-function lerp(delta, from, to) {
3224- return ((1.0 - delta) * from) + (delta * to);
3225-}
3226-
3227-/*!
3228- \qmlmethod mathUtils::projectValue(x, xmin, xmax, ymin, ymax)
3229- Linearly project a value x from [xmin, xmax] into [ymin, ymax]
3230- */
3231-function projectValue(x, xmin, xmax, ymin, ymax) {
3232- return ((x - xmin) * ymax - (x - xmax) * ymin) / (xmax - xmin)
3233-}
3234-
3235-/*!
3236- \qmlmethod mathUtils::clampAndProject(x, xmin, xmax, ymin, ymax)
3237- Linearly project a value x, but in addition to projectValue it's clamped to xmin/xmax first
3238- */
3239-function clampAndProject(x, xmin, xmax, ymin, ymax) {
3240- return projectValue(clamp(x, xmin, xmax), xmin, xmax, ymin, ymax)
3241-}
3242
3243=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
3244--- src/Ubuntu/Components/ComponentModule.pro 2015-10-02 22:48:13 +0000
3245+++ src/Ubuntu/Components/ComponentModule.pro 2015-12-07 14:19:44 +0000
3246@@ -43,7 +43,6 @@
3247 1.2/MainView12.qml \
3248 1.2/MainViewBase.qml \
3249 1.2/MainView.qml \
3250- 1.2/mathUtils.js \
3251 1.2/Object.qml \
3252 1.2/OptionSelectorDelegate.qml \
3253 1.2/OptionSelector.qml \
3254@@ -60,7 +59,6 @@
3255 1.2/Panel.qml \
3256 1.2/PullToRefresh.qml \
3257 1.2/Scrollbar.qml \
3258- 1.2/scrollbarUtils.js \
3259 1.2/Slider.qml \
3260 1.2/sliderUtils.js \
3261 1.2/stack.js \
3262@@ -96,7 +94,6 @@
3263 1.3/InputHandler.qml \
3264 1.3/MainViewBase.qml \
3265 1.3/MainView.qml \
3266- 1.3/mathUtils.js \
3267 1.3/OptionSelectorDelegate.qml \
3268 1.3/OptionSelector.qml \
3269 1.3/OrientationHelper.qml \
3270@@ -132,16 +129,14 @@
3271 1.3/UbuntuListView.qml \
3272 1.3/UbuntuNumberAnimation.qml \
3273 1.3/ListItemPopover.qml \
3274- 1.3/BottomEdgeHint.qml \
3275 1.3/PageColumn.qml \
3276 1.3/PageColumnsLayout.qml \
3277 1.3/ProgressionSlot.qml \
3278- 1.3/PageHeader.qml \
3279+ 1.3/PageHeader.qml \
3280
3281 OTHER_FILES+= qmldir \
3282 1.3/CrossFadeImage.qdoc \
3283 1.3/UbuntuListView11.qdoc \
3284- 1.3/Page.qdoc \
3285 1.3/PageHeadConfiguration.qdoc \
3286 1.3/MainView.qdoc \
3287 1.3/Icon.qdoc
3288
3289=== modified file 'src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml'
3290--- src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-05-22 13:54:38 +0000
3291+++ src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-12-07 14:19:44 +0000
3292@@ -216,7 +216,6 @@
3293 right: parent.right
3294 }
3295 state: itemSelector.expanded ? "expanded" : "collapsed"
3296- theme.version: Ubuntu.toolkitVersion
3297 styleName: "ListItemOptionSelectorStyle"
3298
3299 states: [ State {
3300
3301=== modified file 'src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml'
3302--- src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-05-22 13:54:38 +0000
3303+++ src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-12-07 14:19:44 +0000
3304@@ -25,6 +25,5 @@
3305 property bool showSplit: false
3306 property real splitMargin
3307
3308- theme.version: Ubuntu.toolkitVersion
3309 styleName: "ProgressionVisualStyle"
3310 }
3311
3312=== modified file 'src/Ubuntu/Components/Pickers/1.3/DatePicker.qml'
3313--- src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-05-22 13:54:38 +0000
3314+++ src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-12-07 14:19:44 +0000
3315@@ -420,7 +420,6 @@
3316 }
3317 }
3318
3319- theme.version: Ubuntu.toolkitVersion
3320 styleName: "DatePickerStyle"
3321 Binding {
3322 target: __styleInstance
3323
3324=== modified file 'src/Ubuntu/Components/Pickers/1.3/Dialer.qml'
3325--- src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-05-22 13:54:38 +0000
3326+++ src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-12-07 14:19:44 +0000
3327@@ -145,7 +145,6 @@
3328 implicitHeight: size
3329 activeFocusOnPress: true
3330
3331- theme.version: Ubuntu.toolkitVersion
3332 styleName: "DialerStyle"
3333
3334 Item {
3335
3336=== modified file 'src/Ubuntu/Components/Pickers/1.3/DialerHand.qml'
3337--- src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-05-22 13:54:38 +0000
3338+++ src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-12-07 14:19:44 +0000
3339@@ -143,7 +143,6 @@
3340 width: parent.width
3341 height: parent.height
3342 activeFocusOnPress: true
3343- theme.version: Ubuntu.toolkitVersion
3344 styleName: "DialerHandStyle"
3345
3346 /*! \internal */
3347
3348=== modified file 'src/Ubuntu/Components/Pickers/1.3/Picker.qml'
3349--- src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-09-24 20:05:52 +0000
3350+++ src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-12-07 14:19:44 +0000
3351@@ -165,7 +165,6 @@
3352
3353 activeFocusOnPress: true
3354
3355- theme.version: Ubuntu.toolkitVersion
3356 styleName: "PickerStyle"
3357
3358 /*! \internal */
3359
3360=== modified file 'src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml'
3361--- src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-09-24 20:05:52 +0000
3362+++ src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-12-07 14:19:44 +0000
3363@@ -45,7 +45,6 @@
3364 internal.itemList.currentIndex = index;
3365 }
3366
3367- theme.version: Ubuntu.toolkitVersion
3368 styleName: "PickerDelegateStyle"
3369
3370 QtObject {
3371
3372=== modified file 'src/Ubuntu/Components/Popups/1.2/Dialog.qml'
3373--- src/Ubuntu/Components/Popups/1.2/Dialog.qml 2015-04-30 08:32:44 +0000
3374+++ src/Ubuntu/Components/Popups/1.2/Dialog.qml 2015-12-07 14:19:44 +0000
3375@@ -156,6 +156,8 @@
3376 activeFocusOnPress: true
3377 width: Math.min(minimumWidth, dialog.width)
3378 anchors.centerIn: parent
3379+ clip: true
3380+ objectName: 'dialogForeground'
3381
3382 // used in the style
3383 property string title
3384@@ -166,8 +168,9 @@
3385 property real margins: units.gu(4)
3386 property real itemSpacing: units.gu(2)
3387 property Item dismissArea: dialog.dismissArea
3388+ property real keyboardHeight: dialog.anchorToKeyboard && UbuntuApplication.inputMethod.visible ? UbuntuApplication.inputMethod.keyboardRectangle.height : 0
3389
3390- height: Math.min(contentsColumn.height + foreground.margins, dialog.height)
3391+ height: Math.min(contentsColumn.height + foreground.margins, dialog.height - keyboardHeight)
3392
3393 Flickable {
3394 anchors.fill: parent
3395
3396=== modified file 'src/Ubuntu/Components/Popups/1.3/Dialog.qml'
3397--- src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-09-21 14:44:13 +0000
3398+++ src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-12-07 14:19:44 +0000
3399@@ -157,6 +157,8 @@
3400 focus: visible
3401 width: Math.min(minimumWidth, dialog.width)
3402 anchors.centerIn: parent
3403+ clip: true
3404+ objectName: 'dialogForeground'
3405
3406 // used in the style
3407 property string title
3408@@ -167,8 +169,9 @@
3409 property real margins: units.gu(4)
3410 property real itemSpacing: units.gu(2)
3411 property Item dismissArea: dialog.dismissArea
3412+ property real keyboardHeight: dialog.anchorToKeyboard && UbuntuApplication.inputMethod.visible ? UbuntuApplication.inputMethod.keyboardRectangle.height : 0
3413
3414- height: Math.min(contentsColumn.height + foreground.margins, dialog.height)
3415+ height: Math.min(contentsColumn.height + foreground.margins, dialog.height - keyboardHeight)
3416
3417 Flickable {
3418 anchors.fill: parent
3419@@ -213,7 +216,6 @@
3420 }
3421 }
3422
3423- theme.version: Ubuntu.toolkitVersion
3424 styleName: "DialogForegroundStyle"
3425 }
3426 }
3427
3428=== modified file 'src/Ubuntu/Components/Popups/1.3/Popover.qml'
3429--- src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-08-12 19:53:20 +0000
3430+++ src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-12-07 14:19:44 +0000
3431@@ -241,7 +241,6 @@
3432 signal showCompleted()
3433 signal hideCompleted()
3434
3435- theme.version: Ubuntu.toolkitVersion
3436 styleName: "PopoverForegroundStyle"
3437 }
3438
3439
3440=== modified file 'src/Ubuntu/Components/Popups/1.3/SheetBase.qml'
3441--- src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-05-22 13:54:38 +0000
3442+++ src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-12-07 14:19:44 +0000
3443@@ -109,7 +109,6 @@
3444 }
3445 }
3446
3447- theme.version: Ubuntu.toolkitVersion
3448 styleName: "SheetForegroundStyle"
3449 }
3450 }
3451
3452=== modified file 'src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml'
3453--- src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml 2015-10-10 13:02:00 +0000
3454+++ src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml 2015-12-07 14:19:44 +0000
3455@@ -51,7 +51,7 @@
3456 property Component titleComponent
3457
3458 /*!
3459- The height of the header excluding the divider and sections.
3460+ The height of the header excluding the divider and extension.
3461 */
3462 property real contentHeight
3463 }
3464
3465=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
3466--- src/Ubuntu/Components/Styles/Styles.pro 2015-10-08 21:19:56 +0000
3467+++ src/Ubuntu/Components/Styles/Styles.pro 2015-12-07 14:19:44 +0000
3468@@ -13,7 +13,3 @@
3469 load(ubuntu_qml_module)
3470
3471 OTHER_FILES+=qmldir
3472-
3473-
3474-
3475-
3476
3477=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml'
3478--- src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-04-24 14:52:19 +0000
3479+++ src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-12-07 14:19:44 +0000
3480@@ -20,6 +20,7 @@
3481
3482 Item {
3483 id: ambianceStyle
3484+ objectName: "OptionSelector12"
3485
3486 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
3487 property url tick: Qt.resolvedUrl("../artwork/tick.png")
3488
3489=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/ScrollbarStyle.qml'
3490--- src/Ubuntu/Components/Themes/Ambiance/1.2/ScrollbarStyle.qml 2015-04-24 14:52:19 +0000
3491+++ src/Ubuntu/Components/Themes/Ambiance/1.2/ScrollbarStyle.qml 2015-12-07 14:19:44 +0000
3492@@ -85,7 +85,7 @@
3493 property Flickable flickableItem: styledItem.flickableItem
3494 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.0
3495 && contentSize > 0.0 && contentSize > pageSize
3496- property bool isVertical: ScrollbarUtils.isVertical(styledItem)
3497+ property bool isVertical: (styledItem.align === Qt.AlignLeading) || (styledItem.align === Qt.AlignTrailing)
3498 property bool frontAligned: (styledItem.align === Qt.AlignLeading)
3499 property bool rearAligned: (styledItem.align === Qt.AlignTrailing)
3500 property bool topAligned: (styledItem.align === Qt.AlignTop)
3501@@ -94,6 +94,83 @@
3502 property real pageSize: (isVertical) ? styledItem.height : styledItem.width
3503 property real contentSize: (isVertical) ? styledItem.flickableItem.contentHeight : styledItem.flickableItem.contentWidth
3504
3505+ /*!
3506+ \internal
3507+ Object storing property names used in calculations.
3508+ */
3509+ QtObject {
3510+ id: scrollbarUtils
3511+
3512+ property string propOrigin: (isVertical) ? "originY" : "originX"
3513+ property string propContent: (isVertical) ? "contentY" : "contentX"
3514+ property string propPosRatio: (isVertical) ? "yPosition" : "xPosition"
3515+ property string propSizeRatio: (isVertical) ? "heightRatio" : "widthRatio"
3516+ property string propCoordinate: (isVertical) ? "y" : "x"
3517+ property string propSize: (isVertical) ? "height" : "width"
3518+
3519+ /*!
3520+ \internal
3521+ Calculates the slider position based on the visible area's ratios.
3522+ */
3523+ function sliderPos(min, max) {
3524+ return MathUtils.clamp(styledItem.flickableItem.visibleArea[propPosRatio] * styledItem.flickableItem[propSize], min, max);
3525+ }
3526+
3527+ /*!
3528+ \internal
3529+ Calculates the slider size for ListViews based on the visible area's position
3530+ and size ratios, clamping it between min and max.
3531+
3532+ The function can be used in Scrollbar styles to calculate the size of the slider.
3533+ */
3534+ function sliderSize(min, max) {
3535+ var sizeRatio = styledItem.flickableItem.visibleArea[propSizeRatio];
3536+ var posRatio = styledItem.flickableItem.visibleArea[propPosRatio];
3537+ var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
3538+ var startPos = posRatio * (max - sizeUnderflow)
3539+ var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
3540+ var overshootStart = startPos < 0 ? -startPos : 0
3541+ var overshootEnd = endPos > max ? endPos - max : 0
3542+
3543+ // overshoot adjusted start and end
3544+ var adjustedStartPos = startPos + overshootStart
3545+ var adjustedEndPos = endPos - overshootStart - overshootEnd
3546+
3547+ // final position and size of thumb
3548+ var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
3549+ var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
3550+
3551+ return result;
3552+ }
3553+
3554+ /*!
3555+ \internal
3556+ The function calculates and clamps the position to be scrolled to the minimum
3557+ and maximum values.
3558+
3559+ The scroll and drag functions require a slider that does not have any minimum
3560+ size set (meaning the minimum is set to 0.0). Implementations should consider
3561+ using an invisible cursor to drag the slider and the ListView position.
3562+ */
3563+ function scrollAndClamp(amount, min, max) {
3564+ return styledItem.flickableItem[propOrigin] +
3565+ MathUtils.clamp(styledItem.flickableItem[propContent] - styledItem.flickableItem[propOrigin] + amount,
3566+ min, max);
3567+ }
3568+
3569+ /*!
3570+ \internal
3571+ The function calculates the new position of the dragged slider. The amount is
3572+ relative to the contentSize, which is either the flickable's contentHeight or
3573+ contentWidth or other calculated value, depending on its orientation. The pageSize
3574+ specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
3575+ */
3576+ function dragAndClamp(cursor, contentSize, pageSize) {
3577+ styledItem.flickableItem[propContent] =
3578+ styledItem.flickableItem[propOrigin] + cursor[propCoordinate] * contentSize / pageSize;
3579+ }
3580+ }
3581+
3582 /*****************************************
3583 Visuals
3584 *****************************************/
3585@@ -231,13 +308,13 @@
3586 // total size of the flickable.
3587 Item {
3588 id: scrollCursor
3589- x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)
3590- y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)
3591- width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)
3592- height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)
3593+ x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)
3594+ y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)
3595+ width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)
3596+ height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)
3597
3598 function drag() {
3599- ScrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);
3600+ scrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);
3601 }
3602 }
3603
3604@@ -253,10 +330,10 @@
3605 bottom: (!isVertical) ? scrollbarArea.bottom : undefined
3606 }
3607
3608- x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)
3609- y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)
3610- width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)
3611- height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)
3612+ x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)
3613+ y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)
3614+ width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)
3615+ height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)
3616 radius: visuals.sliderRadius
3617
3618 Behavior on width {
3619@@ -275,7 +352,7 @@
3620 }
3621
3622 function scroll(amount) {
3623- scrollAnimation.to = ScrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);
3624+ scrollAnimation.to = scrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);
3625 scrollAnimation.restart();
3626 }
3627 }
3628
3629=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml'
3630--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-10-15 14:17:25 +0000
3631+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-12-07 14:19:44 +0000
3632@@ -34,7 +34,7 @@
3633 */
3634 defaultDelegate: AbstractButton {
3635 style: IconButtonStyle { }
3636- objectName: action.objectName + "_action_button"
3637+ objectName: action.objectName + "_button"
3638 height: parent ? parent.height : undefined
3639 action: modelData
3640 }
3641@@ -88,7 +88,7 @@
3642 iconSource: actionBarStyle.overflowIconSource
3643 iconName: actionBarStyle.overflowIconName
3644 text: actionBarStyle.overflowText
3645- objectName: "overflow"
3646+ objectName: "overflow_action"
3647 visible: numberOfSlots.requested > numberOfSlots.available
3648 onTriggered: {
3649 var overflowButton = actionsRepeater.itemAt(actionsRepeater.count - 1);
3650
3651=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml'
3652--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml 2015-04-25 07:36:13 +0000
3653+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml 2015-12-07 14:19:44 +0000
3654@@ -22,7 +22,7 @@
3655
3656 anchors.fill: parent
3657 smooth: true
3658- visible: styledItem.running
3659+ visible: styledItem.running && styledItem.visible
3660 fillMode: Image.PreserveAspectFit
3661 horizontalAlignment: Image.AlignHCenter
3662 verticalAlignment: Image.AlignVCenter
3663
3664=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml'
3665--- src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 1970-01-01 00:00:00 +0000
3666+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 2015-12-07 14:19:44 +0000
3667@@ -0,0 +1,149 @@
3668+/*
3669+ * Copyright 2015 Canonical Ltd.
3670+ *
3671+ * This program is free software; you can redistribute it and/or modify
3672+ * it under the terms of the GNU Lesser General Public License as published by
3673+ * the Free Software Foundation; version 3.
3674+ *
3675+ * This program is distributed in the hope that it will be useful,
3676+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3677+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3678+ * GNU Lesser General Public License for more details.
3679+ *
3680+ * You should have received a copy of the GNU Lesser General Public License
3681+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3682+ */
3683+
3684+import QtQuick 2.4
3685+import Ubuntu.Components 1.3
3686+import Ubuntu.Components.ListItems 1.3
3687+
3688+Item {
3689+ id: bottomEdgeHintStyle
3690+ implicitWidth: styledItem.parent.width
3691+ implicitHeight: units.gu(4)
3692+
3693+ readonly property BottomEdgeHint hint: styledItem
3694+
3695+ // translate hint status into state
3696+ state: {
3697+ switch (hint.status) {
3698+ case BottomEdgeHint.Hidden: return "Hidden";
3699+ case BottomEdgeHint.Inactive: return "Inactive"
3700+ case BottomEdgeHint.Active: return "Active"
3701+ case BottomEdgeHint.Locked: return "Locked"
3702+ }
3703+ }
3704+
3705+ states: [
3706+ State {
3707+ name: "Inactive"
3708+ extend: ""
3709+ },
3710+ State {
3711+ name: "Active"
3712+ PropertyChanges {
3713+ target: h1
3714+ anchors.verticalCenterOffset: styledItem.height / 2
3715+ }
3716+ PropertyChanges {
3717+ target: h2
3718+ anchors.topMargin: 0
3719+ }
3720+ },
3721+ State {
3722+ name: "Hidden"
3723+ PropertyChanges {
3724+ target: styledItem
3725+ opacity: 0.0
3726+ }
3727+ },
3728+ State {
3729+ name: "Locked"
3730+ PropertyChanges {
3731+ target: h1
3732+ anchors.verticalCenterOffset: styledItem.height / 2
3733+ }
3734+ PropertyChanges {
3735+ target: h2
3736+ anchors.topMargin: 0
3737+ }
3738+ }
3739+ ]
3740+ transitions: [
3741+ Transition {
3742+ from: "*"
3743+ to: "Active"
3744+ reversible: true
3745+ UbuntuNumberAnimation {
3746+ targets: [h1, h2]
3747+ properties: "anchors.verticalCenterOffset, anchors.topMargin"
3748+ }
3749+ },
3750+ Transition {
3751+ from: "*"
3752+ to: "Hidden"
3753+ reversible: true
3754+ UbuntuNumberAnimation {
3755+ target: styledItem
3756+ property: "opacity"
3757+ duration: UbuntuAnimation.SlowDuration
3758+ }
3759+ }
3760+ ]
3761+
3762+ clip: true
3763+
3764+ Icon {
3765+ id: h1
3766+ width: units.gu(2)
3767+ height: width
3768+ anchors {
3769+ centerIn: parent
3770+ topMargin: styledItem.height
3771+ }
3772+ name: "up"
3773+ }
3774+
3775+ Rectangle {
3776+ id: h2
3777+ anchors {
3778+ top: parent.top
3779+ left: parent.left
3780+ right: parent.right
3781+ topMargin: styledItem.height
3782+ }
3783+ height: styledItem.height
3784+ color: theme.palette.normal.overlay
3785+ ThinDivider {
3786+ anchors.top: parent.top
3787+ }
3788+
3789+ Row {
3790+ anchors {
3791+ top: parent.top
3792+ bottom: parent.bottom
3793+ horizontalCenter: parent.horizontalCenter
3794+ }
3795+ spacing: units.gu(1)
3796+ Icon {
3797+ id: icon
3798+ name: styledItem.iconName
3799+ source: styledItem.iconSource
3800+ width: height
3801+ height: units.gu(2)
3802+ anchors.verticalCenter: parent.verticalCenter
3803+ color: theme.palette.normal.overlayText
3804+ }
3805+ Label {
3806+ id: label
3807+ text: styledItem.text
3808+ textSize: Label.Medium
3809+ color: theme.palette.normal.overlayText
3810+ height: styledItem.height
3811+ anchors.verticalCenter: parent.verticalCenter
3812+ verticalAlignment: Text.AlignVCenter
3813+ }
3814+ }
3815+ }
3816+}
3817
3818=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeStyle.qml'
3819--- src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeStyle.qml 1970-01-01 00:00:00 +0000
3820+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeStyle.qml 2015-12-07 14:19:44 +0000
3821@@ -0,0 +1,118 @@
3822+/*
3823+ * Copyright (C) 2015 Canonical, Ltd.
3824+ *
3825+ * This program is free software; you can redistribute it and/or modify
3826+ * it under the terms of the GNU General Public License as published by
3827+ * the Free Software Foundation; version 3.
3828+ *
3829+ * This program is distributed in the hope that it will be useful,
3830+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3831+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832+ * GNU General Public License for more details.
3833+ *
3834+ * You should have received a copy of the GNU General Public License
3835+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3836+ */
3837+import QtQuick 2.4
3838+import Ubuntu.Components 1.3
3839+import Ubuntu.Components.Styles 1.3
3840+
3841+BottomEdgeStyle {
3842+ id: bottomEdgeStyle
3843+ //setup properties
3844+ property BottomEdge bottomEdge: styledItem
3845+ panel: panelItem
3846+ contentItem: loader.item
3847+ panelAnimation: panelBehavior
3848+ revealThreshold: bottomEdge.hint.height + units.gu(2)
3849+
3850+ // own styling properties
3851+ property color backgroundColor: Qt.rgba(0, 0, 0, Math.min(0.25, (height - revealThreshold - panelItem.y) / (height - revealThreshold)))
3852+ property color panelColor: theme.palette.normal.overlay
3853+ property color shadowColor: "#000000"
3854+
3855+ anchors.fill: parent
3856+
3857+ Rectangle {
3858+ id: background
3859+ anchors.fill: parent
3860+ color: backgroundColor
3861+ z: -1
3862+ }
3863+
3864+ Rectangle {
3865+ id: panelItem
3866+ objectName: "bottomedge_panel"
3867+ anchors {
3868+ left: parent.left
3869+ right: parent.right
3870+ top: parent.bottom
3871+ topMargin: bottomEdge.status >= BottomEdge.Revealed
3872+ ? -(bottomEdge.height * bottomEdge.dragProgress)
3873+ : 0
3874+ }
3875+ height: loader.item ? loader.item.height : 0
3876+ color: panelColor
3877+ opacity: bottomEdge.status >= BottomEdge.Revealed ? 1.0 : 0.0
3878+
3879+ Behavior on anchors.topMargin { UbuntuNumberAnimation { id: panelBehavior } }
3880+
3881+ state: bottomEdge.status > BottomEdge.Hidden ? "drop-hint" : ""
3882+ states: [
3883+ State {
3884+ name: "drop-hint"
3885+ PropertyChanges {
3886+ target: bottomEdge.hint
3887+ restoreEntryValues: false
3888+ status: BottomEdgeHint.Inactive
3889+ }
3890+ }
3891+ ]
3892+
3893+ // shadows
3894+ Rectangle {
3895+ id: topShadow
3896+ anchors {
3897+ bottom: parent.top
3898+ left: parent.left
3899+ right: parent.right
3900+ }
3901+ height: units.gu(1.5)
3902+ gradient: Gradient {
3903+ GradientStop { position: 0.0; color: Qt.rgba(shadowColor.r, shadowColor.g, shadowColor.b, 0.0) }
3904+ GradientStop { position: 0.75; color: Qt.rgba(shadowColor.r, shadowColor.g, shadowColor.b, 0.05) }
3905+ GradientStop { position: 1.0; color: Qt.rgba(shadowColor.r, shadowColor.g, shadowColor.b, 0.1) }
3906+ }
3907+ }
3908+ Rectangle {
3909+ id: bottomShadow
3910+ anchors {
3911+ top: parent.bottom
3912+ left: parent.left
3913+ right: parent.right
3914+ }
3915+ height: units.gu(1.5)
3916+ rotation: 180
3917+ gradient: Gradient {
3918+ GradientStop { position: 0.0; color: Qt.rgba(shadowColor.r, shadowColor.g, shadowColor.b, 0.0) }
3919+ GradientStop { position: 0.75; color: Qt.rgba(shadowColor.r, shadowColor.g, shadowColor.b, 0.05) }
3920+ GradientStop { position: 1.0; color: Qt.rgba(shadowColor.r, shadowColor.g, shadowColor.b, 0.1) }
3921+ }
3922+ }
3923+
3924+ // content
3925+ Loader {
3926+ id: loader
3927+ anchors.horizontalCenter: parent.horizontalCenter
3928+ asynchronous: true
3929+ source: bottomEdge.status > BottomEdge.Hidden ? bottomEdge.contentUrl : ""
3930+ sourceComponent: bottomEdge.status > BottomEdge.Hidden ? bottomEdge.contentComponent : null
3931+ onItemChanged: {
3932+ if (item) {
3933+ item.parent = panelItem;
3934+ item.anchors.horizontalCenter = panelItem.horizontalCenter;
3935+ }
3936+ }
3937+ }
3938+ }
3939+}
3940
3941=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml'
3942--- src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-07-22 13:14:43 +0000
3943+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-12-07 14:19:44 +0000
3944@@ -20,6 +20,7 @@
3945
3946 Item {
3947 id: ambianceStyle
3948+ objectName: "OptionSelector13"
3949
3950 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
3951 property url tick: Qt.resolvedUrl("../artwork/tick.png")
3952
3953=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml'
3954--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2015-11-02 15:27:14 +0000
3955+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2015-12-07 14:19:44 +0000
3956@@ -405,6 +405,16 @@
3957
3958 actions: headerStyle.config.actions
3959 numberOfSlots: 3
3960+
3961+ delegate: AbstractButton {
3962+ style: IconButtonStyle { }
3963+ objectName: action.objectName + "_button"
3964+ height: parent ? parent.height : undefined
3965+ action: modelData
3966+ StyleHints {
3967+ foregroundColor: headerStyle.buttonColor
3968+ }
3969+ }
3970 }
3971 }
3972 }
3973
3974=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
3975--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-10-13 21:55:11 +0000
3976+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-12-07 14:19:44 +0000
3977@@ -21,17 +21,24 @@
3978 id: pageHeaderStyle
3979
3980 foregroundColor: theme.palette.selected.backgroundText
3981- backgroundColor: "white"
3982+ backgroundColor: theme.palette.normal.background
3983 dividerColor: Qt.rgba(0, 0, 0, 0.1)
3984 property int fontWeight: Font.Light
3985 property int textSize: Label.Large
3986
3987 contentHeight: units.gu(6)
3988- implicitHeight: contentHeight + divider.height + styledItem.sections.height
3989+ implicitHeight: contentHeight + divider.height + internal.extensionHeight
3990+
3991+ Object {
3992+ id: internal
3993+ property real extensionHeight: styledItem.extension ?
3994+ styledItem.extension.height
3995+ : styledItem.sections.height
3996+ }
3997
3998 defaultActionDelegate: AbstractButton {
3999 style: IconButtonStyle { }
4000- objectName: action.objectName + "_action_button"
4001+ objectName: action.objectName + "_button"
4002 height: parent ? parent.height : undefined
4003 action: modelData
4004 StyleHints {
4005
4006=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml'
4007--- src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2015-06-02 15:24:54 +0000
4008+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2015-12-07 14:19:44 +0000
4009@@ -85,7 +85,7 @@
4010 property Flickable flickableItem: styledItem.flickableItem
4011 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.0
4012 && contentSize > 0.0 && contentSize > pageSize
4013- property bool isVertical: ScrollbarUtils.isVertical(styledItem)
4014+ property bool isVertical: (styledItem.align === Qt.AlignLeading) || (styledItem.align === Qt.AlignTrailing)
4015 property bool frontAligned: (styledItem.align === Qt.AlignLeading)
4016 property bool rearAligned: (styledItem.align === Qt.AlignTrailing)
4017 property bool topAligned: (styledItem.align === Qt.AlignTop)
4018@@ -94,6 +94,83 @@
4019 property real pageSize: (isVertical) ? styledItem.height : styledItem.width
4020 property real contentSize: (isVertical) ? styledItem.flickableItem.contentHeight : styledItem.flickableItem.contentWidth
4021
4022+ /*!
4023+ \internal
4024+ Object storing property names used in calculations.
4025+ */
4026+ QtObject {
4027+ id: scrollbarUtils
4028+
4029+ property string propOrigin: (isVertical) ? "originY" : "originX"
4030+ property string propContent: (isVertical) ? "contentY" : "contentX"
4031+ property string propPosRatio: (isVertical) ? "yPosition" : "xPosition"
4032+ property string propSizeRatio: (isVertical) ? "heightRatio" : "widthRatio"
4033+ property string propCoordinate: (isVertical) ? "y" : "x"
4034+ property string propSize: (isVertical) ? "height" : "width"
4035+
4036+ /*!
4037+ \internal
4038+ Calculates the slider position based on the visible area's ratios.
4039+ */
4040+ function sliderPos(min, max) {
4041+ return MathUtils.clamp(styledItem.flickableItem.visibleArea[propPosRatio] * styledItem.flickableItem[propSize], min, max);
4042+ }
4043+
4044+ /*!
4045+ \internal
4046+ Calculates the slider size for ListViews based on the visible area's position
4047+ and size ratios, clamping it between min and max.
4048+
4049+ The function can be used in Scrollbar styles to calculate the size of the slider.
4050+ */
4051+ function sliderSize(min, max) {
4052+ var sizeRatio = styledItem.flickableItem.visibleArea[propSizeRatio];
4053+ var posRatio = styledItem.flickableItem.visibleArea[propPosRatio];
4054+ var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
4055+ var startPos = posRatio * (max - sizeUnderflow)
4056+ var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
4057+ var overshootStart = startPos < 0 ? -startPos : 0
4058+ var overshootEnd = endPos > max ? endPos - max : 0
4059+
4060+ // overshoot adjusted start and end
4061+ var adjustedStartPos = startPos + overshootStart
4062+ var adjustedEndPos = endPos - overshootStart - overshootEnd
4063+
4064+ // final position and size of thumb
4065+ var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
4066+ var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
4067+
4068+ return result;
4069+ }
4070+
4071+ /*!
4072+ \internal
4073+ The function calculates and clamps the position to be scrolled to the minimum
4074+ and maximum values.
4075+
4076+ The scroll and drag functions require a slider that does not have any minimum
4077+ size set (meaning the minimum is set to 0.0). Implementations should consider
4078+ using an invisible cursor to drag the slider and the ListView position.
4079+ */
4080+ function scrollAndClamp(amount, min, max) {
4081+ return styledItem.flickableItem[propOrigin] +
4082+ MathUtils.clamp(styledItem.flickableItem[propContent] - styledItem.flickableItem[propOrigin] + amount,
4083+ min, max);
4084+ }
4085+
4086+ /*!
4087+ \internal
4088+ The function calculates the new position of the dragged slider. The amount is
4089+ relative to the contentSize, which is either the flickable's contentHeight or
4090+ contentWidth or other calculated value, depending on its orientation. The pageSize
4091+ specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
4092+ */
4093+ function dragAndClamp(cursor, contentSize, pageSize) {
4094+ styledItem.flickableItem[propContent] =
4095+ styledItem.flickableItem[propOrigin] + cursor[propCoordinate] * contentSize / pageSize;
4096+ }
4097+ }
4098+
4099 /*****************************************
4100 Visuals
4101 *****************************************/
4102@@ -231,13 +308,13 @@
4103 // total size of the flickable.
4104 Item {
4105 id: scrollCursor
4106- x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)
4107- y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)
4108- width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)
4109- height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)
4110+ x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)
4111+ y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)
4112+ width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)
4113+ height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)
4114
4115 function drag() {
4116- ScrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);
4117+ scrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);
4118 }
4119 }
4120
4121@@ -253,10 +330,10 @@
4122 bottom: (!isVertical) ? scrollbarArea.bottom : undefined
4123 }
4124
4125- x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)
4126- y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)
4127- width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)
4128- height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)
4129+ x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)
4130+ y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)
4131+ width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)
4132+ height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)
4133 radius: visuals.sliderRadius
4134
4135 Behavior on width {
4136@@ -275,7 +352,7 @@
4137 }
4138
4139 function scroll(amount) {
4140- scrollAnimation.to = ScrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);
4141+ scrollAnimation.to = scrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);
4142 scrollAnimation.restart();
4143 }
4144 }
4145
4146=== removed file 'src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js'
4147--- src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js 2015-07-23 22:12:36 +0000
4148+++ src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js 1970-01-01 00:00:00 +0000
4149@@ -1,139 +0,0 @@
4150-/*
4151- * Copyright 2012-2015 Canonical Ltd.
4152- *
4153- * This program is free software; you can redistribute it and/or modify
4154- * it under the terms of the GNU Lesser General Public License as published by
4155- * the Free Software Foundation; version 3.
4156- *
4157- * This program is distributed in the hope that it will be useful,
4158- * but WITHOUT ANY WARRANTY; without even the implied warranty of
4159- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4160- * GNU Lesser General Public License for more details.
4161- *
4162- * You should have received a copy of the GNU Lesser General Public License
4163- * along with this program. If not, see <http://www.gnu.org/licenses/>.
4164- */
4165-
4166-/*!
4167- \qmltype scrollbarUtils
4168- \inqmlmodule Ubuntu.Components 1.3
4169- \ingroup ubuntu
4170- \brief Various scrolling utility functions.
4171- */
4172-
4173-.pragma library
4174-
4175-Qt.include("mathUtils.js")
4176-
4177-/*
4178- Object storing property names used in calculations.
4179- */
4180-var _obj = {
4181- scrollbar: null,
4182- vertical: false,
4183- propOrigin: "",
4184- propContent: "",
4185- propPosRatio: "",
4186- propSizeRatio: "",
4187- propCoordinate: "",
4188- propSize: "",
4189- refresh: function () {
4190- _obj.vertical = (_obj.scrollbar.align === Qt.AlignLeading) || (_obj.scrollbar.align === Qt.AlignTrailing)
4191- _obj.propOrigin = (_obj.vertical) ? "originY" : "originX";
4192- _obj.propContent = (_obj.vertical) ? "contentY" : "contentX";
4193- _obj.propPosRatio = (_obj.vertical) ? "yPosition" : "xPosition";
4194- _obj.propSizeRatio = (_obj.vertical) ? "heightRatio" : "widthRatio";
4195- _obj.propCoordinate = (_obj.vertical) ? "y" : "x";
4196- _obj.propSize = (_obj.vertical) ? "height" : "width";
4197- }
4198-}
4199-
4200-/*
4201- Checks whether the _obj is valid or not. Must be called in every function
4202- as those can be invoked prior to the host (style) component completion.
4203- */
4204-function __check(sb) {
4205- if (sb !== null && (_obj.scrollbar !== sb)) {
4206- _obj.scrollbar = sb;
4207- sb.flickableItemChanged.connect(_obj.refresh);
4208- sb.alignChanged.connect(_obj.refresh);
4209- _obj.refresh();
4210- }
4211-
4212- return _obj.scrollbar;
4213-}
4214-
4215-/*!
4216- \qmlmethod scrollbarUtils::isVertical(scrollbar)
4217- Returns whether the scrollbar is vertical or horizontal.
4218- */
4219-function isVertical(scrollbar) {
4220- if (!__check(scrollbar)) return 0;
4221- return _obj.vertical;
4222-}
4223-
4224-/*!
4225- \qmlmethod scrollbarUtils::sliderPos(scrollbar, min, max)
4226- Calculates the slider position based on the visible area's ratios.
4227- */
4228-function sliderPos(scrollbar, min, max) {
4229- if (!__check(scrollbar)) return 0;
4230- return clamp(scrollbar.flickableItem.visibleArea[_obj.propPosRatio] * scrollbar.flickableItem[_obj.propSize], min, max);
4231-}
4232-
4233-/*!
4234- \qmlmethod scrollbarUtils::sliderSize(scrollbar, min, max)
4235- Calculates the slider size for ListViews based on the visible area's position
4236- and size ratios, clamping it between min and max.
4237-
4238- The function can be used in Scrollbar styles to calculate the size of the slider.
4239- */
4240-function sliderSize(scrollbar, min, max) {
4241- if (!__check(scrollbar)) return 0;
4242- var sizeRatio = scrollbar.flickableItem.visibleArea[_obj.propSizeRatio];
4243- var posRatio = scrollbar.flickableItem.visibleArea[_obj.propPosRatio];
4244- var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
4245- var startPos = posRatio * (max - sizeUnderflow)
4246- var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
4247- var overshootStart = startPos < 0 ? -startPos : 0
4248- var overshootEnd = endPos > max ? endPos - max : 0
4249-
4250- // overshoot adjusted start and end
4251- var adjustedStartPos = startPos + overshootStart
4252- var adjustedEndPos = endPos - overshootStart - overshootEnd
4253-
4254- // final position and size of thumb
4255- var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
4256- var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
4257-
4258- return result;
4259-}
4260-
4261-/*!
4262- \qmlmethod scrollbarUtils::scrollAndClamp(scrollbar, amount, min, max)
4263- The function calculates and clamps the position to be scrolled to the minimum
4264- and maximum values.
4265-
4266- The scroll and drag functions require a slider that does not have any minimum
4267- size set (meaning the minimum is set to 0.0). Implementations should consider
4268- using an invisible cursor to drag the slider and the ListView position.
4269- */
4270-function scrollAndClamp(scrollbar, amount, min, max) {
4271- if (!__check(scrollbar)) return 0;
4272- return scrollbar.flickableItem[_obj.propOrigin] +
4273- clamp(scrollbar.flickableItem[_obj.propContent] - scrollbar.flickableItem[_obj.propOrigin] + amount,
4274- min, max);
4275-}
4276-
4277-/*!
4278- \qmlmethod scrollbarUtils::dragAndClamp(scrollbar, cursor, contentSize, pageSize)
4279- The function calculates the new position of the dragged slider. The amount is
4280- relative to the contentSize, which is either the flickable's contentHeight or
4281- contentWidth or other calculated value, depending on its orientation. The pageSize
4282- specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
4283- */
4284-function dragAndClamp(scrollbar, cursor, contentSize, pageSize) {
4285- if (!__check(scrollbar)) return 0;
4286- scrollbar.flickableItem[_obj.propContent] =
4287- scrollbar.flickableItem[_obj.propOrigin] + cursor[_obj.propCoordinate] * contentSize / pageSize;
4288-}
4289
4290=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
4291--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-10-02 22:48:13 +0000
4292+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-12-07 14:19:44 +0000
4293@@ -113,6 +113,10 @@
4294 1.3/ToolbarStyle.qml \
4295 1.3/IconButtonStyle.qml \
4296 1.3/PageHeaderStyle.qml \
4297- $$ARTWORK_FILES
4298+ 1.3/BottomEdgeHintStyle.qml \
4299+ 1.3/BottomEdgeStyle.qml \
4300+ $$ARTWORK_FILES
4301
4302 load(ubuntu_qml_module)
4303+
4304+OTHER_FILES+=qmldir
4305
4306=== modified file 'src/Ubuntu/Components/Themes/Ambiance/qmldir'
4307--- src/Ubuntu/Components/Themes/Ambiance/qmldir 2015-10-02 22:48:13 +0000
4308+++ src/Ubuntu/Components/Themes/Ambiance/qmldir 2015-12-07 14:19:44 +0000
4309@@ -82,6 +82,7 @@
4310
4311 ListItemStyle 1.3 ./1.3/ListItemStyle.qml
4312 internal SliderUtils 1.3/sliderUtils.js
4313-internal ScrollbarUtils 1.3/scrollbarUtils.js
4314 internal ColorUtils 1.3/colorUtils.js
4315 PageHeaderStyle 1.3 ./1.3/PageHeaderStyle.qml
4316+BottomEdgeHintStyle 1.3 ./1.3/BottomEdgeHintStyle.qml
4317+BottomEdgeStyle 1.3 ./1.3/BottomEdgeStyle.qml
4318
4319=== added directory 'src/Ubuntu/Components/plugin/gestures'
4320=== added file 'src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp'
4321--- src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp 1970-01-01 00:00:00 +0000
4322+++ src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp 2015-12-07 14:19:44 +0000
4323@@ -0,0 +1,46 @@
4324+/*
4325+ * Copyright (C) 2015 Canonical, Ltd.
4326+ *
4327+ * This program is free software; you can redistribute it and/or modify
4328+ * it under the terms of the GNU General Public License as published by
4329+ * the Free Software Foundation; version 3.
4330+ *
4331+ * This program is distributed in the hope that it will be useful,
4332+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4333+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4334+ * GNU General Public License for more details.
4335+ *
4336+ * You should have received a copy of the GNU General Public License
4337+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4338+ */
4339+
4340+#include "CandidateInactivityTimer.h"
4341+
4342+namespace UbuntuGestures {
4343+
4344+CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *candidate,
4345+ AbstractTimer *timer, QObject *parent)
4346+ : QObject(parent)
4347+ , m_timer(timer)
4348+ , m_touchId(touchId)
4349+ , m_candidate(candidate)
4350+{
4351+ connect(m_timer, &AbstractTimer::timeout,
4352+ this, &CandidateInactivityTimer::onTimeout);
4353+ m_timer->setInterval(durationMs);
4354+ m_timer->setSingleShot(true);
4355+ m_timer->start();
4356+}
4357+
4358+CandidateInactivityTimer::~CandidateInactivityTimer()
4359+{
4360+ delete m_timer;
4361+}
4362+
4363+void CandidateInactivityTimer::onTimeout()
4364+{
4365+ qWarning("[TouchRegistry] Candidate for touch %d defaulted!", m_touchId);
4366+ Q_EMIT candidateDefaulted(m_touchId, m_candidate);
4367+}
4368+
4369+} // namespace UbuntuGestures
4370
4371=== added file 'src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h'
4372--- src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h 1970-01-01 00:00:00 +0000
4373+++ src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h 2015-12-07 14:19:44 +0000
4374@@ -0,0 +1,52 @@
4375+/*
4376+ * Copyright 2015 Canonical Ltd.
4377+ *
4378+ * This program is free software; you can redistribute it and/or modify
4379+ * it under the terms of the GNU Lesser General Public License as published by
4380+ * the Free Software Foundation; version 3.
4381+ *
4382+ * This program is distributed in the hope that it will be useful,
4383+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4384+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4385+ * GNU Lesser General Public License for more details.
4386+ *
4387+ * You should have received a copy of the GNU Lesser General Public License
4388+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4389+ *
4390+ */
4391+
4392+#ifndef UBUNTUGESTURES_CANDIDATE_INACTIVITY_TIMER_H
4393+#define UBUNTUGESTURES_CANDIDATE_INACTIVITY_TIMER_H
4394+
4395+#include <QtCore/QObject>
4396+
4397+class QQuickItem;
4398+
4399+#include "Timer.h"
4400+
4401+namespace UbuntuGestures {
4402+
4403+class UBUNTUGESTURESQML_EXPORT CandidateInactivityTimer : public QObject {
4404+ Q_OBJECT
4405+public:
4406+ CandidateInactivityTimer(int touchId, QQuickItem *candidate,
4407+ AbstractTimer *timer,
4408+ QObject *parent = Q_NULLPTR);
4409+
4410+ virtual ~CandidateInactivityTimer();
4411+
4412+ const int durationMs = 1000;
4413+
4414+Q_SIGNALS:
4415+ void candidateDefaulted(int touchId, QQuickItem *candidate);
4416+private Q_SLOTS:
4417+ void onTimeout();
4418+private:
4419+ AbstractTimer *m_timer;
4420+ int m_touchId;
4421+ QQuickItem *m_candidate;
4422+};
4423+
4424+} // namespace UbuntuGestures
4425+
4426+#endif // UBUNTUGESTURES_CANDIDATE_INACTIVITY_TIMER_H
4427
4428=== added file 'src/Ubuntu/Components/plugin/gestures/damper.cpp'
4429--- src/Ubuntu/Components/plugin/gestures/damper.cpp 1970-01-01 00:00:00 +0000
4430+++ src/Ubuntu/Components/plugin/gestures/damper.cpp 2015-12-07 14:19:44 +0000
4431@@ -0,0 +1,24 @@
4432+/*
4433+ * Copyright (C) 2015 Canonical, Ltd.
4434+ *
4435+ * This program is free software; you can redistribute it and/or modify
4436+ * it under the terms of the GNU General Public License as published by
4437+ * the Free Software Foundation; version 3.
4438+ *
4439+ * This program is distributed in the hope that it will be useful,
4440+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4441+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4442+ * GNU General Public License for more details.
4443+ *
4444+ * You should have received a copy of the GNU General Public License
4445+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4446+ */
4447+
4448+#include "Damper.h"
4449+#include <QDebug>
4450+
4451+QDebug operator<<(QDebug dbg, const DampedPointF &p)
4452+{
4453+ dbg.nospace() << "(" << p.x() << ", " << p.y() << ")";
4454+ return dbg.space();
4455+}
4456
4457=== added file 'src/Ubuntu/Components/plugin/gestures/damper.h'
4458--- src/Ubuntu/Components/plugin/gestures/damper.h 1970-01-01 00:00:00 +0000
4459+++ src/Ubuntu/Components/plugin/gestures/damper.h 2015-12-07 14:19:44 +0000
4460@@ -0,0 +1,89 @@
4461+/*
4462+ * Copyright (C) 2013 Canonical, Ltd.
4463+ *
4464+ * This program is free software; you can redistribute it and/or modify
4465+ * it under the terms of the GNU General Public License as published by
4466+ * the Free Software Foundation; version 3.
4467+ *
4468+ * This program is distributed in the hope that it will be useful,
4469+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4470+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4471+ * GNU General Public License for more details.
4472+ *
4473+ * You should have received a copy of the GNU General Public License
4474+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4475+ */
4476+
4477+#ifndef UBUNTU_GESTURES_DAMPER_H
4478+#define UBUNTU_GESTURES_DAMPER_H
4479+
4480+#include <QtCore/QPointF>
4481+
4482+/*
4483+ Decreases the oscillations of a value along an axis.
4484+ */
4485+template <class Type> class Damper {
4486+public:
4487+ Damper() : m_value(0), m_maxDelta(0) { }
4488+
4489+ // Maximum delta between the raw value and its dampened counterpart.
4490+ void setMaxDelta(Type maxDelta) {
4491+ if (maxDelta < 0) qFatal("Damper::maxDelta must be a positive number.");
4492+ m_maxDelta = maxDelta;
4493+ }
4494+ Type maxDelta() const { return m_maxDelta; }
4495+
4496+ void reset(Type value) {
4497+ m_value = value;
4498+ }
4499+
4500+ Type update(Type value) {
4501+ Type delta = value - m_value;
4502+ if (delta > 0 && delta > m_maxDelta) {
4503+ m_value += delta - m_maxDelta;
4504+ } else if (delta < 0 && delta < -m_maxDelta) {
4505+ m_value += delta + m_maxDelta;
4506+ }
4507+
4508+ return m_value;
4509+ }
4510+
4511+ Type value() const { return m_value; }
4512+
4513+private:
4514+ Type m_value;
4515+ Type m_maxDelta;
4516+};
4517+
4518+/*
4519+ A point that has its movement dampened.
4520+ */
4521+class DampedPointF {
4522+public:
4523+ void setMaxDelta(qreal maxDelta) {
4524+ m_x.setMaxDelta(maxDelta);
4525+ m_y.setMaxDelta(maxDelta);
4526+ }
4527+
4528+ qreal maxDelta() const { return m_x.maxDelta(); }
4529+
4530+ void reset(const QPointF &point) {
4531+ m_x.reset(point.x());
4532+ m_y.reset(point.y());
4533+ }
4534+
4535+ void update(const QPointF &point) {
4536+ m_x.update(point.x());
4537+ m_y.update(point.y());
4538+ }
4539+
4540+ qreal x() const { return m_x.value(); }
4541+ qreal y() const { return m_y.value(); }
4542+private:
4543+ Damper<qreal> m_x;
4544+ Damper<qreal> m_y;
4545+};
4546+
4547+QDebug operator<<(QDebug dbg, const DampedPointF &p);
4548+
4549+#endif // UBUNTU_GESTURES_DAMPER_H
4550
4551=== added file 'src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h'
4552--- src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h 1970-01-01 00:00:00 +0000
4553+++ src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h 2015-12-07 14:19:44 +0000
4554@@ -0,0 +1,24 @@
4555+/*
4556+ * Copyright 2015 Canonical Ltd.
4557+ *
4558+ * This program is free software; you can redistribute it and/or modify
4559+ * it under the terms of the GNU Lesser General Public License as published by
4560+ * the Free Software Foundation; version 3.
4561+ *
4562+ * This program is distributed in the hope that it will be useful,
4563+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4564+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4565+ * GNU Lesser General Public License for more details.
4566+ *
4567+ * You should have received a copy of the GNU Lesser General Public License
4568+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4569+ *
4570+ */
4571+
4572+#include <QtCore/QtGlobal>
4573+
4574+#if defined(UBUNTUGESTURESQML_LIBRARY)
4575+# define UBUNTUGESTURESQML_EXPORT Q_DECL_EXPORT
4576+#else
4577+# define UBUNTUGESTURESQML_EXPORT Q_DECL_IMPORT
4578+#endif
4579
4580=== added file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp'
4581--- src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp 1970-01-01 00:00:00 +0000
4582+++ src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp 2015-12-07 14:19:44 +0000
4583@@ -0,0 +1,958 @@
4584+/*
4585+ * Copyright (C) 2015 Canonical, Ltd.
4586+ *
4587+ * This program is free software; you can redistribute it and/or modify
4588+ * it under the terms of the GNU General Public License as published by
4589+ * the Free Software Foundation; version 3.
4590+ *
4591+ * This program is distributed in the hope that it will be useful,
4592+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4593+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4594+ * GNU General Public License for more details.
4595+ *
4596+ * You should have received a copy of the GNU General Public License
4597+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4598+ *
4599+ */
4600+
4601+#include "ucswipearea_p.h"
4602+
4603+#include <QQuickWindow>
4604+#include <QtCore/qmath.h>
4605+#include <QScreen>
4606+#include <QDebug>
4607+
4608+#include <private/qquickwindow_p.h>
4609+
4610+// local
4611+#include <UbuntuGestures/TouchOwnershipEvent>
4612+#include <UbuntuGestures/TouchRegistry>
4613+#include <UbuntuGestures/UnownedTouchEvent>
4614+
4615+using namespace UbuntuGestures;
4616+
4617+Q_LOGGING_CATEGORY(ucSwipeArea, "ubuntu.components.SwipeArea", QtMsgType::QtWarningMsg)
4618+Q_LOGGING_CATEGORY(ucActiveTouchInfo, "ubuntu.components.SwipeArea.ActiveTouchInfo", QtMsgType::QtWarningMsg)
4619+
4620+#define SA_TRACE(params) qCDebug(ucSwipeArea).nospace() << "[SwipeArea(" << qPrintable(objectName()) << ")] " << params
4621+#define TI_TRACE(params) qCDebug(ucActiveTouchInfo).nospace() << "[ActiveTouchInfo] " << params
4622+
4623+namespace {
4624+const char *statusToString(UCSwipeAreaPrivate::Status status)
4625+{
4626+ if (status == UCSwipeAreaPrivate::WaitingForTouch) {
4627+ return "WaitingForTouch";
4628+ } else if (status == UCSwipeAreaPrivate::Undecided) {
4629+ return "Undecided";
4630+ } else {
4631+ return "Recognized";
4632+ }
4633+}
4634+
4635+QString touchPointStateToString(Qt::TouchPointState state)
4636+{
4637+ switch (state) {
4638+ case Qt::TouchPointPressed:
4639+ return QStringLiteral("pressed");
4640+ case Qt::TouchPointMoved:
4641+ return QStringLiteral("moved");
4642+ case Qt::TouchPointStationary:
4643+ return QStringLiteral("stationary");
4644+ case Qt::TouchPointReleased:
4645+ return QStringLiteral("released");
4646+ default:
4647+ return QStringLiteral("INVALID_STATE");
4648+ }
4649+}
4650+
4651+QString touchEventToString(const QTouchEvent *ev)
4652+{
4653+ QString message;
4654+
4655+ switch (ev->type()) {
4656+ case QEvent::TouchBegin:
4657+ message.append("TouchBegin ");
4658+ break;
4659+ case QEvent::TouchUpdate:
4660+ message.append("TouchUpdate ");
4661+ break;
4662+ case QEvent::TouchEnd:
4663+ message.append("TouchEnd ");
4664+ break;
4665+ case QEvent::TouchCancel:
4666+ message.append("TouchCancel ");
4667+ break;
4668+ default:
4669+ message.append("INVALID_TOUCH_EVENT_TYPE ");
4670+ }
4671+
4672+ Q_FOREACH(const QTouchEvent::TouchPoint& touchPoint, ev->touchPoints()) {
4673+ message.append(
4674+ QStringLiteral("(id:%1, state:%2, scenePos:(%3,%4)) ")
4675+ .arg(touchPoint.id())
4676+ .arg(touchPointStateToString(touchPoint.state()))
4677+ .arg(touchPoint.scenePos().x())
4678+ .arg(touchPoint.scenePos().y())
4679+ );
4680+ }
4681+
4682+ return message;
4683+}
4684+
4685+} // namespace {
4686+
4687+class Direction
4688+{
4689+public:
4690+ static bool isHorizontal(UCSwipeArea::Direction type)
4691+ {
4692+ return type == UCSwipeArea::Leftwards
4693+ || type == UCSwipeArea::Rightwards
4694+ || type == UCSwipeArea::Horizontal;
4695+ }
4696+
4697+ static bool isVertical(UCSwipeArea::Direction type)
4698+ {
4699+ return type == UCSwipeArea::Upwards
4700+ || type == UCSwipeArea::Downwards
4701+ || type == UCSwipeArea::Vertical;
4702+ }
4703+
4704+ static bool isPositive(UCSwipeArea::Direction type)
4705+ {
4706+ return type == UCSwipeArea::Rightwards
4707+ || type == UCSwipeArea::Downwards
4708+ || type == UCSwipeArea::Horizontal
4709+ || type == UCSwipeArea::Vertical;
4710+ }
4711+};
4712+/*!
4713+ * \qmltype SwipeArea
4714+ * \instantiates UCSwipeArea
4715+ * \inherits Item
4716+ * \inqmlmodule Ubuntu.Components 1.3
4717+ * \since Ubuntu.Components 1.3
4718+ * \ingroup ubuntu-gestures
4719+ * \brief An area which detects axis-aligned single-finger drag gestures.
4720+ *
4721+ * The component can be used to detect gestures of a certain direction, and can
4722+ * grab gestures started on a component placed behind of the SwipeArea.
4723+ * The gesture is detected on the SwipeArea, therefore the size must be
4724+ * chosen carefully so it can properly detect the gesture.
4725+ *
4726+ * The gesture direction is specified by the \l direction property. The recognized
4727+ * and captured gesture is reported through the \l dragging property, which becomes
4728+ * \c true when the gesture is detected. If there was a component under the
4729+ * SwipeArea, the gesture will be cancelled on that component.
4730+ *
4731+ * The drag recognition is performed within the component area in the specified
4732+ * direction. If the drag deviates too much from this, recognition will fail,
4733+ * as well as if the drag or the flick is too short. Once the drag is
4734+ * intercepted, the gesture will be followed even after it leaves the detection area.
4735+ *
4736+ * Example:
4737+ * \qml
4738+ * import QtQuick 2.4
4739+ * import Ubuntu.Components 1.3
4740+ *
4741+ * MainView {
4742+ * width: units.gu(40)
4743+ * height: units.gu(70)
4744+ *
4745+ * Page {
4746+ * title: "SwipeArea sample"
4747+ * SwipeArea {
4748+ * anchors {
4749+ * left: parent.left
4750+ * right: parent.right
4751+ * bottom: parent.bottom
4752+ * }
4753+ * height: units.gu(5)
4754+ * direction: SwipeArea.Upwards
4755+ * Label {
4756+ * text: "Drag upwards"
4757+ * anchors {
4758+ * centerIn: parent
4759+ * verticalOffset: parent.dragging ? parent.distance : 0
4760+ * }
4761+ * }
4762+ * }
4763+ * }
4764+ * }
4765+ * \endqml
4766+ * \note When used with a Flickable (or ListView, GridView) always put the
4767+ * SwipeArea next to the Flickable as sibling.
4768+ */
4769+UCSwipeArea::UCSwipeArea(QQuickItem *parent)
4770+ : QQuickItem(parent)
4771+ , d(new UCSwipeAreaPrivate(this))
4772+{
4773+ d->setRecognitionTimer(new Timer(this));
4774+ d->recognitionTimer->setInterval(d->maxTime);
4775+ d->recognitionTimer->setSingleShot(true);
4776+
4777+ connect(this, &QQuickItem::enabledChanged, d, &UCSwipeAreaPrivate::giveUpIfDisabledOrInvisible);
4778+ connect(this, &QQuickItem::visibleChanged, d, &UCSwipeAreaPrivate::giveUpIfDisabledOrInvisible);
4779+}
4780+
4781+/*!
4782+ * \qmlproperty enum SwipeArea::direction
4783+ * The direction in which the gesture should move in order to be recognized.
4784+ * \table
4785+ * \header
4786+ * \li Direction
4787+ * \li Description
4788+ * \row
4789+ * \li Rightwards
4790+ * \li Along the positive direction of the X axis
4791+ * \row
4792+ * \li Leftwards
4793+ * \li Along the negative direction of the X axis
4794+ * \row
4795+ * \li Downwards
4796+ * \li Along the positive direction of the Y axis
4797+ * \row
4798+ * \li Upwards
4799+ * \li Along the negative direction of the Y axis
4800+ * \row
4801+ * \li Horizontal
4802+ * \li Along the X axis, in any direction
4803+ * \row
4804+ * \li Vertical
4805+ * \li Along the Y axis, in any direction
4806+ * \endtable
4807+ */
4808+UCSwipeArea::Direction UCSwipeArea::direction() const
4809+{
4810+ return d->direction;
4811+}
4812+
4813+void UCSwipeArea::setDirection(Direction direction)
4814+{
4815+ if (direction != d->direction) {
4816+ d->direction = direction;
4817+ Q_EMIT directionChanged(d->direction);
4818+ }
4819+}
4820+
4821+void UCSwipeAreaPrivate::setDistanceThreshold(qreal value)
4822+{
4823+ if (distanceThreshold != value) {
4824+ distanceThreshold = value;
4825+ distanceThresholdSquared = distanceThreshold * distanceThreshold;
4826+ }
4827+}
4828+
4829+void UCSwipeAreaPrivate::setMaxTime(int value)
4830+{
4831+ if (maxTime != value) {
4832+ maxTime = value;
4833+ recognitionTimer->setInterval(maxTime);
4834+ }
4835+}
4836+
4837+void UCSwipeAreaPrivate::setRecognitionTimer(UbuntuGestures::AbstractTimer *timer)
4838+{
4839+ int interval = 0;
4840+ bool timerWasRunning = false;
4841+ bool wasSingleShot = false;
4842+
4843+ // can be null when called from the constructor
4844+ if (recognitionTimer) {
4845+ wasSingleShot = recognitionTimer->isSingleShot();
4846+ interval = recognitionTimer->interval();
4847+ timerWasRunning = recognitionTimer->isRunning();
4848+ if (recognitionTimer->parent() == this) {
4849+ delete recognitionTimer;
4850+ }
4851+ }
4852+
4853+ recognitionTimer = timer;
4854+ timer->setInterval(interval);
4855+ timer->setSingleShot(wasSingleShot);
4856+ connect(timer, &UbuntuGestures::AbstractTimer::timeout,
4857+ this, &UCSwipeAreaPrivate::rejectGesture);
4858+ if (timerWasRunning) {
4859+ recognitionTimer->start();
4860+ }
4861+}
4862+
4863+void UCSwipeAreaPrivate::setTimeSource(const SharedTimeSource &timeSource)
4864+{
4865+ this->timeSource = timeSource;
4866+ activeTouches.m_timeSource = timeSource;
4867+}
4868+
4869+/*!
4870+ * \qmlproperty real SwipeArea::distance
4871+ * \readonly
4872+ * The property holds the distance of the swipe from the beginning of the gesture
4873+ * recognition to the current touch position.
4874+ */
4875+qreal UCSwipeArea::distance() const
4876+{
4877+ return d->sceneDistance;
4878+}
4879+
4880+/*!
4881+ * \qmlproperty point SwipeArea::touchPosition
4882+ * \readonly
4883+ * Position of the touch point performing the drag relative to this item.
4884+ */
4885+QPointF UCSwipeArea::touchPosition() const
4886+{
4887+ return mapFromScene(d->publicScenePos);
4888+}
4889+
4890+/*!
4891+ * \qmlproperty bool SwipeArea::dragging
4892+ * \readonly
4893+ * Reports whether a drag gesture is taking place.
4894+ */
4895+bool UCSwipeArea::dragging() const
4896+{
4897+ return d->status == UCSwipeAreaPrivate::Recognized;
4898+}
4899+
4900+/*!
4901+ * \qmlproperty bool SwipeArea::pressed
4902+ * \readonly
4903+ * Reports whether the drag area is pressed.
4904+ */
4905+bool UCSwipeArea::pressed() const
4906+{
4907+ return d->status != UCSwipeAreaPrivate::WaitingForTouch;
4908+}
4909+
4910+/*!
4911+ * \qmlproperty bool SwipeArea::immediateRecognition
4912+ * Drives whether the gesture should be recognized as soon as the touch lands on
4913+ * the area. With this property set it will work the same way as a MultiPointTouchArea,
4914+ *
4915+ * Defaults to false. In most cases this should not be set.
4916+ */
4917+bool UCSwipeArea::immediateRecognition() const
4918+{
4919+ return d->immediateRecognition;
4920+}
4921+
4922+void UCSwipeArea::setImmediateRecognition(bool enabled)
4923+{
4924+ if (d->immediateRecognition != enabled) {
4925+ d->immediateRecognition = enabled;
4926+ Q_EMIT immediateRecognitionChanged(enabled);
4927+ }
4928+}
4929+
4930+bool UCSwipeArea::event(QEvent *event)
4931+{
4932+ if (event->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
4933+ d->touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(event));
4934+ return true;
4935+ } else if (event->type() == UnownedTouchEvent::unownedTouchEventType()) {
4936+ d->unownedTouchEvent(static_cast<UnownedTouchEvent *>(event));
4937+ return true;
4938+ } else {
4939+ return QQuickItem::event(event);
4940+ }
4941+}
4942+
4943+void UCSwipeAreaPrivate::touchOwnershipEvent(TouchOwnershipEvent *event)
4944+{
4945+ if (event->gained()) {
4946+ QVector<int> ids;
4947+ ids.append(event->touchId());
4948+ SA_TRACE("grabbing touch");
4949+ q->grabTouchPoints(ids);
4950+ } else {
4951+ // We still wanna know when it ends for keeping the composition time window up-to-date
4952+ TouchRegistry::instance()->addTouchWatcher(touchId, q);
4953+
4954+ setStatus(WaitingForTouch);
4955+ }
4956+}
4957+
4958+void UCSwipeAreaPrivate::unownedTouchEvent(UnownedTouchEvent *unownedTouchEvent)
4959+{
4960+ QTouchEvent *event = unownedTouchEvent->touchEvent();
4961+
4962+ Q_ASSERT(!event->touchPointStates().testFlag(Qt::TouchPointPressed));
4963+
4964+ SA_TRACE("Unowned " << timeSource->msecsSinceReference() << " " << qPrintable(touchEventToString(event)));
4965+
4966+ switch (status) {
4967+ case WaitingForTouch:
4968+ // do nothing
4969+ break;
4970+ case Undecided:
4971+ Q_ASSERT(q->isEnabled() && q->isVisible());
4972+ unownedTouchEvent_undecided(unownedTouchEvent);
4973+ break;
4974+ default: // Recognized:
4975+ // do nothing
4976+ break;
4977+ }
4978+
4979+ activeTouches.update(event);
4980+}
4981+
4982+void UCSwipeAreaPrivate::unownedTouchEvent_undecided(UnownedTouchEvent *unownedTouchEvent)
4983+{
4984+ const QTouchEvent::TouchPoint *touchPoint = fetchTargetTouchPoint(unownedTouchEvent->touchEvent());
4985+ if (!touchPoint) {
4986+ qCritical() << "UCSwipeArea[status=Undecided]: touch " << touchId
4987+ << "missing from UnownedTouchEvent without first reaching state Qt::TouchPointReleased. "
4988+ "Considering it as released.";
4989+
4990+ TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
4991+ setStatus(WaitingForTouch);
4992+ return;
4993+ }
4994+
4995+ const QPointF &touchScenePosition = touchPoint->scenePos();
4996+
4997+ if (touchPoint->state() == Qt::TouchPointReleased) {
4998+ // touch has ended before recognition concluded
4999+ SA_TRACE("Touch has ended before recognition concluded");
5000+ TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: