Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntushape-fragment-shader-cleanup into lp:ubuntu-ui-toolkit

Proposed by Loïc Molinari
Status: Superseded
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntushape-fragment-shader-cleanup
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 14582 lines (+9405/-1600) (has conflicts)
193 files modified
components.api (+98/-83)
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/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 (+17/-7)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+7/-2)
examples/ubuntu-ui-toolkit-gallery/gallery (+1/-1)
examples/ubuntu-ui-toolkit-gallery/gallery-logging.config (+4/-0)
examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro (+2/-1)
export_modules_dir.sh (+2/-0)
features/ubuntu_qml_plugin.prf (+11/-0)
features/ubuntu_qt_module.prf (+19/-0)
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/-6)
src/Ubuntu/Components/1.3/AnimatedItem.qml (+2/-3)
src/Ubuntu/Components/1.3/AppHeader.qml (+0/-1)
src/Ubuntu/Components/1.3/BottomEdgeHint.qml (+0/-155)
src/Ubuntu/Components/1.3/Button.qml (+0/-1)
src/Ubuntu/Components/1.3/CheckBox.qml (+0/-1)
src/Ubuntu/Components/1.3/OptionSelector.qml (+0/-1)
src/Ubuntu/Components/1.3/Page.qdoc (+0/-132)
src/Ubuntu/Components/1.3/Page.qml (+100/-5)
src/Ubuntu/Components/1.3/PageHeader.qml (+24/-5)
src/Ubuntu/Components/1.3/PageStack.qml (+18/-0)
src/Ubuntu/Components/1.3/PageTreeNode.qml (+0/-2)
src/Ubuntu/Components/1.3/PageWrapper.qml (+2/-2)
src/Ubuntu/Components/1.3/ProgressBar.qml (+0/-1)
src/Ubuntu/Components/1.3/PullToRefresh.qml (+0/-1)
src/Ubuntu/Components/1.3/Scrollbar.qml (+0/-1)
src/Ubuntu/Components/1.3/Sections.qml (+0/-1)
src/Ubuntu/Components/1.3/Slider.qml (+3/-4)
src/Ubuntu/Components/1.3/TabBar.qml (+0/-1)
src/Ubuntu/Components/1.3/TextArea.qml (+0/-1)
src/Ubuntu/Components/1.3/TextCursor.qml (+0/-1)
src/Ubuntu/Components/1.3/TextField.qml (+2/-1)
src/Ubuntu/Components/1.3/TextInputPopover.qml (+0/-1)
src/Ubuntu/Components/1.3/Toolbar.qml (+0/-1)
src/Ubuntu/Components/1.3/ToolbarButton.qml (+0/-1)
src/Ubuntu/Components/1.3/mathUtils.js (+0/-61)
src/Ubuntu/Components/ComponentModule.pro (+0/-5)
src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml (+0/-1)
src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/DatePicker.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/Dialer.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/DialerHand.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/Picker.qml (+0/-1)
src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/Dialog.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/Popover.qml (+0/-1)
src/Ubuntu/Components/Popups/1.3/SheetBase.qml (+0/-1)
src/Ubuntu/Components/Styles/Styles.pro (+0/-4)
src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.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/OptionSelectorStyle.qml (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+10/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+2/-2)
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 (+3/-0)
src/Ubuntu/Components/Themes/Ambiance/qmldir (+0/-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/plugin.cpp (+6/-1)
src/Ubuntu/Components/plugin/plugin.pri (+15/-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/shaders/shape.frag (+2/-6)
src/Ubuntu/Components/plugin/shaders/shapeoverlay.frag (+2/-6)
src/Ubuntu/Components/plugin/ucbottomedgehint.cpp (+388/-0)
src/Ubuntu/Components/plugin/ucbottomedgehint.h (+92/-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 (+81/-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 (+22/-32)
src/Ubuntu/Components/plugin/ucstyleditembase.h (+8/-4)
src/Ubuntu/Components/plugin/ucstyleditembase_p.h (+5/-3)
src/Ubuntu/Components/plugin/uctheme.cpp (+36/-49)
src/Ubuntu/Components/plugin/uctheme.h (+7/-4)
src/Ubuntu/Components/plugin/ucthemingextension.cpp (+122/-139)
src/Ubuntu/Components/plugin/ucthemingextension.h (+11/-56)
src/Ubuntu/Components/plugin/ucubuntushape.cpp (+2/-0)
src/Ubuntu/Components/plugin/unixsignalhandler_p.cpp (+1/-1)
src/Ubuntu/Components/plugin/unixsignalhandler_p.h (+1/-1)
src/Ubuntu/Components/qmldir (+0/-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 (+5/-0)
src/Ubuntu/Test/plugin/uctestextras.h (+7/-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/_flickable.py (+3/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py (+2/-14)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+41/-5)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py (+2/-4)
tests/license/checklicense.sh (+1/-1)
tests/qmlapicheck.sh (+1/-1)
tests/unit/add_makecheck.pri (+1/-1)
tests/unit/add_qmlmakecheck.pri (+1/-1)
tests/unit/tst_components/tst_math_utils.qml (+77/-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_components/tst_bottomedgehint.qml (+188/-20)
tests/unit_x11/tst_components/tst_bug1510919.qml (+75/-0)
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 (+21/-3)
tests/unit_x11/tst_components/tst_pagestack.qml (+29/-20)
tests/unit_x11/tst_components/tst_slotslayout.qml (+30/-1)
tests/unit_x11/tst_components/tst_textinput_common13.qml (+39/-0)
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 (+3/-1)
ubuntu-sdk.pro (+2/-1)
ubuntu-ui-toolkit-launcher/launcher.cpp (+4/-3)
Conflict adding file tests/unit_x11/tst_components/tst_bug1510919.qml.  Moved existing file to tests/unit_x11/tst_components/tst_bug1510919.qml.moved.
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntushape-fragment-shader-cleanup
Reviewer Review Type Date Requested Status
Tim Peeters Pending
Review via email: mp+278444@code.launchpad.net

Commit message

[UbuntShape] Cleaned up fragment shaders.

Moved distance* variables to main scope and removed useless abs() calls.

Description of the change

[UbuntShape] Cleaned up fragment shaders.

Moved distance* variables to main scope and removed useless abs() calls.

To post a comment you must log in.

Unmerged revisions

1725. By Loïc Molinari

Moved distance* variables to main scope and removed useless abs().

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2015-10-15 14:17:25 +0000
+++ components.api 2015-11-24 12:22:14 +0000
@@ -31,7 +31,7 @@
31 Real31 Real
32 String32 String
33Ubuntu.Components.ActionBar 1.3: StyledItem33Ubuntu.Components.ActionBar 1.3: StyledItem
34 readonly property Action actions34 property list<Action> actions
35 property Component delegate35 property Component delegate
36 property int numberOfSlots36 property int numberOfSlots
37Ubuntu.Components.Styles.ActionBarStyle 1.3: Item37Ubuntu.Components.Styles.ActionBarStyle 1.3: Item
@@ -41,7 +41,7 @@
41 property url overflowIconSource41 property url overflowIconSource
42 property string overflowText42 property string overflowText
43Ubuntu.Components.ActionContext 1.0 0.1: QtObject43Ubuntu.Components.ActionContext 1.0 0.1: QtObject
44 default readonly property Action actions44 default property list<Action> actions
45 property bool active45 property bool active
46 function addAction(Action action)46 function addAction(Action action)
47 function removeAction(Action action)47 function removeAction(Action action)
@@ -54,15 +54,15 @@
54 function trigger()54 function trigger()
55 property string text55 property string text
56Ubuntu.Components.ActionList 1.0 0.1: QtObject56Ubuntu.Components.ActionList 1.0 0.1: QtObject
57 readonly property Action actions57 property list<Action> actions
58 default readonly property Action children58 default property list<Action> children
59Ubuntu.Components.ActionList 1.3: QtObject59Ubuntu.Components.ActionList 1.3: QtObject
60 readonly property Action actions60 property list<Action> actions
61 default readonly property Action children61 default property list<Action> children
62Ubuntu.Components.ActionManager 1.0 0.1: QtObject62Ubuntu.Components.ActionManager 1.0 0.1: QtObject
63 default readonly property Action actions63 default property list<Action> actions
64 readonly property ActionContext globalContext64 readonly property ActionContext globalContext
65 readonly property ActionContext localContexts65 property list<ActionContext> localContexts
66 signal quit()66 signal quit()
67 function addAction(Action action)67 function addAction(Action action)
68 function removeAction(Action action)68 function removeAction(Action action)
@@ -84,7 +84,7 @@
84 property bool running84 property bool running
85Ubuntu.Components.AdaptivePageLayout 1.3: PageTreeNode85Ubuntu.Components.AdaptivePageLayout 1.3: PageTreeNode
86 readonly property int columns86 readonly property int columns
87 readonly property PageColumnsLayout layouts87 property list<PageColumnsLayou> layouts
88 function var addPageToCurrentColumn(var sourcePage, var page, var properties)88 function var addPageToCurrentColumn(var sourcePage, var page, var properties)
89 function var addPageToNextColumn(var sourcePage, var page, var properties)89 function var addPageToNextColumn(var sourcePage, var page, var properties)
90 function var removePages(var page)90 function var removePages(var page)
@@ -155,7 +155,7 @@
155 property bool required155 property bool required
156 property QStringList valueNames156 property QStringList valueNames
157Ubuntu.Components.Arguments 1.0 0.1: QtObject157Ubuntu.Components.Arguments 1.0 0.1: QtObject
158 default readonly property Argument arguments158 default property list<Argument> arguments
159 property Argument defaultArgument159 property Argument defaultArgument
160 readonly property bool error160 readonly property bool error
161 readonly property string errorMessage161 readonly property string errorMessage
@@ -175,11 +175,17 @@
175 property var icon175 property var icon
176 property bool iconFrame176 property bool iconFrame
177 property bool progression177 property bool progression
178Ubuntu.Components.BottomEdgeHint 1.3: Item178Ubuntu.Components.BottomEdgeHint 1.3: ActionItem
179 property string iconName179 property int deactivateTimeout
180 property url iconSource180 property Flickable flickable
181 signal clicked()181 signal clicked()
182 property string text182 property Status status
183 readonly property SwipeArea swipeArea
184Ubuntu.Components.BottomEdgeHint.Status: Enum
185 Active
186 Hidden
187 Inactive
188 Locked
183Ubuntu.Components.Button 1.0 0.1: AbstractButton189Ubuntu.Components.Button 1.0 0.1: AbstractButton
184 property color color190 property color color
185 property QFont font191 property QFont font
@@ -221,14 +227,14 @@
221Ubuntu.Components.ColorUtils 0.1 1.0227Ubuntu.Components.ColorUtils 0.1 1.0
222Ubuntu.Components.ComboButton 1.1: Button228Ubuntu.Components.ComboButton 1.1: Button
223 property double collapsedHeight229 property double collapsedHeight
224 default readonly property QtObject comboList230 default property list<QtObject> comboList
225 readonly property double comboListHeight231 readonly property double comboListHeight
226 property color dropdownColor232 property color dropdownColor
227 property bool expanded233 property bool expanded
228 property double expandedHeight234 property double expandedHeight
229Ubuntu.Components.ComboButton 1.3: Button235Ubuntu.Components.ComboButton 1.3: Button
230 property double collapsedHeight236 property double collapsedHeight
231 default readonly property QtObject comboList237 default property list<QtObject> comboList
232 readonly property double comboListHeight238 readonly property double comboListHeight
233 property color dropdownColor239 property color dropdownColor
234 property bool expanded240 property bool expanded
@@ -318,7 +324,7 @@
318 signal closeClicked()324 signal closeClicked()
319 signal doneClicked()325 signal doneClicked()
320Ubuntu.Components.Pickers.Dialer 1.0 0.1: StyledItem326Ubuntu.Components.Pickers.Dialer 1.0 0.1: StyledItem
321 readonly property QtObject centerContent327 property list<QtObject> centerContent
322 readonly property Item centerItem328 readonly property Item centerItem
323 property double handSpace329 property double handSpace
324 readonly property var hands330 readonly property var hands
@@ -327,7 +333,7 @@
327 property double minimumValue333 property double minimumValue
328 property double size334 property double size
329Ubuntu.Components.Pickers.Dialer 1.3: StyledItem335Ubuntu.Components.Pickers.Dialer 1.3: StyledItem
330 readonly property QtObject centerContent336 property list<QtObject> centerContent
331 readonly property Item centerItem337 readonly property Item centerItem
332 property double handSpace338 property double handSpace
333 readonly property var hands339 readonly property var hands
@@ -339,18 +345,18 @@
339 readonly property Dialer dialer345 readonly property Dialer dialer
340 property DialerHandGroup hand346 property DialerHandGroup hand
341 readonly property int index347 readonly property int index
342 default readonly property QtObject overlay348 default property list<QtObject> overlay
343 property double value349 property double value
344Ubuntu.Components.Pickers.DialerHand 1.3: StyledItem350Ubuntu.Components.Pickers.DialerHand 1.3: StyledItem
345 readonly property Dialer dialer351 readonly property Dialer dialer
346 property DialerHandGroup hand352 property DialerHandGroup hand
347 readonly property int index353 readonly property int index
348 default readonly property QtObject overlay354 default property list<QtObject> overlay
349 property double value355 property double value
350Ubuntu.Components.Popups.Dialog 1.0 0.1: PopupBase356Ubuntu.Components.Popups.Dialog 1.0 0.1: PopupBase
351 property Item caller357 property Item caller
352 property double callerMargin358 property double callerMargin
353 default readonly property QtObject contents359 default property list<QtObject> contents
354 property double edgeMargins360 property double edgeMargins
355 property bool modal361 property bool modal
356 property Item pointerTarget362 property Item pointerTarget
@@ -359,34 +365,16 @@
359Ubuntu.Components.Popups.Dialog 1.3: PopupBase365Ubuntu.Components.Popups.Dialog 1.3: PopupBase
360 property Item caller366 property Item caller
361 property double callerMargin367 property double callerMargin
362 default readonly property QtObject contents368 default property list<QtObject> contents
363 property double edgeMargins369 property double edgeMargins
364 property bool modal370 property bool modal
365 property Item pointerTarget371 property Item pointerTarget
366 property string text372 property string text
367 property string title373 property string title
368Ubuntu.Components.ListItems.Divider 1.0 0.1: QQuickImageBase374Ubuntu.Components.ListItems.Divider 1.0 0.1: QQuickImageBase
369 property FillMode fillMode
370 property HAlignment horizontalAlignment
371 signal horizontalAlignmentChanged(HAlignment alignment)
372 signal verticalAlignmentChanged(VAlignment alignment)
373 signal mipmapChanged(bool )
374 property bool mipmap
375 readonly property double paintedHeight
376 readonly property double paintedWidth
377 property VAlignment verticalAlignment
378Ubuntu.Components.ListItems.Divider 1.3: QQuickImageBase375Ubuntu.Components.ListItems.Divider 1.3: QQuickImageBase
379 property FillMode fillMode
380 property HAlignment horizontalAlignment
381 signal horizontalAlignmentChanged(HAlignment alignment)
382 signal verticalAlignmentChanged(VAlignment alignment)
383 signal mipmapChanged(bool )
384 property bool mipmap
385 readonly property double paintedHeight
386 readonly property double paintedWidth
387 property VAlignment verticalAlignment
388Ubuntu.Components.ListItems.Empty 1.0 0.1: AbstractButton376Ubuntu.Components.ListItems.Empty 1.0 0.1: AbstractButton
389 readonly property Item backgroundIndicator377 property list<Item> backgroundIndicator
390 property bool confirmRemoval378 property bool confirmRemoval
391 readonly property ThinDivider divider379 readonly property ThinDivider divider
392 property bool highlightWhenPressed380 property bool highlightWhenPressed
@@ -398,7 +386,7 @@
398 readonly property string swipingState386 readonly property string swipingState
399 readonly property bool waitingConfirmationForRemoval387 readonly property bool waitingConfirmationForRemoval
400Ubuntu.Components.ListItems.Empty 1.3: AbstractButton388Ubuntu.Components.ListItems.Empty 1.3: AbstractButton
401 readonly property Item backgroundIndicator389 property list<Item> backgroundIndicator
402 property bool confirmRemoval390 property bool confirmRemoval
403 readonly property ThinDivider divider391 readonly property ThinDivider divider
404 property bool highlightWhenPressed392 property bool highlightWhenPressed
@@ -510,7 +498,7 @@
510 XxSmall498 XxSmall
511Ubuntu.Layouts.Layouts 1.0 0.1: Item499Ubuntu.Layouts.Layouts 1.0 0.1: Item
512 readonly property string currentLayout500 readonly property string currentLayout
513 readonly property ConditionalLayout layouts501 property list<ConditionalLayout> layouts
514Ubuntu.Components.ListItem 1.3 1.2: StyledItem502Ubuntu.Components.ListItem 1.3 1.2: StyledItem
515 property Action action503 property Action action
516 property color color504 property color color
@@ -523,18 +511,19 @@
523 property color highlightColor511 property color highlightColor
524 readonly property bool highlighted512 readonly property bool highlighted
525 property ListItemActions leadingActions513 property ListItemActions leadingActions
526 readonly property Item listItemChildren514 property list<Item> listItemChildren
527 default readonly property QtObject listItemData515 default property list<QtObject> listItemData
528 signal clicked()516 signal clicked()
529 signal pressAndHold()517 signal pressAndHold()
530 signal contentMovementStarted()518 signal contentMovementStarted()
531 signal contentMovementEnded()519 signal contentMovementEnded()
532 property bool selectMode520 property bool selectMode
533 property bool selected521 property bool selected
522 property bool swipeEnabled 1.3
534 property ListItemActions trailingActions523 property ListItemActions trailingActions
535Ubuntu.Components.ListItemActions 1.2: QtObject524Ubuntu.Components.ListItemActions 1.2: QtObject
536 readonly property Action actions525 property list<Action> actions
537 default readonly property QtObject data526 default property list<QtObject> data
538 property Component delegate527 property Component delegate
539Ubuntu.Components.ListItemDrag 1.2: QtObject528Ubuntu.Components.ListItemDrag 1.2: QtObject
540 property bool accept529 property bool accept
@@ -572,27 +561,31 @@
572 Second561 Second
573Ubuntu.Components.MainView 1.0 0.1: MainViewBase562Ubuntu.Components.MainView 1.0 0.1: MainViewBase
574 property bool automaticOrientation563 property bool automaticOrientation
575 default readonly property QtObject contentsItem564 default property list<QtObject> contentsItem
576 property bool useDeprecatedToolbar565 property bool useDeprecatedToolbar
577Ubuntu.Components.MainView 1.2: MainViewBase566Ubuntu.Components.MainView 1.2: MainViewBase
578 property bool automaticOrientation567 property bool automaticOrientation
579 default readonly property QtObject contentsItem568 default property list<QtObject> contentsItem
580Ubuntu.Components.MainView 1.3: MainViewBase569Ubuntu.Components.MainView 1.3: MainViewBase
581 property bool automaticOrientation570 property bool automaticOrientation
582 default readonly property QtObject contentsItem571 default property list<QtObject> contentsItem
583Ubuntu.Components.MathUtils 0.1 1.0 1.3572Ubuntu.Components.MathUtils 1.0 0.1: QtObject singleton
573 function double clamp(double x, double min, double max)
574 function double lerp(double delta, double from, double to)
575 function double projectValue(double x, double xmin, double xmax, double ymin, double ymax)
576 function double clampAndProject(double x, double xmin, double xmax, double ymin, double ymax)
584Ubuntu.Components.MimeData 1.0 0.1: QtObject577Ubuntu.Components.MimeData 1.0 0.1: QtObject
585 property color color578 property color color
586 property var data579 property var data
587 readonly property QStringList formats580 readonly property QStringList formats
588 property string html581 property string html
589 property string text582 property string text
590 property QList<QUrl> urls583 property list<url> urls
591Ubuntu.Components.Mouse 1.0 0.1: QtObject584Ubuntu.Components.Mouse 1.0 0.1: QtObject
592 readonly property Qt.MouseButtons acceptedButtons585 readonly property Qt.MouseButtons acceptedButtons
593 property int clickAndHoldThreshold586 property int clickAndHoldThreshold
594 property bool enabled587 property bool enabled
595 readonly property Item forwardTo588 property list<Item> forwardTo
596 readonly property bool hoverEnabled589 readonly property bool hoverEnabled
597 signal pressed(QQuickMouseEvent mouse, Item host)590 signal pressed(QQuickMouseEvent mouse, Item host)
598 signal released(QQuickMouseEvent mouse, Item host)591 signal released(QQuickMouseEvent mouse, Item host)
@@ -606,12 +599,15 @@
606Ubuntu.Components.Mouse.Priority: Enum599Ubuntu.Components.Mouse.Priority: Enum
607 AfterItem600 AfterItem
608 BeforeItem601 BeforeItem
602Ubuntu.Test.MouseTouchAdaptor 1.0: QtObject singleton
603 property bool enabled
604 signal enabledChanged(bool value)
609Ubuntu.Components.ListItems.MultiValue 1.0 0.1: Base605Ubuntu.Components.ListItems.MultiValue 1.0 0.1: Base
610 property var values606 property var values
611Ubuntu.Components.ListItems.MultiValue 1.3: Base607Ubuntu.Components.ListItems.MultiValue 1.3: Base
612 property var values608 property var values
613Ubuntu.Components.Object 1.0 0.1: QtObject609Ubuntu.Components.Object 1.0 0.1: QtObject
614 default readonly property QtObject children610 default property list<QtObject> children
615Ubuntu.Components.OptionSelector 1.0 0.1: Empty611Ubuntu.Components.OptionSelector 1.0 0.1: Empty
616 property bool colourImage612 property bool colourImage
617 property double containerHeight613 property double containerHeight
@@ -665,11 +661,11 @@
665 readonly property bool rotating661 readonly property bool rotating
666 property bool transitionEnabled662 property bool transitionEnabled
667Ubuntu.Components.Page 1.0 0.1: PageTreeNode663Ubuntu.Components.Page 1.0 0.1: PageTreeNode
668 readonly property Action actions664 property list<Action> actions
669 property Flickable flickable665 property Flickable flickable
670 property string title666 property string title
671 property Item tools667 property Item tools
672Ubuntu.Components.Page 1.1: Page668Ubuntu.Components.Page 1.1: Page10
673 readonly property PageHeadConfiguration head669 readonly property PageHeadConfiguration head
674Ubuntu.Components.Page 1.3: PageTreeNode670Ubuntu.Components.Page 1.3: PageTreeNode
675 property Flickable flickable671 property Flickable flickable
@@ -682,17 +678,17 @@
682 property double minimumWidth678 property double minimumWidth
683 property double preferredWidth679 property double preferredWidth
684Ubuntu.Components.PageColumnsLayout 1.3: QtObject680Ubuntu.Components.PageColumnsLayout 1.3: QtObject
685 default readonly property PageColumn data681 default property list<PageColum> data
686 property bool when682 property bool when
687Ubuntu.Components.PageHeadConfiguration 1.1: Object683Ubuntu.Components.PageHeadConfiguration 1.1: Object
688 readonly property Action actions684 property list<Action> actions
689 property Action backAction685 property Action backAction
690 property Item contents686 property Item contents
691 property color foregroundColor687 property color foregroundColor
692 property string preset688 property string preset
693 readonly property PageHeadSections sections689 readonly property PageHeadSections sections
694Ubuntu.Components.PageHeadConfiguration 1.3: Object690Ubuntu.Components.PageHeadConfiguration 1.3: Object
695 readonly property Action actions691 property list<Action> actions
696 property Action backAction692 property Action backAction
697 property Item contents693 property Item contents
698 property Flickable flickable694 property Flickable flickable
@@ -707,17 +703,17 @@
707 property var model703 property var model
708 property int selectedIndex704 property int selectedIndex
709Ubuntu.Components.PageHeadSections 1.3: QtObject705Ubuntu.Components.PageHeadSections 1.3: QtObject
710 readonly property Action actions706 property list<Action> actions
711 property bool enabled707 property bool enabled
712 property var model708 property var model
713 property int selectedIndex709 property int selectedIndex
714Ubuntu.Components.PageHeadState 1.1: State710Ubuntu.Components.PageHeadState 1.1: State
715 readonly property Action actions711 property list<Action> actions
716 property Action backAction712 property Action backAction
717 property Item contents713 property Item contents
718 property PageHeadConfiguration head714 property PageHeadConfiguration head
719Ubuntu.Components.PageHeadState 1.3: State715Ubuntu.Components.PageHeadState 1.3: State
720 readonly property Action actions716 property list<Action> actions
721 property Action backAction717 property Action backAction
722 property Item contents718 property Item contents
723 property PageHeadConfiguration head719 property PageHeadConfiguration head
@@ -743,6 +739,7 @@
743Ubuntu.Components.PageHeader 1.3: Header739Ubuntu.Components.PageHeader 1.3: Header
744 property Item contents740 property Item contents
745 readonly property ActionBar leadingActionBar741 readonly property ActionBar leadingActionBar
742 property list<Action> navigationActions
746 readonly property Sections sections743 readonly property Sections sections
747 property string title744 property string title
748 readonly property ActionBar trailingActionBar745 readonly property ActionBar trailingActionBar
@@ -799,7 +796,7 @@
799 property int align796 property int align
800 property bool animate797 property bool animate
801 readonly property bool animating798 readonly property bool animating
802 default readonly property QtObject contents799 default property list<QtObject> contents
803 property int hideTimeout800 property int hideTimeout
804 property double hintSize801 property double hintSize
805 property bool locked802 property bool locked
@@ -813,7 +810,7 @@
813 property int align810 property int align
814 property bool animate811 property bool animate
815 readonly property bool animating812 readonly property bool animating
816 default readonly property QtObject contents813 default property list<QtObject> contents
817 property int hideTimeout814 property int hideTimeout
818 property double hintSize815 property double hintSize
819 property bool locked816 property bool locked
@@ -854,7 +851,7 @@
854 property bool autoClose851 property bool autoClose
855 property Item caller852 property Item caller
856 property double callerMargin853 property double callerMargin
857 default readonly property QtObject container854 default property list<QtObject> container
858 property double contentHeight855 property double contentHeight
859 property double contentWidth856 property double contentWidth
860 property double edgeMargins857 property double edgeMargins
@@ -866,7 +863,7 @@
866 property bool autoClose863 property bool autoClose
867 property Item caller864 property Item caller
868 property double callerMargin865 property double callerMargin
869 default readonly property QtObject container866 default property list<QtObject> container
870 property double contentHeight867 property double contentHeight
871 property double contentWidth868 property double contentWidth
872 property double edgeMargins869 property double edgeMargins
@@ -935,9 +932,8 @@
935Ubuntu.Components.Scrollbar 1.3: StyledItem932Ubuntu.Components.Scrollbar 1.3: StyledItem
936 property int align933 property int align
937 property Flickable flickableItem934 property Flickable flickableItem
938Ubuntu.Components.ScrollbarUtils 0.1 1.0
939Ubuntu.Components.Sections 1.3: StyledItem935Ubuntu.Components.Sections 1.3: StyledItem
940 readonly property Action actions936 property list<Action> actions
941 property var model937 property var model
942 property int selectedIndex938 property int selectedIndex
943Ubuntu.Components.ServiceProperties 1.1: QtObject939Ubuntu.Components.ServiceProperties 1.1: QtObject
@@ -958,13 +954,13 @@
958 Inactive954 Inactive
959 Synchronizing955 Synchronizing
960Ubuntu.Components.Popups.SheetBase 1.0 0.1: PopupBase956Ubuntu.Components.Popups.SheetBase 1.0 0.1: PopupBase
961 default readonly property QtObject container957 default property list<QtObject> container
962 property double contentsHeight958 property double contentsHeight
963 property double contentsWidth959 property double contentsWidth
964 property bool modal960 property bool modal
965 property string title961 property string title
966Ubuntu.Components.Popups.SheetBase 1.3: PopupBase962Ubuntu.Components.Popups.SheetBase 1.3: PopupBase
967 default readonly property QtObject container963 default property list<QtObject> container
968 property double contentsHeight964 property double contentsHeight
969 property double contentsWidth965 property double contentsWidth
970 property bool modal966 property bool modal
@@ -1049,6 +1045,26 @@
1049 property string subText1045 property string subText
1050Ubuntu.Components.ListItems.Subtitled 1.3: Base1046Ubuntu.Components.ListItems.Subtitled 1.3: Base
1051 property string subText1047 property string subText
1048Ubuntu.Components.SwipeArea 1.3: Item
1049 property Direction direction
1050 readonly property double distance
1051 readonly property bool dragging
1052 property bool immediateRecognition
1053 signal directionChanged(Direction direction)
1054 signal draggingChanged(bool dragging)
1055 signal pressedChanged(bool pressed)
1056 signal distanceChanged(double distance)
1057 signal touchPositionChanged(QPointF position)
1058 signal immediateRecognitionChanged(bool immediateRecognition)
1059 readonly property bool pressed
1060 readonly property QPointF touchPosition
1061Ubuntu.Components.SwipeArea.Direction: Enum
1062 Downwards
1063 Horizontal
1064 Leftwards
1065 Rightwards
1066 Upwards
1067 Vertical
1052Ubuntu.Components.SwipeEvent 1.2: QtObject1068Ubuntu.Components.SwipeEvent 1.2: QtObject
1053 property QPointF content1069 property QPointF content
1054 readonly property QPointF from1070 readonly property QPointF from
@@ -1094,14 +1110,14 @@
1094 readonly property Tab selectedTab1110 readonly property Tab selectedTab
1095 property int selectedTabIndex1111 property int selectedTabIndex
1096 property TabBar tabBar1112 property TabBar tabBar
1097 default readonly property QtObject tabChildren1113 default property list<QtObject> tabChildren
1098Ubuntu.Components.Tabs 1.3: PageTreeNode1114Ubuntu.Components.Tabs 1.3: PageTreeNode
1099 readonly property int count1115 readonly property int count
1100 readonly property Item currentPage1116 readonly property Item currentPage
1101 readonly property Tab selectedTab1117 readonly property Tab selectedTab
1102 property int selectedTabIndex1118 property int selectedTabIndex
1103 property TabBar tabBar1119 property TabBar tabBar
1104 default readonly property QtObject tabChildren1120 default property list<QtObject> tabChildren
1105Ubuntu.Test.TestExtras 1.0: QtObject singleton1121Ubuntu.Test.TestExtras 1.0: QtObject singleton
1106 function string openGLflavor()1122 function string openGLflavor()
1107 function string cpuArchitecture()1123 function string cpuArchitecture()
@@ -1284,10 +1300,10 @@
1284 property bool persistentSelection1300 property bool persistentSelection
1285 property string placeholderText1301 property string placeholderText
1286 property var popover1302 property var popover
1287 readonly property QtObject primaryItem1303 property list<QtObject> primaryItem
1288 property bool readOnly1304 property bool readOnly
1289 property int renderType1305 property int renderType
1290 readonly property QtObject secondaryItem1306 property list<QtObject> secondaryItem
1291 property bool selectByMouse1307 property bool selectByMouse
1292 readonly property string selectedText1308 readonly property string selectedText
1293 property color selectedTextColor1309 property color selectedTextColor
@@ -1345,10 +1361,10 @@
1345 property bool persistentSelection1361 property bool persistentSelection
1346 property string placeholderText1362 property string placeholderText
1347 property var popover1363 property var popover
1348 readonly property QtObject primaryItem1364 property list<QtObject> primaryItem
1349 property bool readOnly1365 property bool readOnly
1350 property int renderType1366 property int renderType
1351 readonly property QtObject secondaryItem1367 property list<QtObject> secondaryItem
1352 property bool selectByMouse1368 property bool selectByMouse
1353 readonly property string selectedText1369 readonly property string selectedText
1354 property color selectedTextColor1370 property color selectedTextColor
@@ -1363,7 +1379,6 @@
1363 property string name1379 property string name
1364 property QtObject palette1380 property QtObject palette
1365 readonly property ThemeSettings parentTheme1381 readonly property ThemeSettings parentTheme
1366 property ushort version
1367Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle1382Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle
1368Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle1383Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle
1369Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem1384Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem
@@ -1384,13 +1399,13 @@
1384 property string text1399 property string text
1385Ubuntu.Components.ToolbarItems 1.0 0.1: Item1400Ubuntu.Components.ToolbarItems 1.0 0.1: Item
1386 property Item back1401 property Item back
1387 default readonly property QtObject contents1402 default property list<QtObject> contents
1388 property bool locked1403 property bool locked
1389 property bool opened1404 property bool opened
1390 property Item pageStack1405 property Item pageStack
1391Ubuntu.Components.ToolbarItems 1.3: Item1406Ubuntu.Components.ToolbarItems 1.3: Item
1392 property Item back1407 property Item back
1393 default readonly property QtObject contents1408 default property list<QtObject> contents
1394 property bool locked1409 property bool locked
1395 property bool opened1410 property bool opened
1396 property Item pageStack1411 property Item pageStack
@@ -1400,7 +1415,6 @@
1400Ubuntu.Components.UCFontUtils 1.0 0.1: QtObject1415Ubuntu.Components.UCFontUtils 1.0 0.1: QtObject
1401 function double sizeToPixels(string size)1416 function double sizeToPixels(string size)
1402 function double modularScale(string size)1417 function double modularScale(string size)
1403UCItemAttached: QtObject
1404UCListItemDivider: Item1418UCListItemDivider: Item
1405 property color colorFrom1419 property color colorFrom
1406 property color colorTo1420 property color colorTo
@@ -1531,6 +1545,7 @@
1531 function var typeString(var string)1545 function var typeString(var string)
1532 function var warningFormat(var line, var column, var message)1546 function var warningFormat(var line, var column, var message)
1533 function var waitForHeaderAnimation(var mainView)1547 function var waitForHeaderAnimation(var mainView)
1548 readonly property QuickTestUtil testUtil
1534Ubuntu.Components.UriHandler 1.0 0.1: QtObject singleton1549Ubuntu.Components.UriHandler 1.0 0.1: QtObject singleton
1535 signal opened(QStringList uris)1550 signal opened(QStringList uris)
1536Ubuntu.Components.ListItems.ValueSelector 1.0 0.1: Empty1551Ubuntu.Components.ListItems.ValueSelector 1.0 0.1: Empty
@@ -1551,12 +1566,12 @@
1551 property var values1566 property var values
1552Ubuntu.Components.ViewItems 1.2: QtObject1567Ubuntu.Components.ViewItems 1.2: QtObject
1553 property bool dragMode1568 property bool dragMode
1554 property QList<int> expandedIndices1569 property list<int> expandedIndices
1555 property int expansionFlags1570 property int expansionFlags
1556 signal dragUpdated(ListItemDrag event)1571 signal dragUpdated(ListItemDrag event)
1557 signal expandedIndicesChanged(QList<int> indices)1572 signal expandedIndicesChanged(list<int> indices)
1558 property bool selectMode1573 property bool selectMode
1559 property QList<int> selectedIndices1574 property list<int> selectedIndices
1560Ubuntu.Components.ViewItems.ExpansionFlag: Enum1575Ubuntu.Components.ViewItems.ExpansionFlag: Enum
1561 CollapseOnOutsidePress1576 CollapseOnOutsidePress
1562 Exclusive1577 Exclusive
15631578
=== modified file 'debian/control'
--- debian/control 2015-10-09 08:23:09 +0000
+++ debian/control 2015-11-24 12:22:14 +0000
@@ -9,6 +9,7 @@
9 python3:any,9 python3:any,
10 qml-module-qtgraphicaleffects | libqt5qml-graphicaleffects,10 qml-module-qtgraphicaleffects | libqt5qml-graphicaleffects,
11 libinput-dev,11 libinput-dev,
12 libxkbcommon-dev,
12 qtbase5-dev,13 qtbase5-dev,
13 qtbase5-private-dev,14 qtbase5-private-dev,
14 qttools5-dev-tools,15 qttools5-dev-tools,
@@ -73,6 +74,7 @@
73 suru-icon-theme,74 suru-icon-theme,
74 ttf-ubuntu-font-family,75 ttf-ubuntu-font-family,
75 ubuntu-ui-toolkit-theme (= ${binary:Version}),76 ubuntu-ui-toolkit-theme (= ${binary:Version}),
77 libubuntugestures (= ${binary:Version}),
76 ${misc:Depends},78 ${misc:Depends},
77 ${shlibs:Depends},79 ${shlibs:Depends},
78Conflicts: qt-components-ubuntu80Conflicts: qt-components-ubuntu
@@ -84,6 +86,28 @@
84 .86 .
85 This package contains the Ubuntu Components QML plugin.87 This package contains the Ubuntu Components QML plugin.
8688
89
90Package: libubuntugestures
91Architecture: any
92Multi-Arch: same
93Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}
94Depends: ${misc:Depends},
95 ${shlibs:Depends},
96Description: Ubuntu gestures library - SwipeArea
97 Ubuntu gestures library with SwipeArea
98
99Package: libubuntugestures-dev
100Architecture: any
101Multi-Arch: same
102Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}
103Depends: ${misc:Depends},
104 ${shlibs:Depends},
105Description: Ubuntu gestures library development files
106 This package contains the development files for
107 Ubuntu gestures library with SwipeArea
108
109
110
87Package: ubuntu-ui-toolkit-theme111Package: ubuntu-ui-toolkit-theme
88Architecture: any112Architecture: any
89Multi-Arch: foreign113Multi-Arch: foreign
90114
=== added file 'debian/libubuntugestures-dev.install'
--- debian/libubuntugestures-dev.install 1970-01-01 00:00:00 +0000
+++ debian/libubuntugestures-dev.install 2015-11-24 12:22:14 +0000
@@ -0,0 +1,28 @@
1usr/include/*/qt5/UbuntuGestures/ubuntugesturesglobal.h
2usr/include/*/qt5/UbuntuGestures/CandidateInactivityTimer
3usr/include/*/qt5/UbuntuGestures/TouchOwnershipEvent
4usr/include/*/qt5/UbuntuGestures/UbuntuGestures
5usr/include/*/qt5/UbuntuGestures/pool.h
6usr/include/*/qt5/UbuntuGestures/unownedtouchevent.h
7usr/include/*/qt5/UbuntuGestures/DebugHelpers
8usr/include/*/qt5/UbuntuGestures/debughelpers.h
9usr/include/*/qt5/UbuntuGestures/touchownershipevent.h
10usr/include/*/qt5/UbuntuGestures/touchregistry.h
11usr/include/*/qt5/UbuntuGestures/UbuntuGesturesDepends
12usr/include/*/qt5/UbuntuGestures/timesource.h
13usr/include/*/qt5/UbuntuGestures/TimeSource
14usr/include/*/qt5/UbuntuGestures/timer.h
15usr/include/*/qt5/UbuntuGestures/UnownedTouchEvent
16usr/include/*/qt5/UbuntuGestures/TouchRegistry
17usr/include/*/qt5/UbuntuGestures/Pool
18usr/include/*/qt5/UbuntuGestures/ubuntugesturesversion.h
19usr/include/*/qt5/UbuntuGestures/Timer
20usr/include/*/qt5/UbuntuGestures/candidateinactivitytimer.h
21usr/include/*/qt5/UbuntuGestures/UbuntuGesturesVersion
22usr/lib/*/libUbuntuGestures.prl
23usr/lib/*/libUbuntuGestures.la
24usr/lib/*/libUbuntuGestures.so
25usr/lib/*/pkgconfig/UbuntuGestures.pc
26usr/lib/*/qt5/mkspecs/modules/qt_lib_UbuntuGestures.pri
27usr/lib/*/qt5/mkspecs/modules/qt_lib_UbuntuGestures_private.pri
28
029
=== added file 'debian/libubuntugestures.install'
--- debian/libubuntugestures.install 1970-01-01 00:00:00 +0000
+++ debian/libubuntugestures.install 2015-11-24 12:22:14 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/libUbuntuGestures.so.*
02
=== modified file 'documentation/overview.qdoc'
--- documentation/overview.qdoc 2015-04-15 06:40:40 +0000
+++ documentation/overview.qdoc 2015-11-24 12:22:14 +0000
@@ -37,6 +37,13 @@
37 \endcode37 \endcode
38 \annotatedlist ubuntu38 \annotatedlist ubuntu
3939
40 \part Gestures
41 Available through:
42 \code
43 import Ubuntu.Components 1.3
44 \endcode
45 \annotatedlist ubuntu-gestures
46
40 \part List views, list items47 \part List views, list items
41 Components with standardized view items, with conditional actions, multiselect48 Components with standardized view items, with conditional actions, multiselect
42 and reordering support on scrollable views. Replaces the Ubuntu.Components.ListItems49 and reordering support on scrollable views. Replaces the Ubuntu.Components.ListItems
4350
=== modified file 'examples/ubuntu-ui-toolkit-gallery/About.qml'
--- examples/ubuntu-ui-toolkit-gallery/About.qml 2015-09-24 19:36:36 +0000
+++ examples/ubuntu-ui-toolkit-gallery/About.qml 2015-11-24 12:22:14 +0000
@@ -30,9 +30,8 @@
30 anchors.fill: parent30 anchors.fill: parent
31 color: theme.palette.normal.background31 color: theme.palette.normal.background
32 }32 }
33 head {33 header: PageHeader {
34 title: i18n.tr('About...')34 title: i18n.tr("About...")
35 foregroundColor: theme.palette.selected.foregroundText
36 }35 }
3736
38 Column {37 Column {
3938
=== renamed file 'examples/ubuntu-ui-toolkit-gallery/BottomEdgeHint.qml' => 'examples/ubuntu-ui-toolkit-gallery/BottomEdgePage.qml'
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-09-30 21:14:25 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-11-24 12:22:14 +0000
@@ -28,7 +28,7 @@
2828
29 ListItem {29 ListItem {
30 id: addressbookListItem30 id: addressbookListItem
31 height: addressbookLayout.height31 height: addressbookLayout.height + (divider.visible ? divider.height : 0)
3232
33 ListItemLayout {33 ListItemLayout {
34 id: addressbookLayout34 id: addressbookLayout
@@ -48,7 +48,7 @@
4848
49 ListItem {49 ListItem {
50 id: addressbookDetailsListItem50 id: addressbookDetailsListItem
51 height: addressbookDetailsLayout.height + divider.height51 height: addressbookDetailsLayout.height + (divider.visible ? divider.height : 0)
52 ListItemLayout {52 ListItemLayout {
53 id: addressbookDetailsLayout53 id: addressbookDetailsLayout
5454
@@ -73,7 +73,7 @@
73 ListItem {73 ListItem {
74 id: telegramContactsListItem74 id: telegramContactsListItem
7575
76 height: telegramContactsLayout.height76 height: telegramContactsLayout.height + (divider.visible ? divider.height : 0)
7777
78 ListItemLayout {78 ListItemLayout {
79 id: telegramContactsLayout79 id: telegramContactsLayout
@@ -92,7 +92,7 @@
9292
93 ListItem {93 ListItem {
94 id: systemSettings194 id: systemSettings1
95 height: systemSettings1_layout.height95 height: systemSettings1_layout.height + (divider.visible ? divider.height : 0)
9696
97 ListItemLayout {97 ListItemLayout {
98 id: systemSettings1_layout98 id: systemSettings1_layout
@@ -110,7 +110,7 @@
110110
111 ListItem {111 ListItem {
112 id: systemSettings2112 id: systemSettings2
113 height: systemSettings2_layout.height113 height: systemSettings2_layout.height + (divider.visible ? divider.height : 0)
114114
115 ListItemLayout {115 ListItemLayout {
116 id: systemSettings2_layout116 id: systemSettings2_layout
@@ -129,7 +129,7 @@
129129
130 ListItem {130 ListItem {
131 id: systemSettings3131 id: systemSettings3
132 height: systemSettings3_layout.height132 height: systemSettings3_layout.height + (divider.visible ? divider.height : 0)
133133
134 ListItemLayout {134 ListItemLayout {
135 id: systemSettings3_layout135 id: systemSettings3_layout
@@ -157,7 +157,7 @@
157 spacing: 0157 spacing: 0
158158
159 ListItem {159 ListItem {
160 height: customLabelsLayout.height160 height: customLabelsLayout.height + (divider.visible ? divider.height : 0)
161161
162 ListItemLayout {162 ListItemLayout {
163 id: customLabelsLayout163 id: customLabelsLayout
@@ -220,7 +220,7 @@
220220
221 ListItem {221 ListItem {
222 id: dialerHistoryListItem222 id: dialerHistoryListItem
223 height: dialerHistoryLayout.height223 height: dialerHistoryLayout.height + (divider.visible ? divider.height : 0)
224224
225 ListItemLayout {225 ListItemLayout {
226 id: dialerHistoryLayout226 id: dialerHistoryLayout
227227
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-09-28 12:26:13 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-11-24 12:22:14 +0000
@@ -20,7 +20,7 @@
20ListItem {20ListItem {
21 property alias title: layout.title21 property alias title: layout.title
2222
23 height: layout.height23 height: layout.height + (divider.visible ? divider.height : 0)
24 onPressAndHold: selectMode = !selectMode24 onPressAndHold: selectMode = !selectMode
2525
26 ListItemLayout { id: layout }26 ListItemLayout { id: layout }
2727
=== modified file 'examples/ubuntu-ui-toolkit-gallery/MainPage.qml'
--- examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-09-30 05:59:49 +0000
+++ examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-11-24 12:22:14 +0000
@@ -21,37 +21,54 @@
21 id: mainPage21 id: mainPage
22 title: "Ubuntu UI Toolkit"22 title: "Ubuntu UI Toolkit"
2323
24 head.actions: [24 header: PageHeader {
25 Action {25 title: mainPage.title
26 text: i18n.tr('Right to Left')26 flickable: layout.columns === 1 ? widgetList : null
27 iconName: 'flash-on'27 trailingActionBar.actions: [
28 visible: !gallery.rtl28 Action {
29 onTriggered: gallery.rtl = !gallery.rtl29 text: i18n.tr('Right to Left')
30 },30 iconName: 'flash-on'
31 Action {31 visible: !gallery.rtl
32 text: i18n.tr('Left to Right')32 onTriggered: gallery.rtl = !gallery.rtl
33 iconName: 'flash-off'33 },
34 visible: gallery.rtl34 Action {
35 onTriggered: gallery.rtl = !gallery.rtl35 text: i18n.tr('Left to Right')
36 },36 iconName: 'flash-off'
37 Action {37 visible: gallery.rtl
38 text: i18n.tr('Use dark theme')38 onTriggered: gallery.rtl = !gallery.rtl
39 iconName: 'torch-on'39 },
40 visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'40 Action {
41 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'41 text: i18n.tr('Use dark theme')
42 },42 iconName: 'torch-on'
43 Action {43 visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'
44 text: i18n.tr('Use light theme')44 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'
45 iconName: 'torch-off'45 },
46 visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'46 Action {
47 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'47 text: i18n.tr('Use light theme')
48 },48 iconName: 'torch-off'
49 Action {49 visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'
50 text: i18n.tr('About')50 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'
51 iconName: "info"51 },
52 onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))52 Action {
53 }53 id: aboutAction
54 ]54 text: i18n.tr('About')
55 iconName: "info"
56 onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
57 },
58 Action {
59 text: i18n.tr("Deactivate mouse")
60 iconName: "non-starred"
61 visible: QuickUtils.mouseAttached
62 onTriggered: QuickUtils.mouseAttached = false
63 },
64 Action {
65 text: i18n.tr("Activate mouse")
66 iconName: "starred"
67 visible: !QuickUtils.mouseAttached
68 onTriggered: QuickUtils.mouseAttached = true
69 }
70 ]
71 }
5572
56 onActiveChanged: {73 onActiveChanged: {
57 if (layout.columns < 2) {74 if (layout.columns < 2) {
@@ -62,59 +79,63 @@
62 }79 }
63 }80 }
6481
65 Rectangle {82 UbuntuListView {
66 color: Qt.rgba(0.0, 0.0, 0.0, 0.01)83 id: widgetList
67 anchors.fill: parent84 objectName: "widgetList"
6885 anchors {
69 UbuntuListView {86 fill: parent
70 id: widgetList87 topMargin: mainPage.header.flickable ? 0 : mainPage.header.height
71 objectName: "widgetList"88 }
72 anchors.fill: parent89
73 model: WidgetsModel {}90 model: WidgetsModel {}
74 currentIndex: -191 currentIndex: -1
7592
76 onCurrentIndexChanged: openPage()93 onCurrentIndexChanged: openPage()
7794
78 function openPage() {95 function openPage() {
79 if (!mainPage.active || currentIndex < 0) return;96 if (!mainPage.active || currentIndex < 0) return;
80 var modelData = model.get(currentIndex);97 var modelData = model.get(currentIndex);
81 var source = Qt.resolvedUrl(modelData.source);98 var source = Qt.resolvedUrl(modelData.source);
82 mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});99 mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});
83 }100 }
84101
85 delegate: ListItem {102 delegate: ListItem {
86 objectName: model.objectName103 objectName: model.objectName
87 contentItem {104 contentItem {
88 anchors.leftMargin: units.gu(2)105 anchors.leftMargin: units.gu(2)
89 anchors.rightMargin: units.gu(2)106 anchors.rightMargin: units.gu(2)
90 }107 }
91 enabled: source != ""108 enabled: source != ""
92 // Used by Autopilot109 // Used by Autopilot
93 property string text: label110 property string text: label
94 onClicked: widgetList.currentIndex = index111 onClicked: widgetList.currentIndex = index
95 Label {112 Label {
96 id: labelItem113 id: labelItem
97 anchors {114 anchors {
98 fill: parent115 fill: parent
99 rightMargin: units.gu(4)116 rightMargin: units.gu(4)
100 }117 }
101 text: label118 text: label
102 verticalAlignment: Text.AlignVCenter119 verticalAlignment: Text.AlignVCenter
103 }120 }
104 Icon {121 Icon {
105 name: "next"122 name: "next"
106 width: units.gu(2)123 width: units.gu(2)
107 height: units.gu(2)124 height: units.gu(2)
108 anchors {125 anchors {
109 verticalCenter: parent.verticalCenter126 verticalCenter: parent.verticalCenter
110 right: parent.right127 right: parent.right
111 }128 }
112 }129 }
113 }130 }
114 highlight: Rectangle {131 highlight: Rectangle {
115 color: theme.palette.selected.background132 color: theme.palette.selected.background
116 }133 }
117 highlightMoveDuration: 0134 highlightMoveDuration: 0
118 }135 }
136
137 BottomEdgeHint {
138 flickable: widgetList
139 action: aboutAction
119 }140 }
120}141}
121142
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sections.qml'
--- examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-07-03 16:19:59 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-11-24 12:22:14 +0000
@@ -19,7 +19,13 @@
1919
20Template {20Template {
21 objectName: "sectionsTemplate"21 objectName: "sectionsTemplate"
22 head.sections.model: ["first", "second", "third"]22 id: sectionsTemplate
23
24 header: PageHeader {
25 title: sectionsTemplate.title
26 sections.model: ["first", "second", "third"]
27 }
28
23 TemplateSection {29 TemplateSection {
24 title: "Sections"30 title: "Sections"
25 className: "Sections"31 className: "Sections"
2632
=== added file 'examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml'
--- examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml 1970-01-01 00:00:00 +0000
+++ examples/ubuntu-ui-toolkit-gallery/SwipeAreaPage.qml 2015-11-24 12:22:14 +0000
@@ -0,0 +1,144 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Template {
21 objectName: "SwipeAreaTemplate"
22 scrollable: !(upwards.dragging | downwards.dragging |
23 rightwards.dragging | leftwards.dragging)
24
25 TemplateSection {
26 className: "SwipeArea"
27
28 TemplateRow {
29 title: i18n.tr("Upwards")
30 Rectangle {
31 width: units.gu(40)
32 height: units.gu(20)
33 color: theme.palette.normal.foreground
34
35 SwipeArea {
36 id: upwards
37 direction: SwipeArea.Upwards
38 anchors {
39 left: parent.left
40 right: parent.right
41 bottom: parent.bottom
42 }
43 height: units.gu(4)
44 Label {
45 text: i18n.tr("Upwards")
46 color: theme.palette.normal.foregroundText
47 anchors {
48 centerIn: parent
49 verticalCenterOffset: parent.dragging ? -parent.distance : 0
50 }
51 }
52 }
53 }
54 }
55
56 TemplateRow {
57 title: i18n.tr("Downwards")
58 Rectangle {
59 width: units.gu(40)
60 height: units.gu(20)
61 color: theme.palette.normal.foreground
62
63 SwipeArea {
64 id: downwards
65 direction: SwipeArea.Downwards
66 anchors {
67 left: parent.left
68 right: parent.right
69 top: parent.top
70 }
71 height: units.gu(5)
72 Label {
73 text: i18n.tr("Downwards")
74 color: theme.palette.normal.foregroundText
75 anchors {
76 centerIn: parent
77 verticalCenterOffset: parent.dragging ? parent.distance : 0
78 }
79 }
80 }
81 }
82 }
83
84 TemplateRow {
85 title: i18n.tr("Rightwards")
86 Rectangle {
87 width: units.gu(40)
88 height: units.gu(20)
89 color: theme.palette.normal.foreground
90
91 SwipeArea {
92 id: rightwards
93 direction: SwipeArea.Rightwards
94 anchors {
95 left: parent.left
96 top: parent.top
97 bottom: parent.bottom
98 }
99 width: units.gu(5)
100
101 Label {
102 text: i18n.tr("Rightwards")
103 rotation: -90
104 color: theme.palette.normal.foregroundText
105 anchors {
106 centerIn: parent
107 horizontalCenterOffset: parent.dragging ? parent.distance : 0
108 }
109 }
110 }
111 }
112 }
113
114 TemplateRow {
115 title: i18n.tr("Leftwards")
116 Rectangle {
117 width: units.gu(40)
118 height: units.gu(20)
119 color: theme.palette.normal.foreground
120
121 SwipeArea {
122 id: leftwards
123 direction: SwipeArea.Leftwards
124 anchors {
125 right: parent.right
126 top: parent.top
127 bottom: parent.bottom
128 }
129 width: units.gu(5)
130
131 Label {
132 text: i18n.tr("Leftwards")
133 rotation: 90
134 color: theme.palette.normal.foregroundText
135 anchors {
136 centerIn: parent
137 horizontalCenterOffset: parent.dragging ? -parent.distance : 0
138 }
139 }
140 }
141 }
142 }
143 }
144}
0145
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Template.qml'
--- examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-07-16 09:12:55 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-11-24 12:22:14 +0000
@@ -20,20 +20,30 @@
20Page {20Page {
21 id: template21 id: template
2222
23 default property alias content: layout.children23 default property alias content: column.children
24 property alias spacing: layout.spacing24 property alias spacing: column.spacing
25 property alias scrollable: flickable.interactive
26
27 header: PageHeader {
28 title: template.title
29 flickable: layout.columns === 1 ? flickable : null
30 onFlickableChanged: exposed = true;
31 }
2532
26 Flickable {33 Flickable {
27 id: flickable34 id: flickable
28 objectName: "TemplateFlickable"35 objectName: "TemplateFlickable"
29 anchors.fill: parent36 anchors {
30 anchors.topMargin: units.gu(2)37 fill: parent
31 anchors.bottomMargin: units.gu(2)38 topMargin: template.header.flickable ? units.gu(2) :
32 contentHeight: layout.height39 units.gu(2) + template.header.height
40 bottomMargin: units.gu(2)
41 }
42 contentHeight: column.height
33 interactive: contentHeight > height43 interactive: contentHeight > height
3444
35 Column {45 Column {
36 id: layout46 id: column
37 spacing: units.gu(6)47 spacing: units.gu(6)
38 anchors.left: parent.left48 anchors.left: parent.left
39 anchors.right: parent.right49 anchors.right: parent.right
4050
=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-09-25 17:05:53 +0000
+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-11-24 12:22:14 +0000
@@ -102,9 +102,14 @@
102 source: "CrossFadeImage.qml"102 source: "CrossFadeImage.qml"
103 }103 }
104 ListElement {104 ListElement {
105 objectName: "swipeAreaElement"
106 label: "SwipeArea"
107 source: "SwipeAreaPage.qml"
108 }
109 ListElement {
105 objectName: "bottomEdgeHintElement"110 objectName: "bottomEdgeHintElement"
106 label: "Bottom Edge Hint"111 label: "Bottom Edge"
107 source: "BottomEdgeHint.qml"112 source: "BottomEdgePage.qml"
108 }113 }
109114
110 ListElement {115 ListElement {
111116
=== modified file 'examples/ubuntu-ui-toolkit-gallery/gallery'
--- examples/ubuntu-ui-toolkit-gallery/gallery 2015-09-14 14:10:37 +0000
+++ examples/ubuntu-ui-toolkit-gallery/gallery 2015-11-24 12:22:14 +0000
@@ -3,4 +3,4 @@
3. `dirname $0`/../../build_paths.inc3. `dirname $0`/../../build_paths.inc
44
5SCRIPT_DIRECTORY=`dirname $0`5SCRIPT_DIRECTORY=`dirname $0`
6$BUILD_DIR/ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher $@ $SCRIPT_DIRECTORY/ubuntu-ui-toolkit-gallery.qml6QT_LOGGING_CONF=$SCRIPT_DIRECTORY/gallery-logging.config $BUILD_DIR/ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher $@ $SCRIPT_DIRECTORY/ubuntu-ui-toolkit-gallery.qml
77
=== added file 'examples/ubuntu-ui-toolkit-gallery/gallery-logging.config'
--- examples/ubuntu-ui-toolkit-gallery/gallery-logging.config 1970-01-01 00:00:00 +0000
+++ examples/ubuntu-ui-toolkit-gallery/gallery-logging.config 2015-11-24 12:22:14 +0000
@@ -0,0 +1,4 @@
1[Rules]
2libubuntugestures.TouchRegistry.debug=false
3ubuntu.components.SwipeArea.debug=false
4ubuntu.components.SwipeArea.ActiveTouchInfo.debug=false
05
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro'
--- examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro 2015-06-15 08:53:40 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.pro 2015-11-24 12:22:14 +0000
@@ -10,7 +10,8 @@
10 OTHER_FILES += *.$$filetype10 OTHER_FILES += *.$$filetype
11}11}
1212
13OTHER_FILES += gallery13OTHER_FILES += gallery \
14 gallery-logging.config
1415
15desktop_files.path = $$[QT_INSTALL_EXAMPLES]/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery16desktop_files.path = $$[QT_INSTALL_EXAMPLES]/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery
16desktop_files.files = ubuntu-ui-toolkit-gallery.desktop17desktop_files.files = ubuntu-ui-toolkit-gallery.desktop
1718
=== modified file 'export_modules_dir.sh'
--- export_modules_dir.sh 2015-05-19 07:55:27 +0000
+++ export_modules_dir.sh 2015-11-24 12:22:14 +0000
@@ -19,6 +19,8 @@
19export QML_IMPORT_PATH=$BUILD_DIR/qml19export QML_IMPORT_PATH=$BUILD_DIR/qml
20export QML2_IMPORT_PATH=$BUILD_DIR/qml20export QML2_IMPORT_PATH=$BUILD_DIR/qml
21export UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml21export UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
22export LD_LIBRARY_PATH=$BUILD_DIR/lib
22/sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml23/sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml
23/sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml24/sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml
24/sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml25/sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
26/sbin/initctl set-env --global LD_LIBRARY_PATH=$BUILD_DIR/lib
2527
=== modified file 'features/ubuntu_qml_plugin.prf'
--- features/ubuntu_qml_plugin.prf 2015-08-13 09:40:00 +0000
+++ features/ubuntu_qml_plugin.prf 2015-11-24 12:22:14 +0000
@@ -36,8 +36,19 @@
36 membackend.name = ALARM_BACKEND36 membackend.name = ALARM_BACKEND
37 membackend.value = memory37 membackend.value = memory
3838
39 #make sure qmlplugindump finds all libs
40 ld_lib_path.name = LD_LIBRARY_PATH
41 ld_lib_path.value =
42 for(qmod, QTREPOS) {
43 qmod = $$qmod/lib
44 exists($$qmod): ld_lib_path.value += $$shell_path($$qmod)
45 }
46 ld_lib_path.value += $$shell_path($$ROOT_BUILD_DIR/lib)
47 ld_lib_path.value = $$unique(ld_lib_path.value)
48
39 qtAddToolEnv(QMLPLUGINDUMP, importpath)49 qtAddToolEnv(QMLPLUGINDUMP, importpath)
40 qtAddToolEnv(QMLPLUGINDUMP, membackend)50 qtAddToolEnv(QMLPLUGINDUMP, membackend)
51 qtAddToolEnv(QMLPLUGINDUMP, ld_lib_path)
4152
42 TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )53 TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )
4354
4455
=== added file 'features/ubuntu_qt_module.prf'
--- features/ubuntu_qt_module.prf 1970-01-01 00:00:00 +0000
+++ features/ubuntu_qt_module.prf 2015-11-24 12:22:14 +0000
@@ -0,0 +1,19 @@
1!build_with_qt: {
2 #enable autocreation of include directory
3 CONFIG += git_build
4}
5
6load(qt_module)
7
8CONFIG -= create_cmake
9
10# when building against the system Qt we pick up the CXX_FLAGS for a release build
11# reset them to the default debug build flags
12!build_with_qt: {
13 CONFIG(debug, debug|release) {
14 QMAKE_CFLAGS = $$QMAKE_CFLAGS_DEBUG
15 QMAKE_CXXFLAGS = $$QMAKE_CXXFLAGS_DEBUG
16 }
17}
18
19QMAKE_CXXFLAGS += -Werror
020
=== modified file 'src/Ubuntu/Components/1.2/DraggingArea.qml'
--- src/Ubuntu/Components/1.2/DraggingArea.qml 2015-04-30 08:32:44 +0000
+++ src/Ubuntu/Components/1.2/DraggingArea.qml 2015-11-24 12:22:14 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.417import QtQuick 2.4
18import "mathUtils.js" as MathLocal18import Ubuntu.Components 1.2
1919
20MouseArea {20MouseArea {
21 id: draggingArea21 id: draggingArea
@@ -25,7 +25,7 @@
25 property real dragVelocity: 025 property real dragVelocity: 0
26 property real dragValue: (orientation == Qt.Vertical ? (mouseY - __pressedPosition.y)26 property real dragValue: (orientation == Qt.Vertical ? (mouseY - __pressedPosition.y)
27 : (mouseX - __pressedPosition.x))27 : (mouseX - __pressedPosition.x))
28 property real lateralPosition: orientation == Qt.Horizontal ? MathLocal.clamp(mouseY, 0, height) : MathLocal.clamp(mouseX, 0, width)28 property real lateralPosition: orientation == Qt.Horizontal ? MathUtils.clamp(mouseY, 0, height) : MathUtils.clamp(mouseX, 0, width)
29 property point __pressedPosition: Qt.point(0, 0)29 property point __pressedPosition: Qt.point(0, 0)
30 property var __dragEvents: []30 property var __dragEvents: []
31 property bool clickValidated: true31 property bool clickValidated: true
3232
=== modified file 'src/Ubuntu/Components/1.2/MainViewBase.qml'
--- src/Ubuntu/Components/1.2/MainViewBase.qml 2015-04-30 08:32:44 +0000
+++ src/Ubuntu/Components/1.2/MainViewBase.qml 2015-11-24 12:22:14 +0000
@@ -48,12 +48,12 @@
4848
49 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-1171249 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
50 */50 */
51 property string theme: (ColorUtils.luminance(backgroundColor) >= 0.85) ?51 property string themeName: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
52 "Ambiance" : "SuruDark"52 "Ambiance" : "SuruDark"
53 onThemeChanged: {53 onThemeNameChanged: {
54 // only change the theme if the current one is a system one.54 // only change the theme if the current one is a system one.
55 if (theme !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {55 if (themeName !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
56 Theme.name = "Ubuntu.Components.Themes.%1".arg(theme);56 Theme.name = "Ubuntu.Components.Themes.%1".arg(themeName);
57 }57 }
58 }58 }
59 }59 }
6060
=== modified file 'src/Ubuntu/Components/1.2/Slider.qml'
--- src/Ubuntu/Components/1.2/Slider.qml 2015-04-30 08:32:44 +0000
+++ src/Ubuntu/Components/1.2/Slider.qml 2015-11-24 12:22:14 +0000
@@ -17,7 +17,6 @@
17// FIXME(loicm) Add support for keyboard shortcuts (basically left/right).17// FIXME(loicm) Add support for keyboard shortcuts (basically left/right).
1818
19import QtQuick 2.419import QtQuick 2.4
20import "mathUtils.js" as MathUtils
21import Ubuntu.Components 1.220import Ubuntu.Components 1.2
2221
23/*!22/*!
2423
=== modified file 'src/Ubuntu/Components/1.2/TextArea.qml'
--- src/Ubuntu/Components/1.2/TextArea.qml 2015-04-30 08:32:44 +0000
+++ src/Ubuntu/Components/1.2/TextArea.qml 2015-11-24 12:22:14 +0000
@@ -17,7 +17,6 @@
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.2 as Ubuntu18import Ubuntu.Components 1.2 as Ubuntu
19import Ubuntu.Components.Popups 1.019import Ubuntu.Components.Popups 1.0
20import "mathUtils.js" as MathUtils
2120
22/*!21/*!
23 \qmltype TextArea22 \qmltype TextArea
@@ -767,7 +766,7 @@
767 var max = (control.maximumLineCount <= 0) ?766 var max = (control.maximumLineCount <= 0) ?
768 control.lineCount :767 control.lineCount :
769 Math.min(control.maximumLineCount, control.lineCount);768 Math.min(control.maximumLineCount, control.lineCount);
770 control.height = linesHeight(MathUtils.clamp(control.lineCount, 1, max));769 control.height = linesHeight(Ubuntu.MathUtils.clamp(control.lineCount, 1, max));
771 }770 }
772 }771 }
773 }772 }
774773
=== removed file 'src/Ubuntu/Components/1.2/mathUtils.js'
--- src/Ubuntu/Components/1.2/mathUtils.js 2015-07-17 14:42:26 +0000
+++ src/Ubuntu/Components/1.2/mathUtils.js 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype mathUtils
19 \inqmlmodule Ubuntu.Components 1.2
20 \ingroup ubuntu
21 \brief Various mathematical utility functions.
22 */
23
24.pragma library
25
26/*!
27 \qmlmethod clamp(x, min, max)
28 Ensure the value x is between min and max
29 */
30function clamp(x, min, max) {
31 if (min <= max) {
32 return Math.max(min, Math.min(x, max));
33 } else {
34 // swap min/max if min > max
35 return clamp(x, max, min);
36 }
37}
38
39/*!
40 \qmlmethod lerp(delta, from, to)
41 Get the linear interpolation
42 */
43function lerp(delta, from, to) {
44 return ((1.0 - delta) * from) + (delta * to);
45}
46
47/*!
48 \qmlmethod getFlickableChild(item)
49 Linearly project a value x from [xmin, xmax] into [ymin, ymax]
50 */
51function projectValue(x, xmin, xmax, ymin, ymax) {
52 return ((x - xmin) * ymax - (x - xmax) * ymin) / (xmax - xmin)
53}
54
55/*!
56 \qmlmethod clampAndProject(x, xmin, xmax, ymin, ymax)
57 Linearly project a value x, but in addition to projectValue it's clamped to xmin/xmax first
58 */
59function clampAndProject(x, xmin, xmax, ymin, ymax) {
60 return projectValue(clamp(x, xmin, xmax), xmin, xmax, ymin, ymax)
61}
620
=== removed file 'src/Ubuntu/Components/1.2/scrollbarUtils.js'
--- src/Ubuntu/Components/1.2/scrollbarUtils.js 2015-04-30 08:32:44 +0000
+++ src/Ubuntu/Components/1.2/scrollbarUtils.js 1970-01-01 00:00:00 +0000
@@ -1,129 +0,0 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17.pragma library
18
19Qt.include("mathUtils.js")
20
21/*!
22 \internal
23 Object storing property names used in calculations.
24 */
25var _obj = {
26 scrollbar: null,
27 vertical: false,
28 propOrigin: "",
29 propContent: "",
30 propPosRatio: "",
31 propSizeRatio: "",
32 propCoordinate: "",
33 propSize: "",
34 refresh: function () {
35 _obj.vertical = (_obj.scrollbar.align === Qt.AlignLeading) || (_obj.scrollbar.align === Qt.AlignTrailing)
36 _obj.propOrigin = (_obj.vertical) ? "originY" : "originX";
37 _obj.propContent = (_obj.vertical) ? "contentY" : "contentX";
38 _obj.propPosRatio = (_obj.vertical) ? "yPosition" : "xPosition";
39 _obj.propSizeRatio = (_obj.vertical) ? "heightRatio" : "widthRatio";
40 _obj.propCoordinate = (_obj.vertical) ? "y" : "x";
41 _obj.propSize = (_obj.vertical) ? "height" : "width";
42 }
43}
44
45/*!
46 \internal
47 Checks whether the _obj is valid or not. Must be called in every function
48 as those can be invoked prior to the host (style) component completion.
49 */
50function __check(sb) {
51 if (sb !== null && (_obj.scrollbar !== sb)) {
52 _obj.scrollbar = sb;
53 sb.flickableItemChanged.connect(_obj.refresh);
54 sb.alignChanged.connect(_obj.refresh);
55 _obj.refresh();
56 }
57
58 return _obj.scrollbar;
59}
60
61/*!
62 Returns whether the scrollbar is vertical or horizontal.
63 */
64function isVertical(scrollbar) {
65 if (!__check(scrollbar)) return 0;
66 return _obj.vertical;
67}
68
69/*!
70 Calculates the slider position based on the visible area's ratios.
71 */
72function sliderPos(scrollbar, min, max) {
73 if (!__check(scrollbar)) return 0;
74 return clamp(scrollbar.flickableItem.visibleArea[_obj.propPosRatio] * scrollbar.flickableItem[_obj.propSize], min, max);
75}
76
77/*!
78 Calculates the slider size for ListViews based on the visible area's position
79 and size ratios, clamping it between min and max.
80
81 The function can be used in Scrollbar styles to calculate the size of the slider.
82 */
83function sliderSize(scrollbar, min, max) {
84 if (!__check(scrollbar)) return 0;
85 var sizeRatio = scrollbar.flickableItem.visibleArea[_obj.propSizeRatio];
86 var posRatio = scrollbar.flickableItem.visibleArea[_obj.propPosRatio];
87 var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
88 var startPos = posRatio * (max - sizeUnderflow)
89 var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
90 var overshootStart = startPos < 0 ? -startPos : 0
91 var overshootEnd = endPos > max ? endPos - max : 0
92
93 // overshoot adjusted start and end
94 var adjustedStartPos = startPos + overshootStart
95 var adjustedEndPos = endPos - overshootStart - overshootEnd
96
97 // final position and size of thumb
98 var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
99 var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
100
101 return result;
102}
103
104/*!
105 The function calculates and clamps the position to be scrolled to the minimum
106 and maximum values.
107
108 The scroll and drag functions require a slider that does not have any minimum
109 size set (meaning the minimum is set to 0.0). Implementations should consider
110 using an invisible cursor to drag the slider and the ListView position.
111 */
112function scrollAndClamp(scrollbar, amount, min, max) {
113 if (!__check(scrollbar)) return 0;
114 return scrollbar.flickableItem[_obj.propOrigin] +
115 clamp(scrollbar.flickableItem[_obj.propContent] - scrollbar.flickableItem[_obj.propOrigin] + amount,
116 min, max);
117}
118
119/*!
120 The function calculates the new position of the dragged slider. The amount is
121 relative to the contentSize, which is either the flickable's contentHeight or
122 contentWidth or other calculated value, depending on its orientation. The pageSize
123 specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
124 */
125function dragAndClamp(scrollbar, cursor, contentSize, pageSize) {
126 if (!__check(scrollbar)) return 0;
127 scrollbar.flickableItem[_obj.propContent] =
128 scrollbar.flickableItem[_obj.propOrigin] + cursor[_obj.propCoordinate] * contentSize / pageSize;
129}
1300
=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-10-14 15:44:15 +0000
+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-11-24 12:22:14 +0000
@@ -166,6 +166,11 @@
166 and the preferred width is set to 40 grid units. This width is set every time166 and the preferred width is set to 40 grid units. This width is set every time
167 the layout is activated.167 the layout is activated.
168168
169 When a \l Page with the \l Page::header property set is added to an
170 AdaptivePageLayout, the AdaptivePageLayout will synchronize the height of that
171 header with the height of the headers in other columns, i.e., the height of
172 each of the headers will be set to the maximum implicitHeight of all the headers.
173
169 \sa PageStack, PageColumnsLayout, PageColumn174 \sa PageStack, PageColumnsLayout, PageColumn
170*/175*/
171176
@@ -452,7 +457,17 @@
452 // replace page holder's child457 // replace page holder's child
453 var holder = body.children[targetColumn];458 var holder = body.children[targetColumn];
454 holder.detachCurrentPage();459 holder.detachCurrentPage();
455 holder.attachPage(pageWrapper);460 holder.attachPage(pageWrapper); // sets pageWrapper.pageHolder
461
462 // set the back action for Page.header:
463 var page = pageWrapper.object;
464 if (page && page.hasOwnProperty("header") && page.header &&
465 page.header.hasOwnProperty("navigationActions")) {
466 // Page.header is an instance of PageHeader.
467 var backAction = backActionComponent.createObject(
468 pageWrapper, { 'wrapper': pageWrapper } );
469 page.header.navigationActions = [ backAction ] ;
470 }
456 }471 }
457472
458 function getWrapper(page) {473 function getWrapper(page) {
@@ -644,6 +659,42 @@
644 }659 }
645 }660 }
646661
662 // An instance will be added to each Page with
663 Component {
664 id: backActionComponent
665
666 Action {
667 // used when the Page has a Page.header property set.
668 id: backAction
669 objectName: "apl_back_action"
670 iconName: "back"
671 text: "Back"
672
673 // set when backAction is created.
674 property PageWrapper wrapper
675 onTriggered: layout.removePages(wrapper.object)
676
677 visible: {
678 var parentWrapper;
679 try {
680 parentWrapper = d.tree.parent(wrapper);
681 } catch(err) {
682 // Root node has no parent node.
683 return false;
684 }
685 if (!wrapper.pageHolder) {
686 // columns are being re-arranged.
687 return false;
688 }
689 // wrapper.column is the virtual column, pageHolder.column the actual column.
690 var column = wrapper.pageHolder.column;
691 var nextInColumn = d.tree.top(column, column < d.columns - 1, 1);
692 return parentWrapper === nextInColumn;
693 }
694 }
695 }
696
697
647 // Page holder component, can have only one Page as child at a time, all stacked pages698 // Page holder component, can have only one Page as child at a time, all stacked pages
648 // will be parented into hiddenPool699 // will be parented into hiddenPool
649 Component {700 Component {
@@ -670,6 +721,15 @@
670 property var page: pageWrapper ? pageWrapper.object : null721 property var page: pageWrapper ? pageWrapper.object : null
671 property bool customHeader: page && page.hasOwnProperty("header") &&722 property bool customHeader: page && page.hasOwnProperty("header") &&
672 page.header723 page.header
724 onPageChanged: body.updateHeaderHeight(0)
725 Connections {
726 target: page
727 onHeaderChanged: body.updateHeaderHeight(0)
728 }
729 Connections {
730 target: page ? page.header : null
731 onImplicitHeightChanged: body.updateHeaderHeight(page.header.implicitHeight)
732 }
673733
674 // prevent the pages from taking the app header height into account.734 // prevent the pages from taking the app header height into account.
675 __propagated: null735 __propagated: null
@@ -692,6 +752,8 @@
692 }752 }
693 }753 }
694754
755 // subHeader is to be deprecated in UITK 1.4 and will be replaced
756 // by the Page.header property (introduced in 1.3).
695 property alias head: subHeader757 property alias head: subHeader
696 StyledItem {758 StyledItem {
697 id: subHeader759 id: subHeader
@@ -703,7 +765,6 @@
703 height: body.headerHeight765 height: body.headerHeight
704766
705 styleName: "PageHeadStyle"767 styleName: "PageHeadStyle"
706 theme.version: Ubuntu.toolkitVersion
707 objectName: "Header" + column768 objectName: "Header" + column
708769
709 property real preferredHeight: subHeader.__styleInstance ?770 property real preferredHeight: subHeader.__styleInstance ?
@@ -795,8 +856,8 @@
795 onXChanged: holder.Layout.preferredWidth = x856 onXChanged: holder.Layout.preferredWidth = x
796 }857 }
797858
798 function attachPage(page) {859 function attachPage(wrapper) {
799 pageWrapper = page;860 pageWrapper = wrapper;
800 pageWrapper.parent = holderBody;861 pageWrapper.parent = holderBody;
801 pageWrapper.pageHolder = holder;862 pageWrapper.pageHolder = holder;
802 pageWrapper.active = true;863 pageWrapper.active = true;
@@ -854,17 +915,32 @@
854 property real headerHeight: 0915 property real headerHeight: 0
855916
856 function updateHeaderHeight(newHeight) {917 function updateHeaderHeight(newHeight) {
918 var page;
919 var i;
857 if (newHeight > body.headerHeight) {920 if (newHeight > body.headerHeight) {
858 body.headerHeight = newHeight;921 body.headerHeight = newHeight;
859 } else {922 } else {
860 var h = 0;923 var h = 0;
861 var subHeight = 0;924 var subHeight = 0;
862 for (var i = 0; i < children.length; i++) {925 for (i = 0; i < children.length; i++) {
863 subHeight = children[i].head.preferredHeight;926 page = children[i].page;
927 if (page && page.hasOwnProperty("header") && page.header) {
928 subHeight = page.header.implicitHeight;
929 } else {
930 subHeight = children[i].head.preferredHeight;
931 }
864 if (subHeight > h) h = subHeight;932 if (subHeight > h) h = subHeight;
865 }933 }
866 body.headerHeight = h;934 body.headerHeight = h;
867 }935 }
936
937 // Update all the Page.header heights.
938 for (i = 0; i < body.children.length; i++) {
939 page = body.children[i].page;
940 if (page && page.hasOwnProperty("header") && page.header) {
941 page.header.height = headerHeight;
942 }
943 }
868 }944 }
869945
870 onChildrenChanged: {946 onChildrenChanged: {
871947
=== modified file 'src/Ubuntu/Components/1.3/AnimatedItem.qml'
--- src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-04-25 08:54:58 +0000
+++ src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-11-24 12:22:14 +0000
@@ -25,14 +25,13 @@
25*/25*/
2626
27import QtQuick 2.427import QtQuick 2.4
28import Ubuntu.Components 1.3 as Toolkit28import Ubuntu.Components 1.3
2929
30Toolkit.StyledItem {30StyledItem {
31 id: root31 id: root
32 /*!32 /*!
33 \deprecated33 \deprecated
34 Specifies whether the component is on the visible area of the Flickable or not.34 Specifies whether the component is on the visible area of the Flickable or not.
35 */35 */
36 theme.version: Toolkit.Ubuntu.toolkitVersion
37 property bool onScreen: true36 property bool onScreen: true
38}37}
3938
=== modified file 'src/Ubuntu/Components/1.3/AppHeader.qml'
--- src/Ubuntu/Components/1.3/AppHeader.qml 2015-10-01 21:23:04 +0000
+++ src/Ubuntu/Components/1.3/AppHeader.qml 2015-11-24 12:22:14 +0000
@@ -151,6 +151,5 @@
151 }151 }
152 }152 }
153153
154 theme.version: Components.Ubuntu.toolkitVersion
155 styleName: "PageHeadStyle"154 styleName: "PageHeadStyle"
156}155}
157156
=== removed file 'src/Ubuntu/Components/1.3/BottomEdgeHint.qml'
--- src/Ubuntu/Components/1.3/BottomEdgeHint.qml 2015-09-21 14:44:13 +0000
+++ src/Ubuntu/Components/1.3/BottomEdgeHint.qml 1970-01-01 00:00:00 +0000
@@ -1,155 +0,0 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20/*!
21 \qmlabstract BottomEdgeHint
22 \inqmlmodule Ubuntu.Components 1.3
23 \ingroup ubuntu
24 \brief The BottomEdgeHint shows the availability of extra features
25 available from the bottom edge of the application.
26
27 It displays either a label or an icon at the bottom of the application.
28
29 It has 2 states: hidden or visible. When hidden, part of it is still visible
30 to hint at the existence of the bottom edge.
31
32 When used with a mouse it acts like a button. The typical action associated
33 with clicking on it should be revealing the extra features provided by the
34 bottom edge.
35
36 Example:
37 \qml
38 BottomEdgeHint {
39 id: bottomEdgeHint
40 text: i18n.tr("Favorites")
41 onClicked: revealBottomEdge()
42 }
43 \endqml
44
45*/
46Item {
47 id: bottomEdgeHint
48
49 anchors {
50 bottom: parent.bottom
51 bottomMargin: bottomEdgeHint.state == "Hidden" ? -bottomEdgeHint.height + units.gu(1.5) : 0
52 horizontalCenter: parent.horizontalCenter
53 Behavior on bottomMargin { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
54 }
55
56 width: label.paintedWidth + units.gu(7)
57 height: units.gu(4)
58
59 /*!
60 This handler is called when there is a mouse click on the BottomEdgeHint
61 and the BottomEdgeHint is not disabled.
62 */
63 signal clicked()
64
65 Keys.onEnterPressed: clicked()
66 Keys.onReturnPressed: clicked()
67
68 /*!
69 The label displayed by the BottomEdgeHint.
70 */
71 property string text
72
73 /*!
74 The icon displayed by the BottomEdgeHint.
75
76 This is the URL of any image file.
77 If both iconSource and iconName are defined, iconName will be ignored.
78 */
79 property url iconSource: iconName ? "image://theme/" + iconName : ""
80
81 /*!
82 The icon associated with the BottomEdgeHint in the icon theme.
83
84 If both iconSource and iconName are defined, iconName will be ignored.
85 */
86 property string iconName
87
88 /*!
89 BottomEdgeHint can take 2 states of visibility: "Hidden" and "Visible".
90
91 When "Visible", the full hint with its content is shown.
92
93 When "Hidden", only part of the hint is visible leaving more space for application content.
94 */
95 property string state: "Visible"
96
97 MouseArea {
98 id: mouseArea
99 anchors.fill: parent
100 hoverEnabled: true
101 onEntered: bottomEdgeHint.state = "Visible"
102 onClicked: {
103 Haptics.play();
104 bottomEdgeHint.clicked();
105 mouse.accepted = false;
106 }
107 }
108
109 clip: true
110
111 UbuntuShape {
112 id: background
113
114 anchors {
115 bottom: parent.bottom
116 horizontalCenter: bottomEdgeHint.horizontalCenter
117 bottomMargin: -units.gu(1)
118 }
119
120 width: bottomEdgeHint.width - 2 * hoverExpansion
121 height: bottomEdgeHint.height + units.gu(1) - hoverExpansion
122
123 property real hoverExpansion: mouseArea.containsMouse ? 0 : units.gu(0.5)
124 Behavior on hoverExpansion { UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } }
125
126 backgroundColor: theme.palette.normal.overlay
127 }
128
129 Label {
130 id: label
131
132 anchors {
133 top: parent.top
134 horizontalCenter: parent.horizontalCenter
135 }
136 text: icon.name ? "" : bottomEdgeHint.text
137 textSize: Label.Medium
138 height: bottomEdgeHint.height
139 verticalAlignment: Text.AlignVCenter
140 horizontalAlignment: Text.AlignHCenter
141 }
142
143 Icon {
144 id: icon
145
146 name: bottomEdgeHint.iconName
147 anchors {
148 bottom: parent.bottom
149 bottomMargin: units.gu(0.5)
150 horizontalCenter: parent.horizontalCenter
151 }
152 width: height
153 height: units.gu(2)
154 }
155}
1560
=== modified file 'src/Ubuntu/Components/1.3/Button.qml'
--- src/Ubuntu/Components/1.3/Button.qml 2015-08-20 06:56:44 +0000
+++ src/Ubuntu/Components/1.3/Button.qml 2015-11-24 12:22:14 +0000
@@ -121,6 +121,5 @@
121 */121 */
122 property string iconPosition: "left"122 property string iconPosition: "left"
123123
124 theme.version: Ubuntu.toolkitVersion
125 styleName: "ButtonStyle"124 styleName: "ButtonStyle"
126}125}
127126
=== modified file 'src/Ubuntu/Components/1.3/CheckBox.qml'
--- src/Ubuntu/Components/1.3/CheckBox.qml 2015-09-16 16:58:51 +0000
+++ src/Ubuntu/Components/1.3/CheckBox.qml 2015-11-24 12:22:14 +0000
@@ -49,6 +49,5 @@
49 */49 */
50 onTriggered: checked = !checked50 onTriggered: checked = !checked
5151
52 theme.version: Ubuntu.toolkitVersion
53 styleName: "CheckBoxStyle"52 styleName: "CheckBoxStyle"
54}53}
5554
=== modified file 'src/Ubuntu/Components/1.3/OptionSelector.qml'
--- src/Ubuntu/Components/1.3/OptionSelector.qml 2015-09-07 10:05:58 +0000
+++ src/Ubuntu/Components/1.3/OptionSelector.qml 2015-11-24 12:22:14 +0000
@@ -225,7 +225,6 @@
225 right: parent.right225 right: parent.right
226 }226 }
227 state: optionSelector.expanded ? "expanded" : "collapsed"227 state: optionSelector.expanded ? "expanded" : "collapsed"
228 theme.version: Toolkit.Ubuntu.toolkitVersion
229 styleName: "OptionSelectorStyle"228 styleName: "OptionSelectorStyle"
230 states: [ State {229 states: [ State {
231 name: "expanded"230 name: "expanded"
232231
=== removed file 'src/Ubuntu/Components/1.3/Page.qdoc'
--- src/Ubuntu/Components/1.3/Page.qdoc 2015-04-25 08:54:58 +0000
+++ src/Ubuntu/Components/1.3/Page.qdoc 1970-01-01 00:00:00 +0000
@@ -1,132 +0,0 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype Page
19 \inqmlmodule Ubuntu.Components 1.1
20 \ingroup ubuntu
21 \brief A page is the basic Item that must be used inside the \l MainView,
22 \l PageStack and \l Tabs.
23 Anchors and height of a Page are automatically determined to align with
24 the header of the \l MainView, but can be overridden.
25
26 \l MainView provides a header for Pages it includes.
27 The text and actions of the header are determined by the \l title
28 and \l head properties of the page:
29
30 \qml
31 import QtQuick 2.4
32 import Ubuntu.Components 1.2
33
34 MainView {
35 width: units.gu(48)
36 height: units.gu(60)
37
38 Page {
39 title: i18n.tr("Example page")
40
41 Label {
42 anchors.centerIn: parent
43 text: i18n.tr("Hello world!")
44 }
45
46 head.actions: [
47 Action {
48 iconName: "search"
49 text: i18n.tr("Search")
50 },
51 Action {
52 iconName: "contacts"
53 text: i18n.tr("Contacts")
54 }
55 ]
56 }
57 }
58 \endqml
59 See \l MainView for more examples on how to use the header.
60 Advanced navigation structures can be created by adding Pages to a \l PageStack or \l Tabs.
61
62 The Page automatically anchors to the left and bottom of its parent. The width of the Page
63 will be the full width of its parent \l MainView or \l PageStack or \l Tab,
64 and the height will adapt to leave space for the header when needed. It is possible to
65 use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
66 so that the Page can control its width and height.
67*/
68
69/*!
70 \qmlproperty string Page::title
71 The title of the page. Will be shown in the header of the \l MainView.
72 If the page is used inside a \l Tab, the default title is the \l Tab title.
73 For a Page not inside a \l Tab, the default title is an empty string.
74 */
75
76/*!
77 \qmlproperty Item Page::tools
78 \deprecated
79 The toolbar items associated with this Page.
80 DEPRECATED. Use \b head.actions instead.
81 */
82
83/*!
84 \qmlproperty PageHeadConfiguration Page::head
85 \readonly
86 Configuration of the header for this page.
87 */
88
89/*!
90 \qmlproperty Flickable Page::flickable
91 Optional flickable that controls the header. This property
92 is automatically set to the first child of the page that is Flickable
93 and anchors to the top of the page or fills the page. For example:
94 \qml
95 import QtQuick 2.4
96 import Ubuntu.Components 1.2
97
98 MainView {
99 width: units.gu(30)
100 height: units.gu(50)
101 Page {
102 id: page
103 title: "example"
104 //flickable: null // uncomment for a fixed header
105 Flickable {
106 id: content
107 anchors.fill: parent
108 contentHeight: units.gu(70)
109 Label {
110 text: "hello"
111 anchors.centerIn: parent
112 }
113 }
114 }
115 }
116 \endqml
117 In this example, page.flickable will automatically be set to content because it is
118 a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
119 hide the header.
120
121 Set this property to null to avoid automatic flickable detection, which disables hiding
122 of the header by scrolling in the Flickable. In cases where a flickable should control the header,
123 but it is not automatically detected, the flickable property can be set.
124 */
125
126/*!
127 \qmlproperty list<Action> Page::actions
128 Local actions. These actions will be made available outside the application
129 (for example, to HUD) when the Page is active. For actions that are always available
130 when the application is running, use the actions property of \l MainView.
131 For actions in the header, see \l head.
132*/
1330
=== modified file 'src/Ubuntu/Components/1.3/Page.qml'
--- src/Ubuntu/Components/1.3/Page.qml 2015-10-15 10:07:59 +0000
+++ src/Ubuntu/Components/1.3/Page.qml 2015-11-24 12:22:14 +0000
@@ -19,8 +19,55 @@
19import "pageUtils.js" as Utils19import "pageUtils.js" as Utils
2020
21/*!21/*!
22 \internal22 \qmltype Page
23 Documentation is in Page.qdoc23 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu
25 \brief A page is the basic Item that must be used inside the \l MainView,
26 \l PageStack and \l Tabs.
27 Anchors and height of a Page are automatically determined to align with
28 the header of the \l MainView, but can be overridden.
29
30
31 \l MainView provides a header for Pages it includes if no
32 \l header property was set.
33 The text and actions of the header are determined by the \l title
34 and \l head properties of the page:
35
36 \qml
37 import QtQuick 2.4
38 import Ubuntu.Components 1.2
39
40 MainView {
41 width: units.gu(48)
42 height: units.gu(60)
43
44 Page {
45 title: i18n.tr("Example page")
46
47 Label {
48 anchors.centerIn: parent
49 text: i18n.tr("Hello world!")
50 }
51
52 head.actions: [
53 Action {
54 iconName: "search"
55 text: i18n.tr("Search")
56 },
57 Action {
58 iconName: "contacts"
59 text: i18n.tr("Contacts")
60 }
61 ]
62 }
63 }
64 \endqml
65
66 The Page automatically anchors to the left and bottom of its parent. The width of the Page
67 will be the full width of its parent \l MainView or \l PageStack or \l Tab,
68 and the height will adapt to leave space for the header when needed. It is possible to
69 use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
70 so that the Page can control its width and height.
24*/71*/
25PageTreeNode {72PageTreeNode {
26 id: page73 id: page
@@ -35,13 +82,13 @@
3582
36 /*!83 /*!
37 The header property for this page. Setting this property will reparent the84 The header property for this page. Setting this property will reparent the
38 header to the page and disable the \l Mainview's application header.85 header to the page and disable the \l MainView's application header.
39 \qml86 \qml
40 Page {87 Page {
41 id: page88 id: page
42 title: "Page with header"89 title: "Page with header"
43 header: PageHeader {90 header: PageHeader {
44 title: page.header91 title: page.title
45 trailingActionBar.actions: [92 trailingActionBar.actions: [
46 Action { iconName: "settings" },93 Action { iconName: "settings" },
47 Action { iconName: "info" }94 Action { iconName: "info" }
@@ -49,17 +96,65 @@
49 }96 }
50 }97 }
51 \endqml98 \endqml
99 \sa PageHeader
52 */100 */
53 property Item header101 property Item header
54 onHeaderChanged: internal.updateHeader()102 onHeaderChanged: internal.updateHeader()
55 Component.onCompleted: internal.updateHeader()103 Component.onCompleted: internal.updateHeader()
56104
105 /*! \internal */
57 isLeaf: true106 isLeaf: true
107
108 /*!
109 The title of the page. Will be shown in the header of the \l MainView.
110 If the page is used inside a \l Tab, the default title is the \l Tab title.
111 For a Page not inside a \l Tab, the default title is an empty string.
112 */
58 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""113 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""
114
115 /*!
116 Optional flickable that controls the MainView header. This property
117 is automatically set to the first child of the page that is Flickable
118 and anchors to the top of the page or fills the page. For example:
119 \qml
120 import QtQuick 2.4
121 import Ubuntu.Components 1.2
122
123 MainView {
124 width: units.gu(30)
125 height: units.gu(50)
126 Page {
127 id: page
128 title: "example"
129 //flickable: null // uncomment for a fixed header
130 Flickable {
131 id: content
132 anchors.fill: parent
133 contentHeight: units.gu(70)
134 Label {
135 text: "hello"
136 anchors.centerIn: parent
137 }
138 }
139 }
140 }
141 \endqml
142 In this example, page.flickable will automatically be set to content because it is
143 a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
144 hide the header.
145
146 Set this property to null to avoid automatic flickable detection, which disables hiding
147 of the header by scrolling in the Flickable. In cases where a flickable should control the header,
148 but it is not automatically detected, the flickable property can be set.
149 */
59 property Flickable flickable: Utils.getFlickableChild(page)150 property Flickable flickable: Utils.getFlickableChild(page)
60151
61 /*!152 /*!
62 \qmlproperty PageHeadConfiguration head153 \qmlproperty PageHeadConfiguration Page::head
154 \readonly
155 \deprecated
156 Configuration of the header for this page.
157 Deprecated: This configuration will be replaced by setting the \l header property.
63 */158 */
64 readonly property alias head: headerConfig159 readonly property alias head: headerConfig
65 Toolkit13.PageHeadConfiguration {160 Toolkit13.PageHeadConfiguration {
66161
=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
--- src/Ubuntu/Components/1.3/PageHeader.qml 2015-10-15 14:17:25 +0000
+++ src/Ubuntu/Components/1.3/PageHeader.qml 2015-11-24 12:22:14 +0000
@@ -40,8 +40,8 @@
40Header {40Header {
41 id: header41 id: header
42 anchors {42 anchors {
43 left: parent.left43 left: parent ? parent.left : undefined
44 right: parent.right44 right: parent ? parent.right : undefined
45 }45 }
4646
47 /*!47 /*!
@@ -109,9 +109,25 @@
109 titleLoader.sourceComponent = __styleInstance.titleComponent;109 titleLoader.sourceComponent = __styleInstance.titleComponent;
110 }110 }
111 }111 }
112
113 // When the style changes, make sure that the titleLoader loads
114 // the new titleComponent.
115 property Item styleInstance: __styleInstance
116 onStyleInstanceChanged: updateContents()
112 }117 }
113118
114 /*!119 /*!
120 The actions to be shown in the leading action bar.
121 This property is automatically set by the
122 \l AdaptivePageLayout and other navigation components to configure the
123 back action for the \l Page.
124 Application developers should not set this property, because the
125 value may be overridden by Ubuntu components that have navigation.
126 Instead, set \l leadingActionBar's actions property.
127 */
128 property list<Action> navigationActions
129
130 /*!
115 \qmlproperty ActionBar leadingActionBar131 \qmlproperty ActionBar leadingActionBar
116 The \l ActionBar for the leading navigation actions.132 The \l ActionBar for the leading navigation actions.
117 Example:133 Example:
@@ -125,6 +141,9 @@
125 ]141 ]
126 }142 }
127 \endqml143 \endqml
144 The default value of \l leadingActionBar actions is
145 \l navigationActions, but that value can be changed to show
146 different actions in front of the title.
128 See \l ActionBar.147 See \l ActionBar.
129 */148 */
130 readonly property alias leadingActionBar: leading149 readonly property alias leadingActionBar: leading
@@ -138,7 +157,8 @@
138 height: header.__styleInstance.contentHeight157 height: header.__styleInstance.contentHeight
139 numberOfSlots: 1158 numberOfSlots: 1
140 delegate: header.__styleInstance.defaultActionDelegate159 delegate: header.__styleInstance.defaultActionDelegate
141 visible: actions.length > 0160 actions: header.navigationActions
161 visible: leading.width > 0 // at least 1 visible action
142 StyleHints {162 StyleHints {
143 overflowIconName: "navigation-menu"163 overflowIconName: "navigation-menu"
144 }164 }
@@ -182,7 +202,7 @@
182 height: header.__styleInstance.contentHeight202 height: header.__styleInstance.contentHeight
183 numberOfSlots: 3203 numberOfSlots: 3
184 delegate: header.__styleInstance.defaultActionDelegate204 delegate: header.__styleInstance.defaultActionDelegate
185 visible: actions.length > 0205 visible: trailing.width > 0 // at least 1 visible action
186 }206 }
187207
188 /*!208 /*!
@@ -203,6 +223,5 @@
203 height: visible ? implicitHeight : 0223 height: visible ? implicitHeight : 0
204 }224 }
205225
206 theme.version: Ubuntu.toolkitVersion
207 styleName: "PageHeaderStyle"226 styleName: "PageHeaderStyle"
208}227}
209228
=== modified file 'src/Ubuntu/Components/1.3/PageStack.qml'
--- src/Ubuntu/Components/1.3/PageStack.qml 2015-07-10 07:42:38 +0000
+++ src/Ubuntu/Components/1.3/PageStack.qml 2015-11-24 12:22:14 +0000
@@ -16,6 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import "../1.2/stack.js" as Stack18import "../1.2/stack.js" as Stack
19import Ubuntu.Components 1.3
1920
20/*!21/*!
21 \qmltype PageStack22 \qmltype PageStack
@@ -171,6 +172,13 @@
171 } else {172 } else {
172 internal.pushWrapperObject();173 internal.pushWrapperObject();
173 }174 }
175 // set the back action for Page.header:
176 if (pageObject && pageObject.hasOwnProperty("header") && pageObject.header &&
177 pageObject.header.hasOwnProperty("navigationActions")) {
178 // Page.header is an instance of PageHeader.
179 pageObject.header.navigationActions = [ backAction ];
180 }
181
174 return pageObject;182 return pageObject;
175 }183 }
176184
@@ -206,6 +214,16 @@
206 internal.stackUpdated();214 internal.stackUpdated();
207 }215 }
208216
217 Action {
218 // used when the Page has a Page.header property set.
219 id: backAction
220 visible: pageStack.depth > 0
221 iconName: "back"
222 text: "Back"
223 onTriggered: pageStack.pop()
224 objectName: "pagestack_back_action"
225 }
226
209 QtObject {227 QtObject {
210 id: internal228 id: internal
211 property Item headStyle: (pageStack.__propagated229 property Item headStyle: (pageStack.__propagated
212230
=== modified file 'src/Ubuntu/Components/1.3/PageTreeNode.qml'
--- src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-10-14 19:18:58 +0000
+++ src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-11-24 12:22:14 +0000
@@ -148,6 +148,4 @@
148 node.parentNode = internal.getParentPageTreeNode(node);148 node.parentNode = internal.getParentPageTreeNode(node);
149 }149 }
150 }150 }
151
152 theme.version: Toolkit.Ubuntu.toolkitVersion
153}151}
154152
=== modified file 'src/Ubuntu/Components/1.3/PageWrapper.qml'
--- src/Ubuntu/Components/1.3/PageWrapper.qml 2015-09-24 15:28:58 +0000
+++ src/Ubuntu/Components/1.3/PageWrapper.qml 2015-11-24 12:22:14 +0000
@@ -46,7 +46,7 @@
46 property bool canDestroy: false46 property bool canDestroy: false
4747
48 /*!48 /*!
49 Column number in MultiColumnView.49 Column number in AdaptivePageLayout.
50 */50 */
51 property int column: 051 property int column: 0
5252
@@ -61,7 +61,7 @@
61 property Item parentWrapper61 property Item parentWrapper
6262
63 /*!63 /*!
64 Page holder in MultiColumnView64 Page holder in AdaptivePageLayout.
65 */65 */
66 property Item pageHolder66 property Item pageHolder
6767
6868
=== modified file 'src/Ubuntu/Components/1.3/ProgressBar.qml'
--- src/Ubuntu/Components/1.3/ProgressBar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/ProgressBar.qml 2015-11-24 12:22:14 +0000
@@ -70,6 +70,5 @@
70 */70 */
71 property bool showProgressPercentage: true71 property bool showProgressPercentage: true
7272
73 theme.version: Ubuntu.toolkitVersion
74 styleName: "ProgressBarStyle"73 styleName: "ProgressBarStyle"
75}74}
7675
=== modified file 'src/Ubuntu/Components/1.3/PullToRefresh.qml'
--- src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-11-24 12:22:14 +0000
@@ -222,7 +222,6 @@
222 */222 */
223 signal refresh()223 signal refresh()
224224
225 theme.version: Ubuntu.toolkitVersion
226 styleName: "PullToRefreshStyle"225 styleName: "PullToRefreshStyle"
227 implicitHeight: __styleInstance.implicitHeight226 implicitHeight: __styleInstance.implicitHeight
228 anchors {227 anchors {
229228
=== modified file 'src/Ubuntu/Components/1.3/Scrollbar.qml'
--- src/Ubuntu/Components/1.3/Scrollbar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/Scrollbar.qml 2015-11-24 12:22:14 +0000
@@ -146,6 +146,5 @@
146 }146 }
147 }147 }
148148
149 theme.version: Toolkit.Ubuntu.toolkitVersion
150 styleName: "ScrollbarStyle"149 styleName: "ScrollbarStyle"
151}150}
152151
=== modified file 'src/Ubuntu/Components/1.3/Sections.qml'
--- src/Ubuntu/Components/1.3/Sections.qml 2015-07-14 12:49:58 +0000
+++ src/Ubuntu/Components/1.3/Sections.qml 2015-11-24 12:22:14 +0000
@@ -29,7 +29,6 @@
29StyledItem {29StyledItem {
30 id: sections30 id: sections
31 styleName: "SectionsStyle"31 styleName: "SectionsStyle"
32 theme.version: Ubuntu.toolkitVersion
3332
34 /*!33 /*!
35 List of actions that represent the sections.34 List of actions that represent the sections.
3635
=== modified file 'src/Ubuntu/Components/1.3/Slider.qml'
--- src/Ubuntu/Components/1.3/Slider.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/Slider.qml 2015-11-24 12:22:14 +0000
@@ -159,7 +159,7 @@
159 return Toolkit.MathUtils.clampAndProject(value, slider.minimumValue,159 return Toolkit.MathUtils.clampAndProject(value, slider.minimumValue,
160 slider.maximumValue, 1.0, 0.0);160 slider.maximumValue, 1.0, 0.0);
161 } else {161 } else {
162 return MathUtils.clampAndProject(value, slider.minimumValue,162 return Toolkit.MathUtils.clampAndProject(value, slider.minimumValue,
163 slider.maximumValue, 0.0, 1.0);163 slider.maximumValue, 0.0, 1.0);
164 }164 }
165165
@@ -167,10 +167,10 @@
167167
168 function valueFromNormalizedValue(normalizedValue) {168 function valueFromNormalizedValue(normalizedValue) {
169 if (Qt.application.layoutDirection == Qt.RightToLeft) {169 if (Qt.application.layoutDirection == Qt.RightToLeft) {
170 return MathUtils.lerp(MathUtils.clamp(normalizedValue, 0.0, 1.0),170 return Toolkit.MathUtils.lerp(Toolkit.MathUtils.clamp(normalizedValue, 0.0, 1.0),
171 slider.maximumValue, slider.minimumValue);171 slider.maximumValue, slider.minimumValue);
172 } else {172 } else {
173 return MathUtils.lerp(MathUtils.clamp(normalizedValue, 0.0, 1.0),173 return Toolkit.MathUtils.lerp(Toolkit.MathUtils.clamp(normalizedValue, 0.0, 1.0),
174 slider.minimumValue, slider.maximumValue);174 slider.minimumValue, slider.maximumValue);
175 }175 }
176 }176 }
@@ -206,6 +206,5 @@
206 onLiveValueChanged: if (isPressed) slider.requestFocus(Qt.MouseFocusReason)206 onLiveValueChanged: if (isPressed) slider.requestFocus(Qt.MouseFocusReason)
207 }207 }
208208
209 theme.version: Toolkit.Ubuntu.toolkitVersion
210 styleName: "SliderStyle"209 styleName: "SliderStyle"
211}210}
212211
=== modified file 'src/Ubuntu/Components/1.3/TabBar.qml'
--- src/Ubuntu/Components/1.3/TabBar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/TabBar.qml 2015-11-24 12:22:14 +0000
@@ -97,7 +97,6 @@
9797
98 implicitHeight: units.gu(7.5)98 implicitHeight: units.gu(7.5)
99 activeFocusOnPress: true99 activeFocusOnPress: true
100 theme.version: Toolkit.Ubuntu.toolkitVersion
101 styleName: "TabBarStyle"100 styleName: "TabBarStyle"
102101
103 QtObject {102 QtObject {
104103
=== modified file 'src/Ubuntu/Components/1.3/TextArea.qml'
--- src/Ubuntu/Components/1.3/TextArea.qml 2015-09-07 10:05:58 +0000
+++ src/Ubuntu/Components/1.3/TextArea.qml 2015-11-24 12:22:14 +0000
@@ -886,6 +886,5 @@
886 }886 }
887 }887 }
888888
889 theme.version: Ubuntu.Ubuntu.toolkitVersion
890 styleName: "TextAreaStyle"889 styleName: "TextAreaStyle"
891}890}
892891
=== modified file 'src/Ubuntu/Components/1.3/TextCursor.qml'
--- src/Ubuntu/Components/1.3/TextCursor.qml 2015-10-30 13:38:52 +0000
+++ src/Ubuntu/Components/1.3/TextCursor.qml 2015-11-24 12:22:14 +0000
@@ -41,7 +41,6 @@
41 handler.main.cursorDelegate :41 handler.main.cursorDelegate :
42 __styleInstance.cursorDelegate42 __styleInstance.cursorDelegate
4343
44 theme.version: Ubuntu.Ubuntu.toolkitVersion
45 styleName: "TextCursorStyle"44 styleName: "TextCursorStyle"
4645
47 objectName: "textCursor"46 objectName: "textCursor"
4847
=== modified file 'src/Ubuntu/Components/1.3/TextField.qml'
--- src/Ubuntu/Components/1.3/TextField.qml 2015-09-07 10:05:58 +0000
+++ src/Ubuntu/Components/1.3/TextField.qml 2015-11-24 12:22:14 +0000
@@ -870,6 +870,7 @@
870 for (var i = 0; i < children.length; i++) {870 for (var i = 0; i < children.length; i++) {
871 children[i].parent = leftPane;871 children[i].parent = leftPane;
872 children[i].anchors.verticalCenter = verticalCenter;872 children[i].anchors.verticalCenter = verticalCenter;
873 children[i].activeFocusOnPress = false;
873 }874 }
874 }875 }
875 }876 }
@@ -892,6 +893,7 @@
892 for (var i = 0; i < children.length; i++) {893 for (var i = 0; i < children.length; i++) {
893 children[i].parent = rightPane;894 children[i].parent = rightPane;
894 children[i].anchors.verticalCenter = verticalCenter;895 children[i].anchors.verticalCenter = verticalCenter;
896 children[i].activeFocusOnPress = false;
895 }897 }
896 }898 }
897 }899 }
@@ -1013,6 +1015,5 @@
1013 cursorPosition = 0;1015 cursorPosition = 0;
1014 }1016 }
10151017
1016 theme.version: Ubuntu.Ubuntu.toolkitVersion
1017 styleName: "TextFieldStyle"1018 styleName: "TextFieldStyle"
1018}1019}
10191020
=== modified file 'src/Ubuntu/Components/1.3/TextInputPopover.qml'
--- src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-09-16 05:28:29 +0000
+++ src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-11-24 12:22:14 +0000
@@ -86,7 +86,6 @@
86 width: Math.max(units.gu(5), implicitWidth) + units.gu(2)86 width: Math.max(units.gu(5), implicitWidth) + units.gu(2)
87 height: units.gu(6)87 height: units.gu(6)
88 action: actions[modelData]88 action: actions[modelData]
89 theme.version: Ubuntu.toolkitVersion
90 styleName: "ToolbarButtonStyle"89 styleName: "ToolbarButtonStyle"
91 }90 }
92 }91 }
9392
=== modified file 'src/Ubuntu/Components/1.3/Toolbar.qml'
--- src/Ubuntu/Components/1.3/Toolbar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/Toolbar.qml 2015-11-24 12:22:14 +0000
@@ -135,7 +135,6 @@
135 property bool opened: toolbar.opened135 property bool opened: toolbar.opened
136 property bool animating: toolbar.animating136 property bool animating: toolbar.animating
137137
138 theme.version: Toolkit.Ubuntu.toolkitVersion
139 styleName: "ToolbarStyle"138 styleName: "ToolbarStyle"
140 }139 }
141140
142141
=== modified file 'src/Ubuntu/Components/1.3/ToolbarButton.qml'
--- src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-11-24 12:22:14 +0000
@@ -84,6 +84,5 @@
84 height: parent ? parent.height : undefined84 height: parent ? parent.height : undefined
85 width: units.gu(5)85 width: units.gu(5)
8686
87 theme.version: Ubuntu.toolkitVersion
88 styleName: "ToolbarButtonStyle"87 styleName: "ToolbarButtonStyle"
89}88}
9089
=== removed file 'src/Ubuntu/Components/1.3/mathUtils.js'
--- src/Ubuntu/Components/1.3/mathUtils.js 2015-07-24 18:25:07 +0000
+++ src/Ubuntu/Components/1.3/mathUtils.js 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1/*
2 * Copyright 2012-2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype mathUtils
19 \inqmlmodule Ubuntu.Components 1.3
20 \ingroup ubuntu
21 \brief Various mathematical utility functions.
22 */
23
24.pragma library
25
26/*!
27 \qmlmethod mathUtils::clamp(x, min, max)
28 Ensure the value x is between min and max
29 */
30function clamp(x, min, max) {
31 if (min <= max) {
32 return Math.max(min, Math.min(x, max));
33 } else {
34 // swap min/max if min > max
35 return clamp(x, max, min);
36 }
37}
38
39/*!
40 \qmlmethod mathUtils::lerp(delta, from, to)
41 Get the linear interpolation
42 */
43function lerp(delta, from, to) {
44 return ((1.0 - delta) * from) + (delta * to);
45}
46
47/*!
48 \qmlmethod mathUtils::projectValue(x, xmin, xmax, ymin, ymax)
49 Linearly project a value x from [xmin, xmax] into [ymin, ymax]
50 */
51function projectValue(x, xmin, xmax, ymin, ymax) {
52 return ((x - xmin) * ymax - (x - xmax) * ymin) / (xmax - xmin)
53}
54
55/*!
56 \qmlmethod mathUtils::clampAndProject(x, xmin, xmax, ymin, ymax)
57 Linearly project a value x, but in addition to projectValue it's clamped to xmin/xmax first
58 */
59function clampAndProject(x, xmin, xmax, ymin, ymax) {
60 return projectValue(clamp(x, xmin, xmax), xmin, xmax, ymin, ymax)
61}
620
=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
--- src/Ubuntu/Components/ComponentModule.pro 2015-10-02 22:48:13 +0000
+++ src/Ubuntu/Components/ComponentModule.pro 2015-11-24 12:22:14 +0000
@@ -43,7 +43,6 @@
43 1.2/MainView12.qml \43 1.2/MainView12.qml \
44 1.2/MainViewBase.qml \44 1.2/MainViewBase.qml \
45 1.2/MainView.qml \45 1.2/MainView.qml \
46 1.2/mathUtils.js \
47 1.2/Object.qml \46 1.2/Object.qml \
48 1.2/OptionSelectorDelegate.qml \47 1.2/OptionSelectorDelegate.qml \
49 1.2/OptionSelector.qml \48 1.2/OptionSelector.qml \
@@ -60,7 +59,6 @@
60 1.2/Panel.qml \59 1.2/Panel.qml \
61 1.2/PullToRefresh.qml \60 1.2/PullToRefresh.qml \
62 1.2/Scrollbar.qml \61 1.2/Scrollbar.qml \
63 1.2/scrollbarUtils.js \
64 1.2/Slider.qml \62 1.2/Slider.qml \
65 1.2/sliderUtils.js \63 1.2/sliderUtils.js \
66 1.2/stack.js \64 1.2/stack.js \
@@ -96,7 +94,6 @@
96 1.3/InputHandler.qml \94 1.3/InputHandler.qml \
97 1.3/MainViewBase.qml \95 1.3/MainViewBase.qml \
98 1.3/MainView.qml \96 1.3/MainView.qml \
99 1.3/mathUtils.js \
100 1.3/OptionSelectorDelegate.qml \97 1.3/OptionSelectorDelegate.qml \
101 1.3/OptionSelector.qml \98 1.3/OptionSelector.qml \
102 1.3/OrientationHelper.qml \99 1.3/OrientationHelper.qml \
@@ -132,7 +129,6 @@
132 1.3/UbuntuListView.qml \129 1.3/UbuntuListView.qml \
133 1.3/UbuntuNumberAnimation.qml \130 1.3/UbuntuNumberAnimation.qml \
134 1.3/ListItemPopover.qml \131 1.3/ListItemPopover.qml \
135 1.3/BottomEdgeHint.qml \
136 1.3/PageColumn.qml \132 1.3/PageColumn.qml \
137 1.3/PageColumnsLayout.qml \133 1.3/PageColumnsLayout.qml \
138 1.3/ProgressionSlot.qml \134 1.3/ProgressionSlot.qml \
@@ -141,7 +137,6 @@
141OTHER_FILES+= qmldir \137OTHER_FILES+= qmldir \
142 1.3/CrossFadeImage.qdoc \138 1.3/CrossFadeImage.qdoc \
143 1.3/UbuntuListView11.qdoc \139 1.3/UbuntuListView11.qdoc \
144 1.3/Page.qdoc \
145 1.3/PageHeadConfiguration.qdoc \140 1.3/PageHeadConfiguration.qdoc \
146 1.3/MainView.qdoc \141 1.3/MainView.qdoc \
147 1.3/Icon.qdoc142 1.3/Icon.qdoc
148143
=== modified file 'src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml'
--- src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-11-24 12:22:14 +0000
@@ -216,7 +216,6 @@
216 right: parent.right216 right: parent.right
217 }217 }
218 state: itemSelector.expanded ? "expanded" : "collapsed"218 state: itemSelector.expanded ? "expanded" : "collapsed"
219 theme.version: Ubuntu.toolkitVersion
220 styleName: "ListItemOptionSelectorStyle"219 styleName: "ListItemOptionSelectorStyle"
221220
222 states: [ State {221 states: [ State {
223222
=== modified file 'src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml'
--- src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-11-24 12:22:14 +0000
@@ -25,6 +25,5 @@
25 property bool showSplit: false25 property bool showSplit: false
26 property real splitMargin26 property real splitMargin
2727
28 theme.version: Ubuntu.toolkitVersion
29 styleName: "ProgressionVisualStyle"28 styleName: "ProgressionVisualStyle"
30}29}
3130
=== modified file 'src/Ubuntu/Components/Pickers/1.3/DatePicker.qml'
--- src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-11-24 12:22:14 +0000
@@ -420,7 +420,6 @@
420 }420 }
421 }421 }
422422
423 theme.version: Ubuntu.toolkitVersion
424 styleName: "DatePickerStyle"423 styleName: "DatePickerStyle"
425 Binding {424 Binding {
426 target: __styleInstance425 target: __styleInstance
427426
=== modified file 'src/Ubuntu/Components/Pickers/1.3/Dialer.qml'
--- src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-11-24 12:22:14 +0000
@@ -145,7 +145,6 @@
145 implicitHeight: size145 implicitHeight: size
146 activeFocusOnPress: true146 activeFocusOnPress: true
147147
148 theme.version: Ubuntu.toolkitVersion
149 styleName: "DialerStyle"148 styleName: "DialerStyle"
150149
151 Item {150 Item {
152151
=== modified file 'src/Ubuntu/Components/Pickers/1.3/DialerHand.qml'
--- src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-11-24 12:22:14 +0000
@@ -143,7 +143,6 @@
143 width: parent.width143 width: parent.width
144 height: parent.height144 height: parent.height
145 activeFocusOnPress: true145 activeFocusOnPress: true
146 theme.version: Ubuntu.toolkitVersion
147 styleName: "DialerHandStyle"146 styleName: "DialerHandStyle"
148147
149 /*! \internal */148 /*! \internal */
150149
=== modified file 'src/Ubuntu/Components/Pickers/1.3/Picker.qml'
--- src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-09-24 20:05:52 +0000
+++ src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-11-24 12:22:14 +0000
@@ -165,7 +165,6 @@
165165
166 activeFocusOnPress: true166 activeFocusOnPress: true
167167
168 theme.version: Ubuntu.toolkitVersion
169 styleName: "PickerStyle"168 styleName: "PickerStyle"
170169
171 /*! \internal */170 /*! \internal */
172171
=== modified file 'src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml'
--- src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-09-24 20:05:52 +0000
+++ src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-11-24 12:22:14 +0000
@@ -45,7 +45,6 @@
45 internal.itemList.currentIndex = index;45 internal.itemList.currentIndex = index;
46 }46 }
4747
48 theme.version: Ubuntu.toolkitVersion
49 styleName: "PickerDelegateStyle"48 styleName: "PickerDelegateStyle"
5049
51 QtObject {50 QtObject {
5251
=== modified file 'src/Ubuntu/Components/Popups/1.3/Dialog.qml'
--- src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-09-21 14:44:13 +0000
+++ src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-11-24 12:22:14 +0000
@@ -213,7 +213,6 @@
213 }213 }
214 }214 }
215215
216 theme.version: Ubuntu.toolkitVersion
217 styleName: "DialogForegroundStyle"216 styleName: "DialogForegroundStyle"
218 }217 }
219}218}
220219
=== modified file 'src/Ubuntu/Components/Popups/1.3/Popover.qml'
--- src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-08-12 19:53:20 +0000
+++ src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-11-24 12:22:14 +0000
@@ -241,7 +241,6 @@
241 signal showCompleted()241 signal showCompleted()
242 signal hideCompleted()242 signal hideCompleted()
243243
244 theme.version: Ubuntu.toolkitVersion
245 styleName: "PopoverForegroundStyle"244 styleName: "PopoverForegroundStyle"
246 }245 }
247246
248247
=== modified file 'src/Ubuntu/Components/Popups/1.3/SheetBase.qml'
--- src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-11-24 12:22:14 +0000
@@ -109,7 +109,6 @@
109 }109 }
110 }110 }
111111
112 theme.version: Ubuntu.toolkitVersion
113 styleName: "SheetForegroundStyle"112 styleName: "SheetForegroundStyle"
114 }113 }
115}114}
116115
=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
--- src/Ubuntu/Components/Styles/Styles.pro 2015-10-08 21:19:56 +0000
+++ src/Ubuntu/Components/Styles/Styles.pro 2015-11-24 12:22:14 +0000
@@ -13,7 +13,3 @@
13load(ubuntu_qml_module)13load(ubuntu_qml_module)
1414
15OTHER_FILES+=qmldir15OTHER_FILES+=qmldir
16
17
18
19
2016
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-04-24 14:52:19 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-11-24 12:22:14 +0000
@@ -20,6 +20,7 @@
2020
21Item {21Item {
22 id: ambianceStyle22 id: ambianceStyle
23 objectName: "OptionSelector12"
2324
24 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")25 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
25 property url tick: Qt.resolvedUrl("../artwork/tick.png")26 property url tick: Qt.resolvedUrl("../artwork/tick.png")
2627
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/ScrollbarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.2/ScrollbarStyle.qml 2015-04-24 14:52:19 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.2/ScrollbarStyle.qml 2015-11-24 12:22:14 +0000
@@ -85,7 +85,7 @@
85 property Flickable flickableItem: styledItem.flickableItem85 property Flickable flickableItem: styledItem.flickableItem
86 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.086 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.0
87 && contentSize > 0.0 && contentSize > pageSize87 && contentSize > 0.0 && contentSize > pageSize
88 property bool isVertical: ScrollbarUtils.isVertical(styledItem)88 property bool isVertical: (styledItem.align === Qt.AlignLeading) || (styledItem.align === Qt.AlignTrailing)
89 property bool frontAligned: (styledItem.align === Qt.AlignLeading)89 property bool frontAligned: (styledItem.align === Qt.AlignLeading)
90 property bool rearAligned: (styledItem.align === Qt.AlignTrailing)90 property bool rearAligned: (styledItem.align === Qt.AlignTrailing)
91 property bool topAligned: (styledItem.align === Qt.AlignTop)91 property bool topAligned: (styledItem.align === Qt.AlignTop)
@@ -94,6 +94,83 @@
94 property real pageSize: (isVertical) ? styledItem.height : styledItem.width94 property real pageSize: (isVertical) ? styledItem.height : styledItem.width
95 property real contentSize: (isVertical) ? styledItem.flickableItem.contentHeight : styledItem.flickableItem.contentWidth95 property real contentSize: (isVertical) ? styledItem.flickableItem.contentHeight : styledItem.flickableItem.contentWidth
9696
97 /*!
98 \internal
99 Object storing property names used in calculations.
100 */
101 QtObject {
102 id: scrollbarUtils
103
104 property string propOrigin: (isVertical) ? "originY" : "originX"
105 property string propContent: (isVertical) ? "contentY" : "contentX"
106 property string propPosRatio: (isVertical) ? "yPosition" : "xPosition"
107 property string propSizeRatio: (isVertical) ? "heightRatio" : "widthRatio"
108 property string propCoordinate: (isVertical) ? "y" : "x"
109 property string propSize: (isVertical) ? "height" : "width"
110
111 /*!
112 \internal
113 Calculates the slider position based on the visible area's ratios.
114 */
115 function sliderPos(min, max) {
116 return MathUtils.clamp(styledItem.flickableItem.visibleArea[propPosRatio] * styledItem.flickableItem[propSize], min, max);
117 }
118
119 /*!
120 \internal
121 Calculates the slider size for ListViews based on the visible area's position
122 and size ratios, clamping it between min and max.
123
124 The function can be used in Scrollbar styles to calculate the size of the slider.
125 */
126 function sliderSize(min, max) {
127 var sizeRatio = styledItem.flickableItem.visibleArea[propSizeRatio];
128 var posRatio = styledItem.flickableItem.visibleArea[propPosRatio];
129 var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
130 var startPos = posRatio * (max - sizeUnderflow)
131 var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
132 var overshootStart = startPos < 0 ? -startPos : 0
133 var overshootEnd = endPos > max ? endPos - max : 0
134
135 // overshoot adjusted start and end
136 var adjustedStartPos = startPos + overshootStart
137 var adjustedEndPos = endPos - overshootStart - overshootEnd
138
139 // final position and size of thumb
140 var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
141 var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
142
143 return result;
144 }
145
146 /*!
147 \internal
148 The function calculates and clamps the position to be scrolled to the minimum
149 and maximum values.
150
151 The scroll and drag functions require a slider that does not have any minimum
152 size set (meaning the minimum is set to 0.0). Implementations should consider
153 using an invisible cursor to drag the slider and the ListView position.
154 */
155 function scrollAndClamp(amount, min, max) {
156 return styledItem.flickableItem[propOrigin] +
157 MathUtils.clamp(styledItem.flickableItem[propContent] - styledItem.flickableItem[propOrigin] + amount,
158 min, max);
159 }
160
161 /*!
162 \internal
163 The function calculates the new position of the dragged slider. The amount is
164 relative to the contentSize, which is either the flickable's contentHeight or
165 contentWidth or other calculated value, depending on its orientation. The pageSize
166 specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
167 */
168 function dragAndClamp(cursor, contentSize, pageSize) {
169 styledItem.flickableItem[propContent] =
170 styledItem.flickableItem[propOrigin] + cursor[propCoordinate] * contentSize / pageSize;
171 }
172 }
173
97 /*****************************************174 /*****************************************
98 Visuals175 Visuals
99 *****************************************/176 *****************************************/
@@ -231,13 +308,13 @@
231 // total size of the flickable.308 // total size of the flickable.
232 Item {309 Item {
233 id: scrollCursor310 id: scrollCursor
234 x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)311 x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)
235 y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)312 y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)
236 width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)313 width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)
237 height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)314 height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)
238315
239 function drag() {316 function drag() {
240 ScrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);317 scrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);
241 }318 }
242 }319 }
243320
@@ -253,10 +330,10 @@
253 bottom: (!isVertical) ? scrollbarArea.bottom : undefined330 bottom: (!isVertical) ? scrollbarArea.bottom : undefined
254 }331 }
255332
256 x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)333 x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)
257 y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)334 y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)
258 width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)335 width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)
259 height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)336 height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)
260 radius: visuals.sliderRadius337 radius: visuals.sliderRadius
261338
262 Behavior on width {339 Behavior on width {
@@ -275,7 +352,7 @@
275 }352 }
276353
277 function scroll(amount) {354 function scroll(amount) {
278 scrollAnimation.to = ScrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);355 scrollAnimation.to = scrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);
279 scrollAnimation.restart();356 scrollAnimation.restart();
280 }357 }
281 }358 }
282359
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-10-15 14:17:25 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-11-24 12:22:14 +0000
@@ -34,7 +34,7 @@
34 */34 */
35 defaultDelegate: AbstractButton {35 defaultDelegate: AbstractButton {
36 style: IconButtonStyle { }36 style: IconButtonStyle { }
37 objectName: action.objectName + "_action_button"37 objectName: action.objectName + "_button"
38 height: parent ? parent.height : undefined38 height: parent ? parent.height : undefined
39 action: modelData39 action: modelData
40 }40 }
@@ -88,7 +88,7 @@
88 iconSource: actionBarStyle.overflowIconSource88 iconSource: actionBarStyle.overflowIconSource
89 iconName: actionBarStyle.overflowIconName89 iconName: actionBarStyle.overflowIconName
90 text: actionBarStyle.overflowText90 text: actionBarStyle.overflowText
91 objectName: "overflow"91 objectName: "overflow_action"
92 visible: numberOfSlots.requested > numberOfSlots.available92 visible: numberOfSlots.requested > numberOfSlots.available
93 onTriggered: {93 onTriggered: {
94 var overflowButton = actionsRepeater.itemAt(actionsRepeater.count - 1);94 var overflowButton = actionsRepeater.itemAt(actionsRepeater.count - 1);
9595
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml 2015-04-25 07:36:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActivityIndicatorStyle.qml 2015-11-24 12:22:14 +0000
@@ -22,7 +22,7 @@
2222
23 anchors.fill: parent23 anchors.fill: parent
24 smooth: true24 smooth: true
25 visible: styledItem.running25 visible: styledItem.running && styledItem.visible
26 fillMode: Image.PreserveAspectFit26 fillMode: Image.PreserveAspectFit
27 horizontalAlignment: Image.AlignHCenter27 horizontalAlignment: Image.AlignHCenter
28 verticalAlignment: Image.AlignVCenter28 verticalAlignment: Image.AlignVCenter
2929
=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 2015-11-24 12:22:14 +0000
@@ -0,0 +1,149 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 1.3
20
21Item {
22 id: bottomEdgeHintStyle
23 implicitWidth: styledItem.parent.width
24 implicitHeight: units.gu(4)
25
26 readonly property BottomEdgeHint hint: styledItem
27
28 // translate hint status into state
29 state: {
30 switch (hint.status) {
31 case BottomEdgeHint.Hidden: return "Hidden";
32 case BottomEdgeHint.Inactive: return "Inactive"
33 case BottomEdgeHint.Active: return "Active"
34 case BottomEdgeHint.Locked: return "Locked"
35 }
36 }
37
38 states: [
39 State {
40 name: "Inactive"
41 extend: ""
42 },
43 State {
44 name: "Active"
45 PropertyChanges {
46 target: h1
47 anchors.verticalCenterOffset: styledItem.height / 2
48 }
49 PropertyChanges {
50 target: h2
51 anchors.topMargin: 0
52 }
53 },
54 State {
55 name: "Hidden"
56 PropertyChanges {
57 target: styledItem
58 opacity: 0.0
59 }
60 },
61 State {
62 name: "Locked"
63 PropertyChanges {
64 target: h1
65 anchors.verticalCenterOffset: styledItem.height / 2
66 }
67 PropertyChanges {
68 target: h2
69 anchors.topMargin: 0
70 }
71 }
72 ]
73 transitions: [
74 Transition {
75 from: "*"
76 to: "Active"
77 reversible: true
78 UbuntuNumberAnimation {
79 targets: [h1, h2]
80 properties: "anchors.verticalCenterOffset, anchors.topMargin"
81 }
82 },
83 Transition {
84 from: "*"
85 to: "Hidden"
86 reversible: true
87 UbuntuNumberAnimation {
88 target: styledItem
89 property: "opacity"
90 duration: UbuntuAnimation.SlowDuration
91 }
92 }
93 ]
94
95 clip: true
96
97 Icon {
98 id: h1
99 width: units.gu(2)
100 height: width
101 anchors {
102 centerIn: parent
103 topMargin: styledItem.height
104 }
105 name: "up"
106 }
107
108 Rectangle {
109 id: h2
110 anchors {
111 top: parent.top
112 left: parent.left
113 right: parent.right
114 topMargin: styledItem.height
115 }
116 height: styledItem.height
117 color: theme.palette.normal.overlay
118 ThinDivider {
119 anchors.top: parent.top
120 }
121
122 Row {
123 anchors {
124 top: parent.top
125 bottom: parent.bottom
126 horizontalCenter: parent.horizontalCenter
127 }
128 spacing: units.gu(1)
129 Icon {
130 id: icon
131 name: styledItem.iconName
132 source: styledItem.iconSource
133 width: height
134 height: units.gu(2)
135 anchors.verticalCenter: parent.verticalCenter
136 color: theme.palette.normal.overlayText
137 }
138 Label {
139 id: label
140 text: styledItem.text
141 textSize: Label.Medium
142 color: theme.palette.normal.overlayText
143 height: styledItem.height
144 anchors.verticalCenter: parent.verticalCenter
145 verticalAlignment: Text.AlignVCenter
146 }
147 }
148 }
149}
0150
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-07-22 13:14:43 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-11-24 12:22:14 +0000
@@ -20,6 +20,7 @@
2020
21Item {21Item {
22 id: ambianceStyle22 id: ambianceStyle
23 objectName: "OptionSelector13"
2324
24 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")25 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
25 property url tick: Qt.resolvedUrl("../artwork/tick.png")26 property url tick: Qt.resolvedUrl("../artwork/tick.png")
2627
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2015-11-02 15:27:14 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2015-11-24 12:22:14 +0000
@@ -405,6 +405,16 @@
405405
406 actions: headerStyle.config.actions406 actions: headerStyle.config.actions
407 numberOfSlots: 3407 numberOfSlots: 3
408
409 delegate: AbstractButton {
410 style: IconButtonStyle { }
411 objectName: action.objectName + "_button"
412 height: parent ? parent.height : undefined
413 action: modelData
414 StyleHints {
415 foregroundColor: headerStyle.buttonColor
416 }
417 }
408 }418 }
409 }419 }
410}420}
411421
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-10-13 21:55:11 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-11-24 12:22:14 +0000
@@ -21,7 +21,7 @@
21 id: pageHeaderStyle21 id: pageHeaderStyle
2222
23 foregroundColor: theme.palette.selected.backgroundText23 foregroundColor: theme.palette.selected.backgroundText
24 backgroundColor: "white"24 backgroundColor: theme.palette.normal.background
25 dividerColor: Qt.rgba(0, 0, 0, 0.1)25 dividerColor: Qt.rgba(0, 0, 0, 0.1)
26 property int fontWeight: Font.Light26 property int fontWeight: Font.Light
27 property int textSize: Label.Large27 property int textSize: Label.Large
@@ -31,7 +31,7 @@
3131
32 defaultActionDelegate: AbstractButton {32 defaultActionDelegate: AbstractButton {
33 style: IconButtonStyle { }33 style: IconButtonStyle { }
34 objectName: action.objectName + "_action_button"34 objectName: action.objectName + "_button"
35 height: parent ? parent.height : undefined35 height: parent ? parent.height : undefined
36 action: modelData36 action: modelData
37 StyleHints {37 StyleHints {
3838
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2015-06-02 15:24:54 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2015-11-24 12:22:14 +0000
@@ -85,7 +85,7 @@
85 property Flickable flickableItem: styledItem.flickableItem85 property Flickable flickableItem: styledItem.flickableItem
86 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.086 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.0
87 && contentSize > 0.0 && contentSize > pageSize87 && contentSize > 0.0 && contentSize > pageSize
88 property bool isVertical: ScrollbarUtils.isVertical(styledItem)88 property bool isVertical: (styledItem.align === Qt.AlignLeading) || (styledItem.align === Qt.AlignTrailing)
89 property bool frontAligned: (styledItem.align === Qt.AlignLeading)89 property bool frontAligned: (styledItem.align === Qt.AlignLeading)
90 property bool rearAligned: (styledItem.align === Qt.AlignTrailing)90 property bool rearAligned: (styledItem.align === Qt.AlignTrailing)
91 property bool topAligned: (styledItem.align === Qt.AlignTop)91 property bool topAligned: (styledItem.align === Qt.AlignTop)
@@ -94,6 +94,83 @@
94 property real pageSize: (isVertical) ? styledItem.height : styledItem.width94 property real pageSize: (isVertical) ? styledItem.height : styledItem.width
95 property real contentSize: (isVertical) ? styledItem.flickableItem.contentHeight : styledItem.flickableItem.contentWidth95 property real contentSize: (isVertical) ? styledItem.flickableItem.contentHeight : styledItem.flickableItem.contentWidth
9696
97 /*!
98 \internal
99 Object storing property names used in calculations.
100 */
101 QtObject {
102 id: scrollbarUtils
103
104 property string propOrigin: (isVertical) ? "originY" : "originX"
105 property string propContent: (isVertical) ? "contentY" : "contentX"
106 property string propPosRatio: (isVertical) ? "yPosition" : "xPosition"
107 property string propSizeRatio: (isVertical) ? "heightRatio" : "widthRatio"
108 property string propCoordinate: (isVertical) ? "y" : "x"
109 property string propSize: (isVertical) ? "height" : "width"
110
111 /*!
112 \internal
113 Calculates the slider position based on the visible area's ratios.
114 */
115 function sliderPos(min, max) {
116 return MathUtils.clamp(styledItem.flickableItem.visibleArea[propPosRatio] * styledItem.flickableItem[propSize], min, max);
117 }
118
119 /*!
120 \internal
121 Calculates the slider size for ListViews based on the visible area's position
122 and size ratios, clamping it between min and max.
123
124 The function can be used in Scrollbar styles to calculate the size of the slider.
125 */
126 function sliderSize(min, max) {
127 var sizeRatio = styledItem.flickableItem.visibleArea[propSizeRatio];
128 var posRatio = styledItem.flickableItem.visibleArea[propPosRatio];
129 var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
130 var startPos = posRatio * (max - sizeUnderflow)
131 var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
132 var overshootStart = startPos < 0 ? -startPos : 0
133 var overshootEnd = endPos > max ? endPos - max : 0
134
135 // overshoot adjusted start and end
136 var adjustedStartPos = startPos + overshootStart
137 var adjustedEndPos = endPos - overshootStart - overshootEnd
138
139 // final position and size of thumb
140 var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
141 var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
142
143 return result;
144 }
145
146 /*!
147 \internal
148 The function calculates and clamps the position to be scrolled to the minimum
149 and maximum values.
150
151 The scroll and drag functions require a slider that does not have any minimum
152 size set (meaning the minimum is set to 0.0). Implementations should consider
153 using an invisible cursor to drag the slider and the ListView position.
154 */
155 function scrollAndClamp(amount, min, max) {
156 return styledItem.flickableItem[propOrigin] +
157 MathUtils.clamp(styledItem.flickableItem[propContent] - styledItem.flickableItem[propOrigin] + amount,
158 min, max);
159 }
160
161 /*!
162 \internal
163 The function calculates the new position of the dragged slider. The amount is
164 relative to the contentSize, which is either the flickable's contentHeight or
165 contentWidth or other calculated value, depending on its orientation. The pageSize
166 specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
167 */
168 function dragAndClamp(cursor, contentSize, pageSize) {
169 styledItem.flickableItem[propContent] =
170 styledItem.flickableItem[propOrigin] + cursor[propCoordinate] * contentSize / pageSize;
171 }
172 }
173
97 /*****************************************174 /*****************************************
98 Visuals175 Visuals
99 *****************************************/176 *****************************************/
@@ -231,13 +308,13 @@
231 // total size of the flickable.308 // total size of the flickable.
232 Item {309 Item {
233 id: scrollCursor310 id: scrollCursor
234 x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)311 x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - scrollCursor.width)
235 y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)312 y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - scrollCursor.height)
236 width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)313 width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.width)
237 height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)314 height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, 0.0, flickableItem.height)
238315
239 function drag() {316 function drag() {
240 ScrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);317 scrollbarUtils.dragAndClamp(styledItem, scrollCursor, contentSize, pageSize);
241 }318 }
242 }319 }
243320
@@ -253,10 +330,10 @@
253 bottom: (!isVertical) ? scrollbarArea.bottom : undefined330 bottom: (!isVertical) ? scrollbarArea.bottom : undefined
254 }331 }
255332
256 x: (isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)333 x: (isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.width - slider.width)
257 y: (!isVertical) ? 0 : ScrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)334 y: (!isVertical) ? 0 : scrollbarUtils.sliderPos(styledItem, 0.0, styledItem.height - slider.height)
258 width: (isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)335 width: (isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.width)
259 height: (!isVertical) ? scrollbarArea.thickness : ScrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)336 height: (!isVertical) ? scrollbarArea.thickness : scrollbarUtils.sliderSize(styledItem, minimumSliderSize, flickableItem.height)
260 radius: visuals.sliderRadius337 radius: visuals.sliderRadius
261338
262 Behavior on width {339 Behavior on width {
@@ -275,7 +352,7 @@
275 }352 }
276353
277 function scroll(amount) {354 function scroll(amount) {
278 scrollAnimation.to = ScrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);355 scrollAnimation.to = scrollbarUtils.scrollAndClamp(styledItem, amount, 0.0, contentSize - pageSize);
279 scrollAnimation.restart();356 scrollAnimation.restart();
280 }357 }
281 }358 }
282359
=== removed file 'src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js 2015-07-23 22:12:36 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/scrollbarUtils.js 1970-01-01 00:00:00 +0000
@@ -1,139 +0,0 @@
1/*
2 * Copyright 2012-2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype scrollbarUtils
19 \inqmlmodule Ubuntu.Components 1.3
20 \ingroup ubuntu
21 \brief Various scrolling utility functions.
22 */
23
24.pragma library
25
26Qt.include("mathUtils.js")
27
28/*
29 Object storing property names used in calculations.
30 */
31var _obj = {
32 scrollbar: null,
33 vertical: false,
34 propOrigin: "",
35 propContent: "",
36 propPosRatio: "",
37 propSizeRatio: "",
38 propCoordinate: "",
39 propSize: "",
40 refresh: function () {
41 _obj.vertical = (_obj.scrollbar.align === Qt.AlignLeading) || (_obj.scrollbar.align === Qt.AlignTrailing)
42 _obj.propOrigin = (_obj.vertical) ? "originY" : "originX";
43 _obj.propContent = (_obj.vertical) ? "contentY" : "contentX";
44 _obj.propPosRatio = (_obj.vertical) ? "yPosition" : "xPosition";
45 _obj.propSizeRatio = (_obj.vertical) ? "heightRatio" : "widthRatio";
46 _obj.propCoordinate = (_obj.vertical) ? "y" : "x";
47 _obj.propSize = (_obj.vertical) ? "height" : "width";
48 }
49}
50
51/*
52 Checks whether the _obj is valid or not. Must be called in every function
53 as those can be invoked prior to the host (style) component completion.
54 */
55function __check(sb) {
56 if (sb !== null && (_obj.scrollbar !== sb)) {
57 _obj.scrollbar = sb;
58 sb.flickableItemChanged.connect(_obj.refresh);
59 sb.alignChanged.connect(_obj.refresh);
60 _obj.refresh();
61 }
62
63 return _obj.scrollbar;
64}
65
66/*!
67 \qmlmethod scrollbarUtils::isVertical(scrollbar)
68 Returns whether the scrollbar is vertical or horizontal.
69 */
70function isVertical(scrollbar) {
71 if (!__check(scrollbar)) return 0;
72 return _obj.vertical;
73}
74
75/*!
76 \qmlmethod scrollbarUtils::sliderPos(scrollbar, min, max)
77 Calculates the slider position based on the visible area's ratios.
78 */
79function sliderPos(scrollbar, min, max) {
80 if (!__check(scrollbar)) return 0;
81 return clamp(scrollbar.flickableItem.visibleArea[_obj.propPosRatio] * scrollbar.flickableItem[_obj.propSize], min, max);
82}
83
84/*!
85 \qmlmethod scrollbarUtils::sliderSize(scrollbar, min, max)
86 Calculates the slider size for ListViews based on the visible area's position
87 and size ratios, clamping it between min and max.
88
89 The function can be used in Scrollbar styles to calculate the size of the slider.
90 */
91function sliderSize(scrollbar, min, max) {
92 if (!__check(scrollbar)) return 0;
93 var sizeRatio = scrollbar.flickableItem.visibleArea[_obj.propSizeRatio];
94 var posRatio = scrollbar.flickableItem.visibleArea[_obj.propPosRatio];
95 var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
96 var startPos = posRatio * (max - sizeUnderflow)
97 var endPos = (posRatio + sizeRatio) * (max - sizeUnderflow) + sizeUnderflow
98 var overshootStart = startPos < 0 ? -startPos : 0
99 var overshootEnd = endPos > max ? endPos - max : 0
100
101 // overshoot adjusted start and end
102 var adjustedStartPos = startPos + overshootStart
103 var adjustedEndPos = endPos - overshootStart - overshootEnd
104
105 // final position and size of thumb
106 var position = adjustedStartPos + min > max ? max - min : adjustedStartPos
107 var result = (adjustedEndPos - position) < min ? min : (adjustedEndPos - position)
108
109 return result;
110}
111
112/*!
113 \qmlmethod scrollbarUtils::scrollAndClamp(scrollbar, amount, min, max)
114 The function calculates and clamps the position to be scrolled to the minimum
115 and maximum values.
116
117 The scroll and drag functions require a slider that does not have any minimum
118 size set (meaning the minimum is set to 0.0). Implementations should consider
119 using an invisible cursor to drag the slider and the ListView position.
120 */
121function scrollAndClamp(scrollbar, amount, min, max) {
122 if (!__check(scrollbar)) return 0;
123 return scrollbar.flickableItem[_obj.propOrigin] +
124 clamp(scrollbar.flickableItem[_obj.propContent] - scrollbar.flickableItem[_obj.propOrigin] + amount,
125 min, max);
126}
127
128/*!
129 \qmlmethod scrollbarUtils::dragAndClamp(scrollbar, cursor, contentSize, pageSize)
130 The function calculates the new position of the dragged slider. The amount is
131 relative to the contentSize, which is either the flickable's contentHeight or
132 contentWidth or other calculated value, depending on its orientation. The pageSize
133 specifies the visibleArea, and it is usually the heigtht/width of the scrolling area.
134 */
135function dragAndClamp(scrollbar, cursor, contentSize, pageSize) {
136 if (!__check(scrollbar)) return 0;
137 scrollbar.flickableItem[_obj.propContent] =
138 scrollbar.flickableItem[_obj.propOrigin] + cursor[_obj.propCoordinate] * contentSize / pageSize;
139}
1400
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-10-02 22:48:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-11-24 12:22:14 +0000
@@ -113,6 +113,9 @@
113 1.3/ToolbarStyle.qml \113 1.3/ToolbarStyle.qml \
114 1.3/IconButtonStyle.qml \114 1.3/IconButtonStyle.qml \
115 1.3/PageHeaderStyle.qml \115 1.3/PageHeaderStyle.qml \
116 1.3/BottomEdgeHintStyle.qml \
116 $$ARTWORK_FILES117 $$ARTWORK_FILES
117118
118load(ubuntu_qml_module)119load(ubuntu_qml_module)
120
121OTHER_FILES+=qmldir
119122
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/qmldir'
--- src/Ubuntu/Components/Themes/Ambiance/qmldir 2015-10-02 22:48:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/qmldir 2015-11-24 12:22:14 +0000
@@ -82,6 +82,5 @@
8282
83ListItemStyle 1.3 ./1.3/ListItemStyle.qml83ListItemStyle 1.3 ./1.3/ListItemStyle.qml
84internal SliderUtils 1.3/sliderUtils.js84internal SliderUtils 1.3/sliderUtils.js
85internal ScrollbarUtils 1.3/scrollbarUtils.js
86internal ColorUtils 1.3/colorUtils.js85internal ColorUtils 1.3/colorUtils.js
87PageHeaderStyle 1.3 ./1.3/PageHeaderStyle.qml86PageHeaderStyle 1.3 ./1.3/PageHeaderStyle.qml
8887
=== added directory 'src/Ubuntu/Components/plugin/gestures'
=== added file 'src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp'
--- src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.cpp 2015-11-24 12:22:14 +0000
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "CandidateInactivityTimer.h"
18
19namespace UbuntuGestures {
20
21CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *candidate,
22 AbstractTimer *timer, QObject *parent)
23 : QObject(parent)
24 , m_timer(timer)
25 , m_touchId(touchId)
26 , m_candidate(candidate)
27{
28 connect(m_timer, &AbstractTimer::timeout,
29 this, &CandidateInactivityTimer::onTimeout);
30 m_timer->setInterval(durationMs);
31 m_timer->setSingleShot(true);
32 m_timer->start();
33}
34
35CandidateInactivityTimer::~CandidateInactivityTimer()
36{
37 delete m_timer;
38}
39
40void CandidateInactivityTimer::onTimeout()
41{
42 qWarning("[TouchRegistry] Candidate for touch %d defaulted!", m_touchId);
43 Q_EMIT candidateDefaulted(m_touchId, m_candidate);
44}
45
46} // namespace UbuntuGestures
047
=== added file 'src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h'
--- src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/CandidateInactivityTimer.h 2015-11-24 12:22:14 +0000
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#ifndef UBUNTUGESTURES_CANDIDATE_INACTIVITY_TIMER_H
19#define UBUNTUGESTURES_CANDIDATE_INACTIVITY_TIMER_H
20
21#include <QtCore/QObject>
22
23class QQuickItem;
24
25#include "Timer.h"
26
27namespace UbuntuGestures {
28
29class UBUNTUGESTURESQML_EXPORT CandidateInactivityTimer : public QObject {
30 Q_OBJECT
31public:
32 CandidateInactivityTimer(int touchId, QQuickItem *candidate,
33 AbstractTimer *timer,
34 QObject *parent = Q_NULLPTR);
35
36 virtual ~CandidateInactivityTimer();
37
38 const int durationMs = 1000;
39
40Q_SIGNALS:
41 void candidateDefaulted(int touchId, QQuickItem *candidate);
42private Q_SLOTS:
43 void onTimeout();
44private:
45 AbstractTimer *m_timer;
46 int m_touchId;
47 QQuickItem *m_candidate;
48};
49
50} // namespace UbuntuGestures
51
52#endif // UBUNTUGESTURES_CANDIDATE_INACTIVITY_TIMER_H
053
=== added file 'src/Ubuntu/Components/plugin/gestures/damper.cpp'
--- src/Ubuntu/Components/plugin/gestures/damper.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/damper.cpp 2015-11-24 12:22:14 +0000
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "Damper.h"
18#include <QDebug>
19
20QDebug operator<<(QDebug dbg, const DampedPointF &p)
21{
22 dbg.nospace() << "(" << p.x() << ", " << p.y() << ")";
23 return dbg.space();
24}
025
=== added file 'src/Ubuntu/Components/plugin/gestures/damper.h'
--- src/Ubuntu/Components/plugin/gestures/damper.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/damper.h 2015-11-24 12:22:14 +0000
@@ -0,0 +1,89 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UBUNTU_GESTURES_DAMPER_H
18#define UBUNTU_GESTURES_DAMPER_H
19
20#include <QtCore/QPointF>
21
22/*
23 Decreases the oscillations of a value along an axis.
24 */
25template <class Type> class Damper {
26public:
27 Damper() : m_value(0), m_maxDelta(0) { }
28
29 // Maximum delta between the raw value and its dampened counterpart.
30 void setMaxDelta(Type maxDelta) {
31 if (maxDelta < 0) qFatal("Damper::maxDelta must be a positive number.");
32 m_maxDelta = maxDelta;
33 }
34 Type maxDelta() const { return m_maxDelta; }
35
36 void reset(Type value) {
37 m_value = value;
38 }
39
40 Type update(Type value) {
41 Type delta = value - m_value;
42 if (delta > 0 && delta > m_maxDelta) {
43 m_value += delta - m_maxDelta;
44 } else if (delta < 0 && delta < -m_maxDelta) {
45 m_value += delta + m_maxDelta;
46 }
47
48 return m_value;
49 }
50
51 Type value() const { return m_value; }
52
53private:
54 Type m_value;
55 Type m_maxDelta;
56};
57
58/*
59 A point that has its movement dampened.
60 */
61class DampedPointF {
62public:
63 void setMaxDelta(qreal maxDelta) {
64 m_x.setMaxDelta(maxDelta);
65 m_y.setMaxDelta(maxDelta);
66 }
67
68 qreal maxDelta() const { return m_x.maxDelta(); }
69
70 void reset(const QPointF &point) {
71 m_x.reset(point.x());
72 m_y.reset(point.y());
73 }
74
75 void update(const QPointF &point) {
76 m_x.update(point.x());
77 m_y.update(point.y());
78 }
79
80 qreal x() const { return m_x.value(); }
81 qreal y() const { return m_y.value(); }
82private:
83 Damper<qreal> m_x;
84 Damper<qreal> m_y;
85};
86
87QDebug operator<<(QDebug dbg, const DampedPointF &p);
88
89#endif // UBUNTU_GESTURES_DAMPER_H
090
=== added file 'src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h'
--- src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/ubuntugesturesqmlglobal.h 2015-11-24 12:22:14 +0000
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#include <QtCore/QtGlobal>
19
20#if defined(UBUNTUGESTURESQML_LIBRARY)
21# define UBUNTUGESTURESQML_EXPORT Q_DECL_EXPORT
22#else
23# define UBUNTUGESTURESQML_EXPORT Q_DECL_IMPORT
24#endif
025
=== added file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp'
--- src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp 2015-11-24 12:22:14 +0000
@@ -0,0 +1,958 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#include "ucswipearea_p.h"
19
20#include <QQuickWindow>
21#include <QtCore/qmath.h>
22#include <QScreen>
23#include <QDebug>
24
25#include <private/qquickwindow_p.h>
26
27// local
28#include <UbuntuGestures/TouchOwnershipEvent>
29#include <UbuntuGestures/TouchRegistry>
30#include <UbuntuGestures/UnownedTouchEvent>
31
32using namespace UbuntuGestures;
33
34Q_LOGGING_CATEGORY(ucSwipeArea, "ubuntu.components.SwipeArea", QtMsgType::QtWarningMsg)
35Q_LOGGING_CATEGORY(ucActiveTouchInfo, "ubuntu.components.SwipeArea.ActiveTouchInfo", QtMsgType::QtWarningMsg)
36
37#define SA_TRACE(params) qCDebug(ucSwipeArea).nospace() << "[SwipeArea(" << qPrintable(objectName()) << ")] " << params
38#define TI_TRACE(params) qCDebug(ucActiveTouchInfo).nospace() << "[ActiveTouchInfo] " << params
39
40namespace {
41const char *statusToString(UCSwipeAreaPrivate::Status status)
42{
43 if (status == UCSwipeAreaPrivate::WaitingForTouch) {
44 return "WaitingForTouch";
45 } else if (status == UCSwipeAreaPrivate::Undecided) {
46 return "Undecided";
47 } else {
48 return "Recognized";
49 }
50}
51
52QString touchPointStateToString(Qt::TouchPointState state)
53{
54 switch (state) {
55 case Qt::TouchPointPressed:
56 return QStringLiteral("pressed");
57 case Qt::TouchPointMoved:
58 return QStringLiteral("moved");
59 case Qt::TouchPointStationary:
60 return QStringLiteral("stationary");
61 case Qt::TouchPointReleased:
62 return QStringLiteral("released");
63 default:
64 return QStringLiteral("INVALID_STATE");
65 }
66}
67
68QString touchEventToString(const QTouchEvent *ev)
69{
70 QString message;
71
72 switch (ev->type()) {
73 case QEvent::TouchBegin:
74 message.append("TouchBegin ");
75 break;
76 case QEvent::TouchUpdate:
77 message.append("TouchUpdate ");
78 break;
79 case QEvent::TouchEnd:
80 message.append("TouchEnd ");
81 break;
82 case QEvent::TouchCancel:
83 message.append("TouchCancel ");
84 break;
85 default:
86 message.append("INVALID_TOUCH_EVENT_TYPE ");
87 }
88
89 Q_FOREACH(const QTouchEvent::TouchPoint& touchPoint, ev->touchPoints()) {
90 message.append(
91 QStringLiteral("(id:%1, state:%2, scenePos:(%3,%4)) ")
92 .arg(touchPoint.id())
93 .arg(touchPointStateToString(touchPoint.state()))
94 .arg(touchPoint.scenePos().x())
95 .arg(touchPoint.scenePos().y())
96 );
97 }
98
99 return message;
100}
101
102} // namespace {
103
104class Direction
105{
106public:
107 static bool isHorizontal(UCSwipeArea::Direction type)
108 {
109 return type == UCSwipeArea::Leftwards
110 || type == UCSwipeArea::Rightwards
111 || type == UCSwipeArea::Horizontal;
112 }
113
114 static bool isVertical(UCSwipeArea::Direction type)
115 {
116 return type == UCSwipeArea::Upwards
117 || type == UCSwipeArea::Downwards
118 || type == UCSwipeArea::Vertical;
119 }
120
121 static bool isPositive(UCSwipeArea::Direction type)
122 {
123 return type == UCSwipeArea::Rightwards
124 || type == UCSwipeArea::Downwards
125 || type == UCSwipeArea::Horizontal
126 || type == UCSwipeArea::Vertical;
127 }
128};
129/*!
130 * \qmltype SwipeArea
131 * \instantiates UCSwipeArea
132 * \inherits Item
133 * \inqmlmodule Ubuntu.Components 1.3
134 * \since Ubuntu.Components 1.3
135 * \ingroup ubuntu-gestures
136 * \brief An area which detects axis-aligned single-finger drag gestures.
137 *
138 * The component can be used to detect gestures of a certain direction, and can
139 * grab gestures started on a component placed behind of the SwipeArea.
140 * The gesture is detected on the SwipeArea, therefore the size must be
141 * chosen carefully so it can properly detect the gesture.
142 *
143 * The gesture direction is specified by the \l direction property. The recognized
144 * and captured gesture is reported through the \l dragging property, which becomes
145 * \c true when the gesture is detected. If there was a component under the
146 * SwipeArea, the gesture will be cancelled on that component.
147 *
148 * The drag recognition is performed within the component area in the specified
149 * direction. If the drag deviates too much from this, recognition will fail,
150 * as well as if the drag or the flick is too short. Once the drag is
151 * intercepted, the gesture will be followed even after it leaves the detection area.
152 *
153 * Example:
154 * \qml
155 * import QtQuick 2.4
156 * import Ubuntu.Components 1.3
157 *
158 * MainView {
159 * width: units.gu(40)
160 * height: units.gu(70)
161 *
162 * Page {
163 * title: "SwipeArea sample"
164 * SwipeArea {
165 * anchors {
166 * left: parent.left
167 * right: parent.right
168 * bottom: parent.bottom
169 * }
170 * height: units.gu(5)
171 * direction: SwipeArea.Upwards
172 * Label {
173 * text: "Drag upwards"
174 * anchors {
175 * centerIn: parent
176 * verticalOffset: parent.dragging ? parent.distance : 0
177 * }
178 * }
179 * }
180 * }
181 * }
182 * \endqml
183 * \note When used with a Flickable (or ListView, GridView) always put the
184 * SwipeArea next to the Flickable as sibling.
185 */
186UCSwipeArea::UCSwipeArea(QQuickItem *parent)
187 : QQuickItem(parent)
188 , d(new UCSwipeAreaPrivate(this))
189{
190 d->setRecognitionTimer(new Timer(this));
191 d->recognitionTimer->setInterval(d->maxTime);
192 d->recognitionTimer->setSingleShot(true);
193
194 connect(this, &QQuickItem::enabledChanged, d, &UCSwipeAreaPrivate::giveUpIfDisabledOrInvisible);
195 connect(this, &QQuickItem::visibleChanged, d, &UCSwipeAreaPrivate::giveUpIfDisabledOrInvisible);
196}
197
198/*!
199 * \qmlproperty enum SwipeArea::direction
200 * The direction in which the gesture should move in order to be recognized.
201 * \table
202 * \header
203 * \li Direction
204 * \li Description
205 * \row
206 * \li Rightwards
207 * \li Along the positive direction of the X axis
208 * \row
209 * \li Leftwards
210 * \li Along the negative direction of the X axis
211 * \row
212 * \li Downwards
213 * \li Along the positive direction of the Y axis
214 * \row
215 * \li Upwards
216 * \li Along the negative direction of the Y axis
217 * \row
218 * \li Horizontal
219 * \li Along the X axis, in any direction
220 * \row
221 * \li Vertical
222 * \li Along the Y axis, in any direction
223 * \endtable
224 */
225UCSwipeArea::Direction UCSwipeArea::direction() const
226{
227 return d->direction;
228}
229
230void UCSwipeArea::setDirection(Direction direction)
231{
232 if (direction != d->direction) {
233 d->direction = direction;
234 Q_EMIT directionChanged(d->direction);
235 }
236}
237
238void UCSwipeAreaPrivate::setDistanceThreshold(qreal value)
239{
240 if (distanceThreshold != value) {
241 distanceThreshold = value;
242 distanceThresholdSquared = distanceThreshold * distanceThreshold;
243 }
244}
245
246void UCSwipeAreaPrivate::setMaxTime(int value)
247{
248 if (maxTime != value) {
249 maxTime = value;
250 recognitionTimer->setInterval(maxTime);
251 }
252}
253
254void UCSwipeAreaPrivate::setRecognitionTimer(UbuntuGestures::AbstractTimer *timer)
255{
256 int interval = 0;
257 bool timerWasRunning = false;
258 bool wasSingleShot = false;
259
260 // can be null when called from the constructor
261 if (recognitionTimer) {
262 wasSingleShot = recognitionTimer->isSingleShot();
263 interval = recognitionTimer->interval();
264 timerWasRunning = recognitionTimer->isRunning();
265 if (recognitionTimer->parent() == this) {
266 delete recognitionTimer;
267 }
268 }
269
270 recognitionTimer = timer;
271 timer->setInterval(interval);
272 timer->setSingleShot(wasSingleShot);
273 connect(timer, &UbuntuGestures::AbstractTimer::timeout,
274 this, &UCSwipeAreaPrivate::rejectGesture);
275 if (timerWasRunning) {
276 recognitionTimer->start();
277 }
278}
279
280void UCSwipeAreaPrivate::setTimeSource(const SharedTimeSource &timeSource)
281{
282 this->timeSource = timeSource;
283 activeTouches.m_timeSource = timeSource;
284}
285
286/*!
287 * \qmlproperty real SwipeArea::distance
288 * \readonly
289 * The property holds the distance of the swipe from the beginning of the gesture
290 * recognition to the current touch position.
291 */
292qreal UCSwipeArea::distance() const
293{
294 return d->sceneDistance;
295}
296
297/*!
298 * \qmlproperty point SwipeArea::touchPosition
299 * \readonly
300 * Position of the touch point performing the drag relative to this item.
301 */
302QPointF UCSwipeArea::touchPosition() const
303{
304 return mapFromScene(d->publicScenePos);
305}
306
307/*!
308 * \qmlproperty bool SwipeArea::dragging
309 * \readonly
310 * Reports whether a drag gesture is taking place.
311 */
312bool UCSwipeArea::dragging() const
313{
314 return d->status == UCSwipeAreaPrivate::Recognized;
315}
316
317/*!
318 * \qmlproperty bool SwipeArea::pressed
319 * \readonly
320 * Reports whether the drag area is pressed.
321 */
322bool UCSwipeArea::pressed() const
323{
324 return d->status != UCSwipeAreaPrivate::WaitingForTouch;
325}
326
327/*!
328 * \qmlproperty bool SwipeArea::immediateRecognition
329 * Drives whether the gesture should be recognized as soon as the touch lands on
330 * the area. With this property set it will work the same way as a MultiPointTouchArea,
331 *
332 * Defaults to false. In most cases this should not be set.
333 */
334bool UCSwipeArea::immediateRecognition() const
335{
336 return d->immediateRecognition;
337}
338
339void UCSwipeArea::setImmediateRecognition(bool enabled)
340{
341 if (d->immediateRecognition != enabled) {
342 d->immediateRecognition = enabled;
343 Q_EMIT immediateRecognitionChanged(enabled);
344 }
345}
346
347bool UCSwipeArea::event(QEvent *event)
348{
349 if (event->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
350 d->touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(event));
351 return true;
352 } else if (event->type() == UnownedTouchEvent::unownedTouchEventType()) {
353 d->unownedTouchEvent(static_cast<UnownedTouchEvent *>(event));
354 return true;
355 } else {
356 return QQuickItem::event(event);
357 }
358}
359
360void UCSwipeAreaPrivate::touchOwnershipEvent(TouchOwnershipEvent *event)
361{
362 if (event->gained()) {
363 QVector<int> ids;
364 ids.append(event->touchId());
365 SA_TRACE("grabbing touch");
366 q->grabTouchPoints(ids);
367 } else {
368 // We still wanna know when it ends for keeping the composition time window up-to-date
369 TouchRegistry::instance()->addTouchWatcher(touchId, q);
370
371 setStatus(WaitingForTouch);
372 }
373}
374
375void UCSwipeAreaPrivate::unownedTouchEvent(UnownedTouchEvent *unownedTouchEvent)
376{
377 QTouchEvent *event = unownedTouchEvent->touchEvent();
378
379 Q_ASSERT(!event->touchPointStates().testFlag(Qt::TouchPointPressed));
380
381 SA_TRACE("Unowned " << timeSource->msecsSinceReference() << " " << qPrintable(touchEventToString(event)));
382
383 switch (status) {
384 case WaitingForTouch:
385 // do nothing
386 break;
387 case Undecided:
388 Q_ASSERT(q->isEnabled() && q->isVisible());
389 unownedTouchEvent_undecided(unownedTouchEvent);
390 break;
391 default: // Recognized:
392 // do nothing
393 break;
394 }
395
396 activeTouches.update(event);
397}
398
399void UCSwipeAreaPrivate::unownedTouchEvent_undecided(UnownedTouchEvent *unownedTouchEvent)
400{
401 const QTouchEvent::TouchPoint *touchPoint = fetchTargetTouchPoint(unownedTouchEvent->touchEvent());
402 if (!touchPoint) {
403 qCritical() << "UCSwipeArea[status=Undecided]: touch " << touchId
404 << "missing from UnownedTouchEvent without first reaching state Qt::TouchPointReleased. "
405 "Considering it as released.";
406
407 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
408 setStatus(WaitingForTouch);
409 return;
410 }
411
412 const QPointF &touchScenePosition = touchPoint->scenePos();
413
414 if (touchPoint->state() == Qt::TouchPointReleased) {
415 // touch has ended before recognition concluded
416 SA_TRACE("Touch has ended before recognition concluded");
417 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
418 setStatus(WaitingForTouch);
419 return;
420 }
421
422 previousDampedScenePos.setX(dampedScenePos.x());
423 previousDampedScenePos.setY(dampedScenePos.y());
424 dampedScenePos.update(touchScenePosition);
425
426 if (!movingInRightDirection()) {
427 SA_TRACE("Rejecting gesture because touch point is moving in the wrong direction.");
428 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
429 // We still wanna know when it ends for keeping the composition time window up-to-date
430 TouchRegistry::instance()->addTouchWatcher(touchId, q);
431 setStatus(WaitingForTouch);
432 return;
433 }
434
435 if (isWithinTouchCompositionWindow()) {
436 // There's still time for some new touch to appear and ruin our party as it would be combined
437 // with our touchId one and therefore deny the possibility of a single-finger gesture.
438 SA_TRACE("Sill within composition window. Let's wait more.");
439 return;
440 }
441
442 if (movedFarEnoughAlongGestureAxis()) {
443 TouchRegistry::instance()->requestTouchOwnership(touchId, q);
444 setStatus(Recognized);
445 updatePosition(touchScenePosition);
446 } else if (isPastMaxDistance()) {
447 SA_TRACE("Rejecting gesture because it went farther than maxDistance without getting recognized.");
448 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
449 // We still wanna know when it ends for keeping the composition time window up-to-date
450 TouchRegistry::instance()->addTouchWatcher(touchId, q);
451 setStatus(WaitingForTouch);
452 } else {
453 SA_TRACE("Didn't move far enough yet. Let's wait more.");
454 }
455}
456
457void UCSwipeArea::touchEvent(QTouchEvent *event)
458{
459 // FIXME: Consider when more than one touch starts in the same event (although it's not possible
460 // with Mir's android-input). Have to track them all. Consider it a plus/bonus.
461
462 SA_TRACE(d->timeSource->msecsSinceReference() << " " << qPrintable(touchEventToString(event)));
463
464 if (!isEnabled() || !isVisible()) {
465 QQuickItem::touchEvent(event);
466 return;
467 }
468
469 switch (d->status) {
470 case UCSwipeAreaPrivate::WaitingForTouch:
471 d->touchEvent_absent(event);
472 break;
473 case UCSwipeAreaPrivate::Undecided:
474 d->touchEvent_undecided(event);
475 break;
476 default: // Recognized:
477 d->touchEvent_recognized(event);
478 break;
479 }
480
481 d->activeTouches.update(event);
482}
483
484void UCSwipeAreaPrivate::touchEvent_absent(QTouchEvent *event)
485{
486 // FIXME: accept/reject is for the whole event, not per touch id. See how that affects us.
487
488 if (!event->touchPointStates().testFlag(Qt::TouchPointPressed)) {
489 // Nothing to see here. No touch starting in this event.
490 return;
491 }
492
493 // to be proven wrong, if that's the case
494 bool allGood = true;
495
496 if (isWithinTouchCompositionWindow()) {
497 // too close to the last touch start. So we consider them as starting roughly at the same time.
498 // Can't be a single-touch gesture.
499 SA_TRACE("A new touch point came in but we're still within time composition window. Ignoring it.");
500 allGood = false;
501 }
502
503 const QList<QTouchEvent::TouchPoint> &touchPoints = event->touchPoints();
504
505 const QTouchEvent::TouchPoint *newTouchPoint = nullptr;
506 for (int i = 0; i < touchPoints.count() && allGood; ++i) {
507 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
508 if (touchPoint.state() == Qt::TouchPointPressed) {
509 if (newTouchPoint) {
510 // more than one touch starting in this QTouchEvent. Can't be a single-touch gesture
511 allGood = false;
512 } else {
513 // that's our candidate
514 newTouchPoint = &touchPoint;
515 }
516 }
517 }
518
519 if (allGood) {
520 allGood = sanityCheckRecognitionProperties();
521 if (!allGood) {
522 qWarning("UCSwipeArea: recognition properties are wrongly set. Gesture recognition"
523 " is impossible");
524 }
525 }
526
527 if (allGood) {
528 Q_ASSERT(newTouchPoint);
529
530 startScenePos = newTouchPoint->scenePos();
531 touchId = newTouchPoint->id();
532 dampedScenePos.reset(startScenePos);
533 updatePosition(startScenePos);
534
535 updateSceneDirectionVector();
536
537 if (recognitionIsDisabled()) {
538 // Behave like a dumb TouchArea
539 SA_TRACE("Gesture recognition is disabled. Requesting touch ownership immediately.");
540 TouchRegistry::instance()->requestTouchOwnership(touchId, q);
541 setStatus(Recognized);
542 event->accept();
543 } else {
544 // just monitor the touch points for now.
545 TouchRegistry::instance()->addCandidateOwnerForTouch(touchId, q);
546
547 setStatus(Undecided);
548 // Let the item below have it. We will monitor it and grab it later if a gesture
549 // gets recognized.
550 event->ignore();
551 }
552 } else {
553 watchPressedTouchPoints(touchPoints);
554 event->ignore();
555 }
556}
557
558void UCSwipeAreaPrivate::touchEvent_undecided(QTouchEvent *event)
559{
560 Q_ASSERT(fetchTargetTouchPoint(event) == nullptr);
561
562 // We're not interested in new touch points. We already have our candidate (touchId).
563 // But we do want to know when those new touches end for keeping the composition time
564 // window up-to-date
565 event->ignore();
566 watchPressedTouchPoints(event->touchPoints());
567
568 if (event->touchPointStates().testFlag(Qt::TouchPointPressed) && isWithinTouchCompositionWindow()) {
569 // multi-finger drags are not accepted
570 SA_TRACE("Multi-finger drags are not accepted");
571
572 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
573 // We still wanna know when it ends for keeping the composition time window up-to-date
574 TouchRegistry::instance()->addTouchWatcher(touchId, q);
575
576 setStatus(WaitingForTouch);
577 }
578}
579
580void UCSwipeAreaPrivate::touchEvent_recognized(QTouchEvent *event)
581{
582 const QTouchEvent::TouchPoint *touchPoint = fetchTargetTouchPoint(event);
583
584 if (!touchPoint) {
585 qCritical() << "UCSwipeArea[status=Recognized]: touch " << touchId
586 << "missing from QTouchEvent without first reaching state Qt::TouchPointReleased. "
587 "Considering it as released.";
588 setStatus(WaitingForTouch);
589 } else {
590 updatePosition(touchPoint->scenePos());
591
592 if (touchPoint->state() == Qt::TouchPointReleased) {
593 setStatus(WaitingForTouch);
594 }
595 }
596}
597
598void UCSwipeAreaPrivate::watchPressedTouchPoints(const QList<QTouchEvent::TouchPoint> &touchPoints)
599{
600 for (int i = 0; i < touchPoints.count(); ++i) {
601 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
602 if (touchPoint.state() == Qt::TouchPointPressed) {
603 TouchRegistry::instance()->addTouchWatcher(touchPoint.id(), q);
604 }
605 }
606}
607
608bool UCSwipeAreaPrivate::recognitionIsDisabled() const
609{
610 return immediateRecognition || (distanceThreshold <= 0 && compositionTime <= 0);
611}
612
613bool UCSwipeAreaPrivate::sanityCheckRecognitionProperties()
614{
615 return recognitionIsDisabled()
616 || (distanceThreshold < maxDistance && compositionTime < maxTime);
617}
618
619const QTouchEvent::TouchPoint *UCSwipeAreaPrivate::fetchTargetTouchPoint(QTouchEvent *event)
620{
621 const QList<QTouchEvent::TouchPoint> &touchPoints = event->touchPoints();
622 const QTouchEvent::TouchPoint *touchPoint = 0;
623 for (int i = 0; i < touchPoints.size(); ++i) {
624 if (touchPoints.at(i).id() == touchId) {
625 touchPoint = &touchPoints.at(i);
626 break;
627 }
628 }
629 return touchPoint;
630}
631
632bool UCSwipeAreaPrivate::movingInRightDirection() const
633{
634 if (direction == UCSwipeArea::Horizontal || direction == UCSwipeArea::Vertical) {
635 return true;
636 } else {
637 QPointF movementVector(dampedScenePos.x() - previousDampedScenePos.x(),
638 dampedScenePos.y() - previousDampedScenePos.y());
639
640 qreal scalarProjection = projectOntoDirectionVector(movementVector);
641
642 return scalarProjection >= 0.;
643 }
644}
645
646bool UCSwipeAreaPrivate::movedFarEnoughAlongGestureAxis() const
647{
648 if (distanceThreshold <= 0.) {
649 // distance threshold check is disabled
650 return true;
651 } else {
652 QPointF totalMovement(dampedScenePos.x() - startScenePos.x(),
653 dampedScenePos.y() - startScenePos.y());
654
655 qreal scalarProjection = projectOntoDirectionVector(totalMovement);
656
657 SA_TRACE(" movedFarEnoughAlongGestureAxis: scalarProjection=" << scalarProjection
658 << ", distanceThreshold=" << distanceThreshold);
659
660 if (direction == UCSwipeArea::Horizontal || direction == UCSwipeArea::Vertical) {
661 return qAbs(scalarProjection) > distanceThreshold;
662 } else {
663 return scalarProjection > distanceThreshold;
664 }
665 }
666}
667
668bool UCSwipeAreaPrivate::isPastMaxDistance() const
669{
670 QPointF totalMovement(dampedScenePos.x() - startScenePos.x(),
671 dampedScenePos.y() - startScenePos.y());
672
673 qreal squaredDistance = totalMovement.x()*totalMovement.x() + totalMovement.y()*totalMovement.y();
674 return squaredDistance > maxDistance*maxDistance;
675}
676
677void UCSwipeAreaPrivate::giveUpIfDisabledOrInvisible()
678{
679 if (!q->isEnabled() || !q->isVisible()) {
680 if (status == Undecided) {
681 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
682 // We still wanna know when it ends for keeping the composition time window up-to-date
683 TouchRegistry::instance()->addTouchWatcher(touchId, q);
684 }
685
686 if (status != WaitingForTouch) {
687 SA_TRACE("Resetting status because got disabled or made invisible");
688 setStatus(WaitingForTouch);
689 }
690 }
691}
692
693void UCSwipeAreaPrivate::rejectGesture()
694{
695 if (status == Undecided) {
696 SA_TRACE("Rejecting gesture because it's taking too long to drag beyond the threshold.");
697
698 TouchRegistry::instance()->removeCandidateOwnerForTouch(touchId, q);
699 // We still wanna know when it ends for keeping the composition time window up-to-date
700 TouchRegistry::instance()->addTouchWatcher(touchId, q);
701
702 setStatus(WaitingForTouch);
703 }
704}
705
706void UCSwipeAreaPrivate::setStatus(Status newStatus)
707{
708 if (newStatus == status)
709 return;
710
711 Status oldStatus = status;
712
713 if (oldStatus == Undecided) {
714 recognitionTimer->stop();
715 }
716
717 status = newStatus;
718 Q_EMIT statusChanged(status);
719
720 SA_TRACE(statusToString(oldStatus) << " -> " << statusToString(newStatus));
721
722 switch (newStatus) {
723 case WaitingForTouch:
724 if (oldStatus == Recognized) {
725 Q_EMIT q->draggingChanged(false);
726 }
727 Q_EMIT q->pressedChanged(false);
728 break;
729 case Undecided:
730 recognitionTimer->start();
731 Q_EMIT q->pressedChanged(true);
732 break;
733 case Recognized:
734 Q_EMIT q->draggingChanged(true);
735 break;
736 default:
737 // no-op
738 break;
739 }
740}
741
742void UCSwipeAreaPrivate::updatePosition(const QPointF &point)
743{
744 bool xChanged = publicScenePos.x() != point.x();
745 bool yChanged = publicScenePos.y() != point.y();
746
747 // Public position should not get updated while the gesture is still being recognized
748 // (ie, Undecided status).
749 Q_ASSERT(status == WaitingForTouch || status == Recognized);
750
751 if (status == Recognized && !recognitionIsDisabled()) {
752 // When the gesture finally gets recognized, the finger will likely be
753 // reasonably far from the edge. If we made the contentX immediately
754 // follow the finger position it would be visually unpleasant as it
755 // would appear right next to the user's finger out of nowhere (ie,
756 // it would jump). Instead, we make contentX go towards the user's
757 // finger in several steps. ie., in an animated way.
758 QPointF delta = point - publicScenePos;
759 // the trick is not to go all the way (1.0) as it would cause a sudden jump
760 publicScenePos.rx() += 0.4 * delta.x();
761 publicScenePos.ry() += 0.4 * delta.y();
762 } else {
763 // no smoothing when initializing or if gesture recognition was immediate as there will
764 // be no jump.
765 publicScenePos = point;
766 }
767
768 if (xChanged || yChanged) {
769 Q_EMIT q->touchPositionChanged(q->touchPosition());
770
771 // handle distance change
772 QPointF totalMovement = publicScenePos - startScenePos;
773 sceneDistance = projectOntoDirectionVector(totalMovement);
774
775 Q_EMIT q->distanceChanged(sceneDistance);
776 }
777}
778
779bool UCSwipeAreaPrivate::isWithinTouchCompositionWindow()
780{
781 return
782 compositionTime > 0 &&
783 !activeTouches.isEmpty() &&
784 timeSource->msecsSinceReference() <=
785 activeTouches.mostRecentStartTime() + (qint64)compositionTime;
786}
787
788void UCSwipeArea::itemChange(ItemChange change, const ItemChangeData &value)
789{
790 if (change == QQuickItem::ItemSceneChange) {
791 if (value.window != nullptr) {
792 value.window->installEventFilter(TouchRegistry::instance());
793
794 // FIXME: Handle window->screen() changes (ie window changing screens)
795 qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;
796 d->setPixelsPerMm(pixelsPerMm);
797 }
798 }
799}
800
801void UCSwipeAreaPrivate::setPixelsPerMm(qreal pixelsPerMm)
802{
803 dampedScenePos.setMaxDelta(1. * pixelsPerMm);
804 setDistanceThreshold(4. * pixelsPerMm);
805 maxDistance = 10. * pixelsPerMm;
806}
807
808//************************** ActiveTouchesInfo **************************
809
810ActiveTouchesInfo::ActiveTouchesInfo(const SharedTimeSource &timeSource)
811 : m_timeSource(timeSource)
812{
813}
814
815void ActiveTouchesInfo::update(QTouchEvent *event)
816{
817 if (!(event->touchPointStates() & (Qt::TouchPointPressed | Qt::TouchPointReleased))) {
818 // nothing to update
819 TI_TRACE("Nothing to update");
820 return;
821 }
822
823 const QList<QTouchEvent::TouchPoint> &touchPoints = event->touchPoints();
824 for (int i = 0; i < touchPoints.count(); ++i) {
825 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
826 if (touchPoint.state() == Qt::TouchPointPressed) {
827 addTouchPoint(touchPoint.id());
828 } else if (touchPoint.state() == Qt::TouchPointReleased) {
829 removeTouchPoint(touchPoint.id());
830 }
831 }
832}
833
834QString ActiveTouchesInfo::toString()
835{
836 QString string = "(";
837
838 {
839 QTextStream stream(&string);
840 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &touchInfo) {
841 stream << "(id=" << touchInfo->id << ",startTime=" << touchInfo->startTime << ")";
842 return true;
843 });
844 }
845
846 string.append(")");
847
848 return string;
849}
850
851void ActiveTouchesInfo::addTouchPoint(int touchId)
852{
853 ActiveTouchInfo &activeTouchInfo = m_touchInfoPool.getEmptySlot();
854 activeTouchInfo.id = touchId;
855 activeTouchInfo.startTime = m_timeSource->msecsSinceReference();
856
857 TI_TRACE(qPrintable(toString()));
858}
859
860qint64 ActiveTouchesInfo::touchStartTime(int touchId)
861{
862 qint64 result = -1;
863
864 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &touchInfo) {
865 if (touchId == touchInfo->id) {
866 result = touchInfo->startTime;
867 return false;
868 } else {
869 return true;
870 }
871 });
872
873 Q_ASSERT(result != -1);
874 return result;
875}
876
877void ActiveTouchesInfo::removeTouchPoint(int touchId)
878{
879 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &touchInfo) {
880 if (touchId == touchInfo->id) {
881 m_touchInfoPool.freeSlot(touchInfo);
882 return false;
883 } else {
884 return true;
885 }
886 });
887
888 TI_TRACE(qPrintable(toString()));
889}
890
891qint64 ActiveTouchesInfo::mostRecentStartTime()
892{
893 Q_ASSERT(!m_touchInfoPool.isEmpty());
894
895 qint64 highestStartTime = -1;
896
897 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &activeTouchInfo) {
898 if (activeTouchInfo->startTime > highestStartTime) {
899 highestStartTime = activeTouchInfo->startTime;
900 }
901 return true;
902 });
903
904 return highestStartTime;
905}
906
907void UCSwipeAreaPrivate::updateSceneDirectionVector()
908{
909 QPointF localOrigin(0., 0.);
910 QPointF localDirection;
911 switch (direction) {
912 case UCSwipeArea::Upwards:
913 localDirection.rx() = 0.;
914 localDirection.ry() = -1.;
915 break;
916 case UCSwipeArea::Downwards:
917 case UCSwipeArea::Vertical:
918 localDirection.rx() = 0.;
919 localDirection.ry() = 1;
920 break;
921 case UCSwipeArea::Leftwards:
922 localDirection.rx() = -1.;
923 localDirection.ry() = 0.;
924 break;
925 default: // UCSwipeArea::Rightwards || Direction.Horizontal
926 localDirection.rx() = 1.;
927 localDirection.ry() = 0.;
928 break;
929 }
930 QPointF sceneOrigin = q->mapToScene(localOrigin);
931 QPointF sceneDirection = q->mapToScene(localDirection);
932 sceneDirectionVector = sceneDirection - sceneOrigin;
933}
934
935qreal UCSwipeAreaPrivate::projectOntoDirectionVector(const QPointF &sceneVector) const
936{
937 // same as dot product as sceneDirectionVector is a unit vector
938 return sceneVector.x() * sceneDirectionVector.x() +
939 sceneVector.y() * sceneDirectionVector.y();
940}
941
942UCSwipeAreaPrivate::UCSwipeAreaPrivate(UCSwipeArea *q)
943 : timeSource(new RealTimeSource)
944 , activeTouches(timeSource)
945 , q(q)
946 , recognitionTimer(nullptr)
947 , distanceThreshold(0)
948 , distanceThresholdSquared(0.)
949 , maxDistance(0.)
950 , sceneDistance(0.)
951 , touchId(-1)
952 , maxTime(400)
953 , compositionTime(60)
954 , status(WaitingForTouch)
955 , direction(UCSwipeArea::Rightwards)
956 , immediateRecognition(false)
957{
958}
0959
=== added file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.h'
--- src/Ubuntu/Components/plugin/gestures/ucswipearea.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/ucswipearea.h 2015-11-24 12:22:14 +0000
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#ifndef UCSWIPEAREA_H
19#define UCSWIPEAREA_H
20
21#include <QtQuick/QQuickItem>
22#include "ubuntugesturesqmlglobal.h"
23#include "damper.h"
24
25// lib UbuntuGestures
26#include <UbuntuGestures/Pool>
27#include <UbuntuGestures/Timer>
28
29// logging
30#include <QtCore/QLoggingCategory>
31
32class TouchOwnershipEvent;
33class UnownedTouchEvent;
34class UCSwipeAreaPrivate;
35
36class UBUNTUGESTURESQML_EXPORT UCSwipeArea : public QQuickItem
37{
38 Q_OBJECT
39
40 Q_PROPERTY(Direction direction READ direction WRITE setDirection NOTIFY directionChanged)
41 Q_PROPERTY(qreal distance READ distance NOTIFY distanceChanged)
42 Q_PROPERTY(QPointF touchPosition READ touchPosition NOTIFY touchPositionChanged)
43 Q_PROPERTY(bool dragging READ dragging NOTIFY draggingChanged)
44 Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged)
45 Q_PROPERTY(bool immediateRecognition
46 READ immediateRecognition
47 WRITE setImmediateRecognition
48 NOTIFY immediateRecognitionChanged)
49
50 Q_ENUMS(Direction)
51public:
52 enum Direction {
53 Rightwards,
54 Leftwards,
55 Downwards,
56 Upwards,
57 Horizontal,
58 Vertical
59 };
60
61 UCSwipeArea(QQuickItem *parent = 0);
62
63 Direction direction() const;
64 void setDirection(Direction);
65
66 qreal distance() const;
67
68 QPointF touchPosition() const;
69
70 bool dragging() const;
71
72 bool pressed() const;
73
74 bool immediateRecognition() const;
75 void setImmediateRecognition(bool enabled);
76
77Q_SIGNALS:
78 void directionChanged(Direction direction);
79 void draggingChanged(bool dragging);
80 void pressedChanged(bool pressed);
81 void distanceChanged(qreal distance);
82 void touchPositionChanged(const QPointF &position);
83 void immediateRecognitionChanged(bool immediateRecognition);
84
85protected:
86 bool event(QEvent *e) override;
87
88 void touchEvent(QTouchEvent *event) override;
89 void itemChange(ItemChange change, const ItemChangeData &value) override;
90
91public: // so tests can access it
92 UCSwipeAreaPrivate *d;
93};
94
95Q_DECLARE_LOGGING_CATEGORY(ucSwipeArea)
96Q_DECLARE_LOGGING_CATEGORY(ucActiveTouchInfo)
97
98#endif // UCSWIPEAREA_H
099
=== added file 'src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h'
--- src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h 2015-11-24 12:22:14 +0000
@@ -0,0 +1,157 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#ifndef UCSWIPEAREAPRIVATE_H
19#define UCSWIPEAREAPRIVATE_H
20
21#include "ucswipearea.h"
22
23// Information about an active touch point
24struct UBUNTUGESTURESQML_EXPORT ActiveTouchInfo {
25 ActiveTouchInfo() : id(-1), startTime(-1) {}
26 bool isValid() const { return id != -1; }
27 void reset() { id = -1; }
28 int id;
29 qint64 startTime;
30};
31class UBUNTUGESTURESQML_EXPORT ActiveTouchesInfo {
32public:
33 ActiveTouchesInfo(const UbuntuGestures::SharedTimeSource &timeSource);
34 void update(QTouchEvent *event);
35 qint64 touchStartTime(int id);
36 bool isEmpty() const { return m_touchInfoPool.isEmpty(); }
37 qint64 mostRecentStartTime();
38 UbuntuGestures::SharedTimeSource m_timeSource;
39private:
40 void addTouchPoint(int touchId);
41 void removeTouchPoint(int touchId);
42 QString toString();
43
44 Pool<ActiveTouchInfo> m_touchInfoPool;
45};
46
47class UBUNTUGESTURESQML_EXPORT UCSwipeAreaPrivate : public QObject
48{
49 Q_OBJECT
50
51 Q_ENUMS(Status)
52public:
53 UCSwipeAreaPrivate(UCSwipeArea *q);
54
55public Q_SLOTS:
56 void giveUpIfDisabledOrInvisible();
57 void rejectGesture();
58
59public:
60 // Describes the state of the directional drag gesture.
61 enum Status {
62 // Waiting for a new touch point to land on this area. No gesture is being processed
63 // or tracked.
64 WaitingForTouch,
65
66 // A touch point has landed on this area but it's not know yet whether it is
67 // performing a drag in the correct direction.
68 // If it's decided that the touch point is not performing a directional drag gesture,
69 // it will be rejected/ignored and status will return to WaitingForTouch.
70 Undecided, //Recognizing,
71
72 // There's a touch point in this area and it performed a drag in the correct
73 // direction.
74 //
75 // Once recognized, the gesture state will move back to WaitingForTouch only once
76 // that touch point ends. The gesture will remain in the Recognized state even if
77 // the touch point starts moving in other directions or halts.
78 Recognized,
79 };
80
81 void touchEvent_absent(QTouchEvent *event);
82 void touchEvent_undecided(QTouchEvent *event);
83 void touchEvent_recognized(QTouchEvent *event);
84 bool movingInRightDirection() const;
85 bool movedFarEnoughAlongGestureAxis() const;
86 bool isPastMaxDistance() const;
87 const QTouchEvent::TouchPoint *fetchTargetTouchPoint(QTouchEvent *event);
88 void setStatus(Status newStatus);
89 void updatePosition(const QPointF &point);
90 void setPublicScenePos(const QPointF &point);
91 bool isWithinTouchCompositionWindow();
92 void updateSceneDirectionVector();
93 // returns the scalar projection between the given vector (in scene coordinates)
94 // and m_sceneDirectionVector
95 qreal projectOntoDirectionVector(const QPointF &sceneVector) const;
96 void touchOwnershipEvent(TouchOwnershipEvent *event);
97 void unownedTouchEvent(UnownedTouchEvent *event);
98 void unownedTouchEvent_undecided(UnownedTouchEvent *unownedTouchEvent);
99 void watchPressedTouchPoints(const QList<QTouchEvent::TouchPoint> &touchPoints);
100 bool recognitionIsDisabled() const;
101 bool sanityCheckRecognitionProperties();
102 void setMaxTime(int value);
103 void setDistanceThreshold(qreal value);
104 void setPixelsPerMm(qreal pixelsPerMm);
105 QString objectName() const { return q->objectName(); }
106
107 // Replaces the existing Timer with the given one.
108 //
109 // Useful for providing a fake timer when testing.
110 void setRecognitionTimer(UbuntuGestures::AbstractTimer *timer);
111
112 // Useful for testing, where a fake time source can be supplied
113 void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
114
115 QPointF startScenePos;
116 // The touch position exposed in the public API.
117 // It only starts to move once the gesture gets recognized.
118 QPointF publicScenePos;
119 // A movement damper is used in some of the gesture recognition calculations
120 // to get rid of noise or small oscillations in the touch position.
121 DampedPointF dampedScenePos;
122 QPointF previousDampedScenePos;
123 // Unit vector in scene coordinates describing the direction of the gesture recognition
124 QPointF sceneDirectionVector;
125 UbuntuGestures::SharedTimeSource timeSource;
126 ActiveTouchesInfo activeTouches;
127
128 UCSwipeArea *q;
129 UbuntuGestures::AbstractTimer *recognitionTimer;
130
131 // How far a touch point has to move from its initial position along the gesture axis in order
132 // for it to be recognized as a directional drag.
133 qreal distanceThreshold;
134 qreal distanceThresholdSquared; // it's pow(distanceThreshold, 2)
135 // Maximum distance the gesture can go without crossing the axis-aligned distance threshold
136 qreal maxDistance;
137 qreal sceneDistance;
138
139 int touchId;
140 // Maximum time (in milliseconds) the gesture can take to go beyond the distance threshold
141 int maxTime;
142 // Maximum time (in milliseconds) after the start of a given touch point where
143 // subsequent touch starts are grouped with the first one into an N-touches gesture
144 // (e.g. a two-fingers tap or drag).
145 int compositionTime;
146
147 // The current status of the directional drag gesture area.
148 Status status;
149 UCSwipeArea::Direction direction;
150
151 bool immediateRecognition;
152
153Q_SIGNALS:
154 void statusChanged(Status value);
155};
156
157#endif // UCSWIPEAREAPRIVATE_H
0158
=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
--- src/Ubuntu/Components/plugin/plugin.cpp 2015-10-01 12:34:29 +0000
+++ src/Ubuntu/Components/plugin/plugin.cpp 2015-11-24 12:22:14 +0000
@@ -70,6 +70,9 @@
70#include "ucheader.h"70#include "ucheader.h"
71#include "uclabel.h"71#include "uclabel.h"
72#include "uclistitemlayout.h"72#include "uclistitemlayout.h"
73#include "ucbottomedgehint.h"
74#include "gestures/ucswipearea.h"
75#include "ucmathutils.h"
7376
74#include <sys/types.h>77#include <sys/types.h>
75#include <unistd.h>78#include <unistd.h>
@@ -194,6 +197,7 @@
194 qmlRegisterType<UCInverseMouse>(uri, major, minor, "InverseMouse");197 qmlRegisterType<UCInverseMouse>(uri, major, minor, "InverseMouse");
195 qmlRegisterType<UCActionItem>(uri, major, minor, "ActionItem");198 qmlRegisterType<UCActionItem>(uri, major, minor, "ActionItem");
196 qmlRegisterSingletonType<UCHaptics>(uri, major, minor, "Haptics", registerHaptics);199 qmlRegisterSingletonType<UCHaptics>(uri, major, minor, "Haptics", registerHaptics);
200 qmlRegisterSingletonType<UCMathUtils>(uri, major, minor, "MathUtils", UCMathUtils::qmlRegisterTypeCallback);
197}201}
198202
199void UbuntuComponentsPlugin::registerTypes(const char *uri)203void UbuntuComponentsPlugin::registerTypes(const char *uri)
@@ -230,7 +234,6 @@
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: