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