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