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

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
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
=== modified file 'components.api'
--- components.api 2015-10-15 14:17:25 +0000
+++ components.api 2015-11-17 15:49:37 +0000
@@ -31,7 +31,7 @@
31 Real31 Real
32 String32 String
33Ubuntu.Components.ActionBar 1.3: StyledItem33Ubuntu.Components.ActionBar 1.3: StyledItem
34 readonly property Action actions34 property list<Action> actions
35 property Component delegate35 property Component delegate
36 property int numberOfSlots36 property int numberOfSlots
37Ubuntu.Components.Styles.ActionBarStyle 1.3: Item37Ubuntu.Components.Styles.ActionBarStyle 1.3: Item
@@ -41,7 +41,7 @@
41 property url overflowIconSource41 property url overflowIconSource
42 property string overflowText42 property string overflowText
43Ubuntu.Components.ActionContext 1.0 0.1: QtObject43Ubuntu.Components.ActionContext 1.0 0.1: QtObject
44 default readonly property Action actions44 default property list<Action> actions
45 property bool active45 property bool active
46 function addAction(Action action)46 function addAction(Action action)
47 function removeAction(Action action)47 function removeAction(Action action)
@@ -54,15 +54,15 @@
54 function trigger()54 function trigger()
55 property string text55 property string text
56Ubuntu.Components.ActionList 1.0 0.1: QtObject56Ubuntu.Components.ActionList 1.0 0.1: QtObject
57 readonly property Action actions57 property list<Action> actions
58 default readonly property Action children58 default property list<Action> children
59Ubuntu.Components.ActionList 1.3: QtObject59Ubuntu.Components.ActionList 1.3: QtObject
60 readonly property Action actions60 property list<Action> actions
61 default readonly property Action children61 default property list<Action> children
62Ubuntu.Components.ActionManager 1.0 0.1: QtObject62Ubuntu.Components.ActionManager 1.0 0.1: QtObject
63 default readonly property Action actions63 default property list<Action> actions
64 readonly property ActionContext globalContext64 readonly property ActionContext globalContext
65 readonly property ActionContext localContexts65 property list<ActionContext> localContexts
66 signal quit()66 signal quit()
67 function addAction(Action action)67 function addAction(Action action)
68 function removeAction(Action action)68 function removeAction(Action action)
@@ -84,7 +84,7 @@
84 property bool running84 property bool running
85Ubuntu.Components.AdaptivePageLayout 1.3: PageTreeNode85Ubuntu.Components.AdaptivePageLayout 1.3: PageTreeNode
86 readonly property int columns86 readonly property int columns
87 readonly property PageColumnsLayout layouts87 property list<PageColumnsLayou> layouts
88 function var addPageToCurrentColumn(var sourcePage, var page, var properties)88 function var addPageToCurrentColumn(var sourcePage, var page, var properties)
89 function var addPageToNextColumn(var sourcePage, var page, var properties)89 function var addPageToNextColumn(var sourcePage, var page, var properties)
90 function var removePages(var page)90 function var removePages(var page)
@@ -155,7 +155,7 @@
155 property bool required155 property bool required
156 property QStringList valueNames156 property QStringList valueNames
157Ubuntu.Components.Arguments 1.0 0.1: QtObject157Ubuntu.Components.Arguments 1.0 0.1: QtObject
158 default readonly property Argument arguments158 default property list<Argument> arguments
159 property Argument defaultArgument159 property Argument defaultArgument
160 readonly property bool error160 readonly property bool error
161 readonly property string errorMessage161 readonly property string errorMessage
@@ -175,11 +175,19 @@
175 property var icon175 property var icon
176 property bool iconFrame176 property bool iconFrame
177 property bool progression177 property bool progression
178Ubuntu.Components.BottomEdgeHint 1.3: Item178Ubuntu.Components.BottomEdgeHint 1.3: StyledItem
179 property int deactivateTimeout
180 property Flickable flickable
179 property string iconName181 property string iconName
180 property url iconSource182 property url iconSource
181 signal clicked()183 signal clicked()
184 property Status status
182 property string text185 property string text
186Ubuntu.Components.BottomEdgeHint.Status: Enum
187 Active
188 Hidden
189 Inactive
190 Locked
183Ubuntu.Components.Button 1.0 0.1: AbstractButton191Ubuntu.Components.Button 1.0 0.1: AbstractButton
184 property color color192 property color color
185 property QFont font193 property QFont font
@@ -221,14 +229,14 @@
221Ubuntu.Components.ColorUtils 0.1 1.0229Ubuntu.Components.ColorUtils 0.1 1.0
222Ubuntu.Components.ComboButton 1.1: Button230Ubuntu.Components.ComboButton 1.1: Button
223 property double collapsedHeight231 property double collapsedHeight
224 default readonly property QtObject comboList232 default property list<QtObject> comboList
225 readonly property double comboListHeight233 readonly property double comboListHeight
226 property color dropdownColor234 property color dropdownColor
227 property bool expanded235 property bool expanded
228 property double expandedHeight236 property double expandedHeight
229Ubuntu.Components.ComboButton 1.3: Button237Ubuntu.Components.ComboButton 1.3: Button
230 property double collapsedHeight238 property double collapsedHeight
231 default readonly property QtObject comboList239 default property list<QtObject> comboList
232 readonly property double comboListHeight240 readonly property double comboListHeight
233 property color dropdownColor241 property color dropdownColor
234 property bool expanded242 property bool expanded
@@ -318,7 +326,7 @@
318 signal closeClicked()326 signal closeClicked()
319 signal doneClicked()327 signal doneClicked()
320Ubuntu.Components.Pickers.Dialer 1.0 0.1: StyledItem328Ubuntu.Components.Pickers.Dialer 1.0 0.1: StyledItem
321 readonly property QtObject centerContent329 property list<QtObject> centerContent
322 readonly property Item centerItem330 readonly property Item centerItem
323 property double handSpace331 property double handSpace
324 readonly property var hands332 readonly property var hands
@@ -327,7 +335,7 @@
327 property double minimumValue335 property double minimumValue
328 property double size336 property double size
329Ubuntu.Components.Pickers.Dialer 1.3: StyledItem337Ubuntu.Components.Pickers.Dialer 1.3: StyledItem
330 readonly property QtObject centerContent338 property list<QtObject> centerContent
331 readonly property Item centerItem339 readonly property Item centerItem
332 property double handSpace340 property double handSpace
333 readonly property var hands341 readonly property var hands
@@ -339,18 +347,18 @@
339 readonly property Dialer dialer347 readonly property Dialer dialer
340 property DialerHandGroup hand348 property DialerHandGroup hand
341 readonly property int index349 readonly property int index
342 default readonly property QtObject overlay350 default property list<QtObject> overlay
343 property double value351 property double value
344Ubuntu.Components.Pickers.DialerHand 1.3: StyledItem352Ubuntu.Components.Pickers.DialerHand 1.3: StyledItem
345 readonly property Dialer dialer353 readonly property Dialer dialer
346 property DialerHandGroup hand354 property DialerHandGroup hand
347 readonly property int index355 readonly property int index
348 default readonly property QtObject overlay356 default property list<QtObject> overlay
349 property double value357 property double value
350Ubuntu.Components.Popups.Dialog 1.0 0.1: PopupBase358Ubuntu.Components.Popups.Dialog 1.0 0.1: PopupBase
351 property Item caller359 property Item caller
352 property double callerMargin360 property double callerMargin
353 default readonly property QtObject contents361 default property list<QtObject> contents
354 property double edgeMargins362 property double edgeMargins
355 property bool modal363 property bool modal
356 property Item pointerTarget364 property Item pointerTarget
@@ -359,34 +367,16 @@
359Ubuntu.Components.Popups.Dialog 1.3: PopupBase367Ubuntu.Components.Popups.Dialog 1.3: PopupBase
360 property Item caller368 property Item caller
361 property double callerMargin369 property double callerMargin
362 default readonly property QtObject contents370 default property list<QtObject> contents
363 property double edgeMargins371 property double edgeMargins
364 property bool modal372 property bool modal
365 property Item pointerTarget373 property Item pointerTarget
366 property string text374 property string text
367 property string title375 property string title
368Ubuntu.Components.ListItems.Divider 1.0 0.1: QQuickImageBase376Ubuntu.Components.ListItems.Divider 1.0 0.1: QQuickImageBase
369 property FillMode fillMode
370 property HAlignment horizontalAlignment
371 signal horizontalAlignmentChanged(HAlignment alignment)
372 signal verticalAlignmentChanged(VAlignment alignment)
373 signal mipmapChanged(bool )
374 property bool mipmap
375 readonly property double paintedHeight
376 readonly property double paintedWidth
377 property VAlignment verticalAlignment
378Ubuntu.Components.ListItems.Divider 1.3: QQuickImageBase377Ubuntu.Components.ListItems.Divider 1.3: QQuickImageBase
379 property FillMode fillMode
380 property HAlignment horizontalAlignment
381 signal horizontalAlignmentChanged(HAlignment alignment)
382 signal verticalAlignmentChanged(VAlignment alignment)
383 signal mipmapChanged(bool )
384 property bool mipmap
385 readonly property double paintedHeight
386 readonly property double paintedWidth
387 property VAlignment verticalAlignment
388Ubuntu.Components.ListItems.Empty 1.0 0.1: AbstractButton378Ubuntu.Components.ListItems.Empty 1.0 0.1: AbstractButton
389 readonly property Item backgroundIndicator379 property list<Item> backgroundIndicator
390 property bool confirmRemoval380 property bool confirmRemoval
391 readonly property ThinDivider divider381 readonly property ThinDivider divider
392 property bool highlightWhenPressed382 property bool highlightWhenPressed
@@ -398,7 +388,7 @@
398 readonly property string swipingState388 readonly property string swipingState
399 readonly property bool waitingConfirmationForRemoval389 readonly property bool waitingConfirmationForRemoval
400Ubuntu.Components.ListItems.Empty 1.3: AbstractButton390Ubuntu.Components.ListItems.Empty 1.3: AbstractButton
401 readonly property Item backgroundIndicator391 property list<Item> backgroundIndicator
402 property bool confirmRemoval392 property bool confirmRemoval
403 readonly property ThinDivider divider393 readonly property ThinDivider divider
404 property bool highlightWhenPressed394 property bool highlightWhenPressed
@@ -510,7 +500,7 @@
510 XxSmall500 XxSmall
511Ubuntu.Layouts.Layouts 1.0 0.1: Item501Ubuntu.Layouts.Layouts 1.0 0.1: Item
512 readonly property string currentLayout502 readonly property string currentLayout
513 readonly property ConditionalLayout layouts503 property list<ConditionalLayout> layouts
514Ubuntu.Components.ListItem 1.3 1.2: StyledItem504Ubuntu.Components.ListItem 1.3 1.2: StyledItem
515 property Action action505 property Action action
516 property color color506 property color color
@@ -523,18 +513,19 @@
523 property color highlightColor513 property color highlightColor
524 readonly property bool highlighted514 readonly property bool highlighted
525 property ListItemActions leadingActions515 property ListItemActions leadingActions
526 readonly property Item listItemChildren516 property list<Item> listItemChildren
527 default readonly property QtObject listItemData517 default property list<QtObject> listItemData
528 signal clicked()518 signal clicked()
529 signal pressAndHold()519 signal pressAndHold()
530 signal contentMovementStarted()520 signal contentMovementStarted()
531 signal contentMovementEnded()521 signal contentMovementEnded()
532 property bool selectMode522 property bool selectMode
533 property bool selected523 property bool selected
524 property bool swipeEnabled 1.3
534 property ListItemActions trailingActions525 property ListItemActions trailingActions
535Ubuntu.Components.ListItemActions 1.2: QtObject526Ubuntu.Components.ListItemActions 1.2: QtObject
536 readonly property Action actions527 property list<Action> actions
537 default readonly property QtObject data528 default property list<QtObject> data
538 property Component delegate529 property Component delegate
539Ubuntu.Components.ListItemDrag 1.2: QtObject530Ubuntu.Components.ListItemDrag 1.2: QtObject
540 property bool accept531 property bool accept
@@ -572,14 +563,14 @@
572 Second563 Second
573Ubuntu.Components.MainView 1.0 0.1: MainViewBase564Ubuntu.Components.MainView 1.0 0.1: MainViewBase
574 property bool automaticOrientation565 property bool automaticOrientation
575 default readonly property QtObject contentsItem566 default property list<QtObject> contentsItem
576 property bool useDeprecatedToolbar567 property bool useDeprecatedToolbar
577Ubuntu.Components.MainView 1.2: MainViewBase568Ubuntu.Components.MainView 1.2: MainViewBase
578 property bool automaticOrientation569 property bool automaticOrientation
579 default readonly property QtObject contentsItem570 default property list<QtObject> contentsItem
580Ubuntu.Components.MainView 1.3: MainViewBase571Ubuntu.Components.MainView 1.3: MainViewBase
581 property bool automaticOrientation572 property bool automaticOrientation
582 default readonly property QtObject contentsItem573 default property list<QtObject> contentsItem
583Ubuntu.Components.MathUtils 0.1 1.0 1.3574Ubuntu.Components.MathUtils 0.1 1.0 1.3
584Ubuntu.Components.MimeData 1.0 0.1: QtObject575Ubuntu.Components.MimeData 1.0 0.1: QtObject
585 property color color576 property color color
@@ -587,12 +578,12 @@
587 readonly property QStringList formats578 readonly property QStringList formats
588 property string html579 property string html
589 property string text580 property string text
590 property QList<QUrl> urls581 property list<url> urls
591Ubuntu.Components.Mouse 1.0 0.1: QtObject582Ubuntu.Components.Mouse 1.0 0.1: QtObject
592 readonly property Qt.MouseButtons acceptedButtons583 readonly property Qt.MouseButtons acceptedButtons
593 property int clickAndHoldThreshold584 property int clickAndHoldThreshold
594 property bool enabled585 property bool enabled
595 readonly property Item forwardTo586 property list<Item> forwardTo
596 readonly property bool hoverEnabled587 readonly property bool hoverEnabled
597 signal pressed(QQuickMouseEvent mouse, Item host)588 signal pressed(QQuickMouseEvent mouse, Item host)
598 signal released(QQuickMouseEvent mouse, Item host)589 signal released(QQuickMouseEvent mouse, Item host)
@@ -611,7 +602,7 @@
611Ubuntu.Components.ListItems.MultiValue 1.3: Base602Ubuntu.Components.ListItems.MultiValue 1.3: Base
612 property var values603 property var values
613Ubuntu.Components.Object 1.0 0.1: QtObject604Ubuntu.Components.Object 1.0 0.1: QtObject
614 default readonly property QtObject children605 default property list<QtObject> children
615Ubuntu.Components.OptionSelector 1.0 0.1: Empty606Ubuntu.Components.OptionSelector 1.0 0.1: Empty
616 property bool colourImage607 property bool colourImage
617 property double containerHeight608 property double containerHeight
@@ -665,11 +656,11 @@
665 readonly property bool rotating656 readonly property bool rotating
666 property bool transitionEnabled657 property bool transitionEnabled
667Ubuntu.Components.Page 1.0 0.1: PageTreeNode658Ubuntu.Components.Page 1.0 0.1: PageTreeNode
668 readonly property Action actions659 property list<Action> actions
669 property Flickable flickable660 property Flickable flickable
670 property string title661 property string title
671 property Item tools662 property Item tools
672Ubuntu.Components.Page 1.1: Page663Ubuntu.Components.Page 1.1: Page10
673 readonly property PageHeadConfiguration head664 readonly property PageHeadConfiguration head
674Ubuntu.Components.Page 1.3: PageTreeNode665Ubuntu.Components.Page 1.3: PageTreeNode
675 property Flickable flickable666 property Flickable flickable
@@ -682,17 +673,17 @@
682 property double minimumWidth673 property double minimumWidth
683 property double preferredWidth674 property double preferredWidth
684Ubuntu.Components.PageColumnsLayout 1.3: QtObject675Ubuntu.Components.PageColumnsLayout 1.3: QtObject
685 default readonly property PageColumn data676 default property list<PageColum> data
686 property bool when677 property bool when
687Ubuntu.Components.PageHeadConfiguration 1.1: Object678Ubuntu.Components.PageHeadConfiguration 1.1: Object
688 readonly property Action actions679 property list<Action> actions
689 property Action backAction680 property Action backAction
690 property Item contents681 property Item contents
691 property color foregroundColor682 property color foregroundColor
692 property string preset683 property string preset
693 readonly property PageHeadSections sections684 readonly property PageHeadSections sections
694Ubuntu.Components.PageHeadConfiguration 1.3: Object685Ubuntu.Components.PageHeadConfiguration 1.3: Object
695 readonly property Action actions686 property list<Action> actions
696 property Action backAction687 property Action backAction
697 property Item contents688 property Item contents
698 property Flickable flickable689 property Flickable flickable
@@ -707,17 +698,17 @@
707 property var model698 property var model
708 property int selectedIndex699 property int selectedIndex
709Ubuntu.Components.PageHeadSections 1.3: QtObject700Ubuntu.Components.PageHeadSections 1.3: QtObject
710 readonly property Action actions701 property list<Action> actions
711 property bool enabled702 property bool enabled
712 property var model703 property var model
713 property int selectedIndex704 property int selectedIndex
714Ubuntu.Components.PageHeadState 1.1: State705Ubuntu.Components.PageHeadState 1.1: State
715 readonly property Action actions706 property list<Action> actions
716 property Action backAction707 property Action backAction
717 property Item contents708 property Item contents
718 property PageHeadConfiguration head709 property PageHeadConfiguration head
719Ubuntu.Components.PageHeadState 1.3: State710Ubuntu.Components.PageHeadState 1.3: State
720 readonly property Action actions711 property list<Action> actions
721 property Action backAction712 property Action backAction
722 property Item contents713 property Item contents
723 property PageHeadConfiguration head714 property PageHeadConfiguration head
@@ -743,6 +734,7 @@
743Ubuntu.Components.PageHeader 1.3: Header734Ubuntu.Components.PageHeader 1.3: Header
744 property Item contents735 property Item contents
745 readonly property ActionBar leadingActionBar736 readonly property ActionBar leadingActionBar
737 property list<Action> navigationActions
746 readonly property Sections sections738 readonly property Sections sections
747 property string title739 property string title
748 readonly property ActionBar trailingActionBar740 readonly property ActionBar trailingActionBar
@@ -799,7 +791,7 @@
799 property int align791 property int align
800 property bool animate792 property bool animate
801 readonly property bool animating793 readonly property bool animating
802 default readonly property QtObject contents794 default property list<QtObject> contents
803 property int hideTimeout795 property int hideTimeout
804 property double hintSize796 property double hintSize
805 property bool locked797 property bool locked
@@ -813,7 +805,7 @@
813 property int align805 property int align
814 property bool animate806 property bool animate
815 readonly property bool animating807 readonly property bool animating
816 default readonly property QtObject contents808 default property list<QtObject> contents
817 property int hideTimeout809 property int hideTimeout
818 property double hintSize810 property double hintSize
819 property bool locked811 property bool locked
@@ -854,7 +846,7 @@
854 property bool autoClose846 property bool autoClose
855 property Item caller847 property Item caller
856 property double callerMargin848 property double callerMargin
857 default readonly property QtObject container849 default property list<QtObject> container
858 property double contentHeight850 property double contentHeight
859 property double contentWidth851 property double contentWidth
860 property double edgeMargins852 property double edgeMargins
@@ -866,7 +858,7 @@
866 property bool autoClose858 property bool autoClose
867 property Item caller859 property Item caller
868 property double callerMargin860 property double callerMargin
869 default readonly property QtObject container861 default property list<QtObject> container
870 property double contentHeight862 property double contentHeight
871 property double contentWidth863 property double contentWidth
872 property double edgeMargins864 property double edgeMargins
@@ -937,7 +929,7 @@
937 property Flickable flickableItem929 property Flickable flickableItem
938Ubuntu.Components.ScrollbarUtils 0.1 1.0930Ubuntu.Components.ScrollbarUtils 0.1 1.0
939Ubuntu.Components.Sections 1.3: StyledItem931Ubuntu.Components.Sections 1.3: StyledItem
940 readonly property Action actions932 property list<Action> actions
941 property var model933 property var model
942 property int selectedIndex934 property int selectedIndex
943Ubuntu.Components.ServiceProperties 1.1: QtObject935Ubuntu.Components.ServiceProperties 1.1: QtObject
@@ -958,13 +950,13 @@
958 Inactive950 Inactive
959 Synchronizing951 Synchronizing
960Ubuntu.Components.Popups.SheetBase 1.0 0.1: PopupBase952Ubuntu.Components.Popups.SheetBase 1.0 0.1: PopupBase
961 default readonly property QtObject container953 default property list<QtObject> container
962 property double contentsHeight954 property double contentsHeight
963 property double contentsWidth955 property double contentsWidth
964 property bool modal956 property bool modal
965 property string title957 property string title
966Ubuntu.Components.Popups.SheetBase 1.3: PopupBase958Ubuntu.Components.Popups.SheetBase 1.3: PopupBase
967 default readonly property QtObject container959 default property list<QtObject> container
968 property double contentsHeight960 property double contentsHeight
969 property double contentsWidth961 property double contentsWidth
970 property bool modal962 property bool modal
@@ -1094,14 +1086,14 @@
1094 readonly property Tab selectedTab1086 readonly property Tab selectedTab
1095 property int selectedTabIndex1087 property int selectedTabIndex
1096 property TabBar tabBar1088 property TabBar tabBar
1097 default readonly property QtObject tabChildren1089 default property list<QtObject> tabChildren
1098Ubuntu.Components.Tabs 1.3: PageTreeNode1090Ubuntu.Components.Tabs 1.3: PageTreeNode
1099 readonly property int count1091 readonly property int count
1100 readonly property Item currentPage1092 readonly property Item currentPage
1101 readonly property Tab selectedTab1093 readonly property Tab selectedTab
1102 property int selectedTabIndex1094 property int selectedTabIndex
1103 property TabBar tabBar1095 property TabBar tabBar
1104 default readonly property QtObject tabChildren1096 default property list<QtObject> tabChildren
1105Ubuntu.Test.TestExtras 1.0: QtObject singleton1097Ubuntu.Test.TestExtras 1.0: QtObject singleton
1106 function string openGLflavor()1098 function string openGLflavor()
1107 function string cpuArchitecture()1099 function string cpuArchitecture()
@@ -1284,10 +1276,10 @@
1284 property bool persistentSelection1276 property bool persistentSelection
1285 property string placeholderText1277 property string placeholderText
1286 property var popover1278 property var popover
1287 readonly property QtObject primaryItem1279 property list<QtObject> primaryItem
1288 property bool readOnly1280 property bool readOnly
1289 property int renderType1281 property int renderType
1290 readonly property QtObject secondaryItem1282 property list<QtObject> secondaryItem
1291 property bool selectByMouse1283 property bool selectByMouse
1292 readonly property string selectedText1284 readonly property string selectedText
1293 property color selectedTextColor1285 property color selectedTextColor
@@ -1345,10 +1337,10 @@
1345 property bool persistentSelection1337 property bool persistentSelection
1346 property string placeholderText1338 property string placeholderText
1347 property var popover1339 property var popover
1348 readonly property QtObject primaryItem1340 property list<QtObject> primaryItem
1349 property bool readOnly1341 property bool readOnly
1350 property int renderType1342 property int renderType
1351 readonly property QtObject secondaryItem1343 property list<QtObject> secondaryItem
1352 property bool selectByMouse1344 property bool selectByMouse
1353 readonly property string selectedText1345 readonly property string selectedText
1354 property color selectedTextColor1346 property color selectedTextColor
@@ -1363,7 +1355,6 @@
1363 property string name1355 property string name
1364 property QtObject palette1356 property QtObject palette
1365 readonly property ThemeSettings parentTheme1357 readonly property ThemeSettings parentTheme
1366 property ushort version
1367Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle1358Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle
1368Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle1359Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle
1369Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem1360Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem
@@ -1384,13 +1375,13 @@
1384 property string text1375 property string text
1385Ubuntu.Components.ToolbarItems 1.0 0.1: Item1376Ubuntu.Components.ToolbarItems 1.0 0.1: Item
1386 property Item back1377 property Item back
1387 default readonly property QtObject contents1378 default property list<QtObject> contents
1388 property bool locked1379 property bool locked
1389 property bool opened1380 property bool opened
1390 property Item pageStack1381 property Item pageStack
1391Ubuntu.Components.ToolbarItems 1.3: Item1382Ubuntu.Components.ToolbarItems 1.3: Item
1392 property Item back1383 property Item back
1393 default readonly property QtObject contents1384 default property list<QtObject> contents
1394 property bool locked1385 property bool locked
1395 property bool opened1386 property bool opened
1396 property Item pageStack1387 property Item pageStack
@@ -1400,7 +1391,6 @@
1400Ubuntu.Components.UCFontUtils 1.0 0.1: QtObject1391Ubuntu.Components.UCFontUtils 1.0 0.1: QtObject
1401 function double sizeToPixels(string size)1392 function double sizeToPixels(string size)
1402 function double modularScale(string size)1393 function double modularScale(string size)
1403UCItemAttached: QtObject
1404UCListItemDivider: Item1394UCListItemDivider: Item
1405 property color colorFrom1395 property color colorFrom
1406 property color colorTo1396 property color colorTo
@@ -1531,6 +1521,7 @@
1531 function var typeString(var string)1521 function var typeString(var string)
1532 function var warningFormat(var line, var column, var message)1522 function var warningFormat(var line, var column, var message)
1533 function var waitForHeaderAnimation(var mainView)1523 function var waitForHeaderAnimation(var mainView)
1524 readonly property QuickTestUtil testUtil
1534Ubuntu.Components.UriHandler 1.0 0.1: QtObject singleton1525Ubuntu.Components.UriHandler 1.0 0.1: QtObject singleton
1535 signal opened(QStringList uris)1526 signal opened(QStringList uris)
1536Ubuntu.Components.ListItems.ValueSelector 1.0 0.1: Empty1527Ubuntu.Components.ListItems.ValueSelector 1.0 0.1: Empty
@@ -1551,12 +1542,12 @@
1551 property var values1542 property var values
1552Ubuntu.Components.ViewItems 1.2: QtObject1543Ubuntu.Components.ViewItems 1.2: QtObject
1553 property bool dragMode1544 property bool dragMode
1554 property QList<int> expandedIndices1545 property list<int> expandedIndices
1555 property int expansionFlags1546 property int expansionFlags
1556 signal dragUpdated(ListItemDrag event)1547 signal dragUpdated(ListItemDrag event)
1557 signal expandedIndicesChanged(QList<int> indices)1548 signal expandedIndicesChanged(list<int> indices)
1558 property bool selectMode1549 property bool selectMode
1559 property QList<int> selectedIndices1550 property list<int> selectedIndices
1560Ubuntu.Components.ViewItems.ExpansionFlag: Enum1551Ubuntu.Components.ViewItems.ExpansionFlag: Enum
1561 CollapseOnOutsidePress1552 CollapseOnOutsidePress
1562 Exclusive1553 Exclusive
15631554
=== modified file 'debian/control'
--- debian/control 2015-10-09 08:23:09 +0000
+++ debian/control 2015-11-17 15:49:37 +0000
@@ -9,6 +9,7 @@
9 python3:any,9 python3:any,
10 qml-module-qtgraphicaleffects | libqt5qml-graphicaleffects,10 qml-module-qtgraphicaleffects | libqt5qml-graphicaleffects,
11 libinput-dev,11 libinput-dev,
12 libxkbcommon-dev,
12 qtbase5-dev,13 qtbase5-dev,
13 qtbase5-private-dev,14 qtbase5-private-dev,
14 qttools5-dev-tools,15 qttools5-dev-tools,
1516
=== modified file 'examples/ubuntu-ui-toolkit-gallery/About.qml'
--- examples/ubuntu-ui-toolkit-gallery/About.qml 2015-09-24 19:36:36 +0000
+++ examples/ubuntu-ui-toolkit-gallery/About.qml 2015-11-17 15:49:37 +0000
@@ -30,9 +30,8 @@
30 anchors.fill: parent30 anchors.fill: parent
31 color: theme.palette.normal.background31 color: theme.palette.normal.background
32 }32 }
33 head {33 header: PageHeader {
34 title: i18n.tr('About...')34 title: i18n.tr("About...")
35 foregroundColor: theme.palette.selected.foregroundText
36 }35 }
3736
38 Column {37 Column {
3938
=== renamed file 'examples/ubuntu-ui-toolkit-gallery/BottomEdgeHint.qml' => 'examples/ubuntu-ui-toolkit-gallery/BottomEdgePage.qml'
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-09-30 21:14:25 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-11-17 15:49:37 +0000
@@ -28,7 +28,7 @@
2828
29 ListItem {29 ListItem {
30 id: addressbookListItem30 id: addressbookListItem
31 height: addressbookLayout.height31 height: addressbookLayout.height + (divider.visible ? divider.height : 0)
3232
33 ListItemLayout {33 ListItemLayout {
34 id: addressbookLayout34 id: addressbookLayout
@@ -48,7 +48,7 @@
4848
49 ListItem {49 ListItem {
50 id: addressbookDetailsListItem50 id: addressbookDetailsListItem
51 height: addressbookDetailsLayout.height + divider.height51 height: addressbookDetailsLayout.height + (divider.visible ? divider.height : 0)
52 ListItemLayout {52 ListItemLayout {
53 id: addressbookDetailsLayout53 id: addressbookDetailsLayout
5454
@@ -73,7 +73,7 @@
73 ListItem {73 ListItem {
74 id: telegramContactsListItem74 id: telegramContactsListItem
7575
76 height: telegramContactsLayout.height76 height: telegramContactsLayout.height + (divider.visible ? divider.height : 0)
7777
78 ListItemLayout {78 ListItemLayout {
79 id: telegramContactsLayout79 id: telegramContactsLayout
@@ -92,7 +92,7 @@
9292
93 ListItem {93 ListItem {
94 id: systemSettings194 id: systemSettings1
95 height: systemSettings1_layout.height95 height: systemSettings1_layout.height + (divider.visible ? divider.height : 0)
9696
97 ListItemLayout {97 ListItemLayout {
98 id: systemSettings1_layout98 id: systemSettings1_layout
@@ -110,7 +110,7 @@
110110
111 ListItem {111 ListItem {
112 id: systemSettings2112 id: systemSettings2
113 height: systemSettings2_layout.height113 height: systemSettings2_layout.height + (divider.visible ? divider.height : 0)
114114
115 ListItemLayout {115 ListItemLayout {
116 id: systemSettings2_layout116 id: systemSettings2_layout
@@ -129,7 +129,7 @@
129129
130 ListItem {130 ListItem {
131 id: systemSettings3131 id: systemSettings3
132 height: systemSettings3_layout.height132 height: systemSettings3_layout.height + (divider.visible ? divider.height : 0)
133133
134 ListItemLayout {134 ListItemLayout {
135 id: systemSettings3_layout135 id: systemSettings3_layout
@@ -157,7 +157,7 @@
157 spacing: 0157 spacing: 0
158158
159 ListItem {159 ListItem {
160 height: customLabelsLayout.height160 height: customLabelsLayout.height + (divider.visible ? divider.height : 0)
161161
162 ListItemLayout {162 ListItemLayout {
163 id: customLabelsLayout163 id: customLabelsLayout
@@ -220,7 +220,7 @@
220220
221 ListItem {221 ListItem {
222 id: dialerHistoryListItem222 id: dialerHistoryListItem
223 height: dialerHistoryLayout.height223 height: dialerHistoryLayout.height + (divider.visible ? divider.height : 0)
224224
225 ListItemLayout {225 ListItemLayout {
226 id: dialerHistoryLayout226 id: dialerHistoryLayout
227227
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-09-28 12:26:13 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-11-17 15:49:37 +0000
@@ -20,7 +20,7 @@
20ListItem {20ListItem {
21 property alias title: layout.title21 property alias title: layout.title
2222
23 height: layout.height23 height: layout.height + (divider.visible ? divider.height : 0)
24 onPressAndHold: selectMode = !selectMode24 onPressAndHold: selectMode = !selectMode
2525
26 ListItemLayout { id: layout }26 ListItemLayout { id: layout }
2727
=== modified file 'examples/ubuntu-ui-toolkit-gallery/MainPage.qml'
--- examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-09-30 05:59:49 +0000
+++ examples/ubuntu-ui-toolkit-gallery/MainPage.qml 2015-11-17 15:49:37 +0000
@@ -21,37 +21,53 @@
21 id: mainPage21 id: mainPage
22 title: "Ubuntu UI Toolkit"22 title: "Ubuntu UI Toolkit"
2323
24 head.actions: [24 header: PageHeader {
25 Action {25 title: mainPage.title
26 text: i18n.tr('Right to Left')26 flickable: layout.columns === 1 ? widgetList : null
27 iconName: 'flash-on'27 trailingActionBar.actions: [
28 visible: !gallery.rtl28 Action {
29 onTriggered: gallery.rtl = !gallery.rtl29 text: i18n.tr('Right to Left')
30 },30 iconName: 'flash-on'
31 Action {31 visible: !gallery.rtl
32 text: i18n.tr('Left to Right')32 onTriggered: gallery.rtl = !gallery.rtl
33 iconName: 'flash-off'33 },
34 visible: gallery.rtl34 Action {
35 onTriggered: gallery.rtl = !gallery.rtl35 text: i18n.tr('Left to Right')
36 },36 iconName: 'flash-off'
37 Action {37 visible: gallery.rtl
38 text: i18n.tr('Use dark theme')38 onTriggered: gallery.rtl = !gallery.rtl
39 iconName: 'torch-on'39 },
40 visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'40 Action {
41 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'41 text: i18n.tr('Use dark theme')
42 },42 iconName: 'torch-on'
43 Action {43 visible: gallery.theme.name == 'Ubuntu.Components.Themes.Ambiance'
44 text: i18n.tr('Use light theme')44 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.SuruDark'
45 iconName: 'torch-off'45 },
46 visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'46 Action {
47 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'47 text: i18n.tr('Use light theme')
48 },48 iconName: 'torch-off'
49 Action {49 visible: gallery.theme.name == 'Ubuntu.Components.Themes.SuruDark'
50 text: i18n.tr('About')50 onTriggered: gallery.theme.name = 'Ubuntu.Components.Themes.Ambiance'
51 iconName: "info"51 },
52 onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))52 Action {
53 }53 text: i18n.tr('About')
54 ]54 iconName: "info"
55 onTriggered: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
56 },
57 Action {
58 text: i18n.tr("Deactivate mouse")
59 iconName: "non-starred"
60 visible: QuickUtils.mouseAttached
61 onTriggered: QuickUtils.mouseAttached = false
62 },
63 Action {
64 text: i18n.tr("Activate mouse")
65 iconName: "starred"
66 visible: !QuickUtils.mouseAttached
67 onTriggered: QuickUtils.mouseAttached = true
68 }
69 ]
70 }
5571
56 onActiveChanged: {72 onActiveChanged: {
57 if (layout.columns < 2) {73 if (layout.columns < 2) {
@@ -62,59 +78,65 @@
62 }78 }
63 }79 }
6480
65 Rectangle {81 UbuntuListView {
66 color: Qt.rgba(0.0, 0.0, 0.0, 0.01)82 id: widgetList
67 anchors.fill: parent83 objectName: "widgetList"
6884 anchors {
69 UbuntuListView {85 fill: parent
70 id: widgetList86 topMargin: mainPage.header.flickable ? 0 : mainPage.header.height
71 objectName: "widgetList"87 }
72 anchors.fill: parent88
73 model: WidgetsModel {}89 model: WidgetsModel {}
74 currentIndex: -190 currentIndex: -1
7591
76 onCurrentIndexChanged: openPage()92 onCurrentIndexChanged: openPage()
7793
78 function openPage() {94 function openPage() {
79 if (!mainPage.active || currentIndex < 0) return;95 if (!mainPage.active || currentIndex < 0) return;
80 var modelData = model.get(currentIndex);96 var modelData = model.get(currentIndex);
81 var source = Qt.resolvedUrl(modelData.source);97 var source = Qt.resolvedUrl(modelData.source);
82 mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});98 mainPage.pageStack.addPageToNextColumn(mainPage, source, {title: modelData.label});
83 }99 }
84100
85 delegate: ListItem {101 delegate: ListItem {
86 objectName: model.objectName102 objectName: model.objectName
87 contentItem {103 contentItem {
88 anchors.leftMargin: units.gu(2)104 anchors.leftMargin: units.gu(2)
89 anchors.rightMargin: units.gu(2)105 anchors.rightMargin: units.gu(2)
90 }106 }
91 enabled: source != ""107 enabled: source != ""
92 // Used by Autopilot108 // Used by Autopilot
93 property string text: label109 property string text: label
94 onClicked: widgetList.currentIndex = index110 onClicked: widgetList.currentIndex = index
95 Label {111 Label {
96 id: labelItem112 id: labelItem
97 anchors {113 anchors {
98 fill: parent114 fill: parent
99 rightMargin: units.gu(4)115 rightMargin: units.gu(4)
100 }116 }
101 text: label117 text: label
102 verticalAlignment: Text.AlignVCenter118 verticalAlignment: Text.AlignVCenter
103 }119 }
104 Icon {120 Icon {
105 name: "next"121 name: "next"
106 width: units.gu(2)122 width: units.gu(2)
107 height: units.gu(2)123 height: units.gu(2)
108 anchors {124 anchors {
109 verticalCenter: parent.verticalCenter125 verticalCenter: parent.verticalCenter
110 right: parent.right126 right: parent.right
111 }127 }
112 }128 }
113 }129 }
114 highlight: Rectangle {130 highlight: Rectangle {
115 color: theme.palette.selected.background131 color: theme.palette.selected.background
116 }132 }
117 highlightMoveDuration: 0133 highlightMoveDuration: 0
118 }134 }
135
136 BottomEdgeHint {
137 flickable: widgetList
138 text: i18n.tr('About')
139 iconName: "info"
140 onClicked: mainPage.pageStack.addPageToCurrentColumn(mainPage, Qt.resolvedUrl("About.qml"))
119 }141 }
120}142}
121143
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sections.qml'
--- examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-07-03 16:19:59 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Sections.qml 2015-11-17 15:49:37 +0000
@@ -19,7 +19,13 @@
1919
20Template {20Template {
21 objectName: "sectionsTemplate"21 objectName: "sectionsTemplate"
22 head.sections.model: ["first", "second", "third"]22 id: sectionsTemplate
23
24 header: PageHeader {
25 title: sectionsTemplate.title
26 sections.model: ["first", "second", "third"]
27 }
28
23 TemplateSection {29 TemplateSection {
24 title: "Sections"30 title: "Sections"
25 className: "Sections"31 className: "Sections"
2632
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Template.qml'
--- examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-07-16 09:12:55 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Template.qml 2015-11-17 15:49:37 +0000
@@ -20,20 +20,29 @@
20Page {20Page {
21 id: template21 id: template
2222
23 default property alias content: layout.children23 default property alias content: column.children
24 property alias spacing: layout.spacing24 property alias spacing: column.spacing
25
26 header: PageHeader {
27 title: template.title
28 flickable: layout.columns === 1 ? flickable : null
29 onFlickableChanged: exposed = true;
30 }
2531
26 Flickable {32 Flickable {
27 id: flickable33 id: flickable
28 objectName: "TemplateFlickable"34 objectName: "TemplateFlickable"
29 anchors.fill: parent35 anchors {
30 anchors.topMargin: units.gu(2)36 fill: parent
31 anchors.bottomMargin: units.gu(2)37 topMargin: template.header.flickable ? units.gu(2) :
32 contentHeight: layout.height38 units.gu(2) + template.header.height
39 bottomMargin: units.gu(2)
40 }
41 contentHeight: column.height
33 interactive: contentHeight > height42 interactive: contentHeight > height
3443
35 Column {44 Column {
36 id: layout45 id: column
37 spacing: units.gu(6)46 spacing: units.gu(6)
38 anchors.left: parent.left47 anchors.left: parent.left
39 anchors.right: parent.right48 anchors.right: parent.right
4049
=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-09-25 17:05:53 +0000
+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-11-17 15:49:37 +0000
@@ -103,8 +103,8 @@
103 }103 }
104 ListElement {104 ListElement {
105 objectName: "bottomEdgeHintElement"105 objectName: "bottomEdgeHintElement"
106 label: "Bottom Edge Hint"106 label: "Bottom Edge"
107 source: "BottomEdgeHint.qml"107 source: "BottomEdgePage.qml"
108 }108 }
109109
110 ListElement {110 ListElement {
111111
=== modified file 'examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot'
--- examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot 2014-11-11 10:28:08 +0000
+++ examples/ubuntu-ui-toolkit-gallery/po/ubuntu-ui-toolkit-gallery.pot 2015-11-17 15:49:37 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-ui-toolkit-gallery\n"9"Project-Id-Version: ubuntu-ui-toolkit-gallery\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-11-11 11:21+0100\n"11"POT-Creation-Date: 2015-11-05 10:04+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,13 +17,34 @@
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: About.qml:34
21msgid "About..."
22msgstr ""
23
24#: ActionBars.qml:68
25msgid "Short list"
26msgstr ""
27
28#: ActionBars.qml:79
29msgid "Number of slots"
30msgstr ""
31
32#: ActionBars.qml:92
33msgid "Long list"
34msgstr ""
35
36#: ActionBars.qml:102 Buttons.qml:91 Sections.qml:45 TextInputs.qml:90
37#: Toggles.qml:45 Toggles.qml:83
38msgid "Disabled"
39msgstr ""
40
20#: Animations.qml:2441#: Animations.qml:24
21msgid "NumberAnimation"42msgid "NumberAnimation"
22msgstr ""43msgstr ""
2344
24#: Animations.qml:28 Buttons.qml:28 Dialog.qml:29 ListItems.qml:2545#: Animations.qml:28 Buttons.qml:28 Dialog.qml:29 ListItems.qml:25
25#: ProgressBars.qml:28 ProgressBars.qml:84 Sheet.qml:40 Sheet.qml:7346#: ProgressBars.qml:29 ProgressBars.qml:85 Sheet.qml:40 Sheet.qml:73
26#: Sliders.qml:28 TextInputs.qml:4547#: Sliders.qml:28 TextInputs.qml:46
27msgid "Standard"48msgid "Standard"
28msgstr ""49msgstr ""
2950
@@ -47,8 +68,7 @@
47msgid "Sleepy"68msgid "Sleepy"
48msgstr ""69msgstr ""
4970
50#: Buttons.qml:32 Buttons.qml:41 Buttons.qml:51 Buttons.qml:71 Buttons.qml:7971#: Buttons.qml:32 Buttons.qml:41 Buttons.qml:77 Buttons.qml:85 Buttons.qml:95
51#: Buttons.qml:89
52msgid "Call"72msgid "Call"
53msgstr ""73msgstr ""
5474
@@ -56,27 +76,28 @@
56msgid "Stroke"76msgid "Stroke"
57msgstr ""77msgstr ""
5878
59#: Buttons.qml:47 UbuntuShape.qml:2879#: Buttons.qml:47 Icons.qml:54
60msgid "Color"80msgid "Color"
61msgstr ""81msgstr ""
6282
63#: Buttons.qml:57 Buttons.qml:114 ListItems.qml:4383#: Buttons.qml:53
84#, qt-format
85msgid "Call %1"
86msgstr ""
87
88#: Buttons.qml:63 Buttons.qml:120 ListItems.qml:43
64msgid "Icon"89msgid "Icon"
65msgstr ""90msgstr ""
6691
67#: Buttons.qml:66 Buttons.qml:12892#: Buttons.qml:72 Buttons.qml:134
68msgid "Icon+Text"93msgid "Icon+Text"
69msgstr ""94msgstr ""
7095
71#: Buttons.qml:85 TextInputs.qml:88 Toggles.qml:45 Toggles.qml:8396#: Buttons.qml:105 OptionSelectors.qml:41
72msgid "Disabled"
73msgstr ""
74
75#: Buttons.qml:99 OptionSelectors.qml:34
76msgid "Collapsed"97msgid "Collapsed"
77msgstr ""98msgstr ""
7899
79#: Buttons.qml:142 ListItems.qml:120 OptionSelectors.qml:43100#: Buttons.qml:148 ListItems.qml:120 OptionSelectors.qml:47
80msgid "Expanded"101msgid "Expanded"
81msgstr ""102msgstr ""
82103
@@ -108,22 +129,22 @@
108msgid "Purple"129msgid "Purple"
109msgstr ""130msgstr ""
110131
111#: Dialog.qml:32 Popover.qml:45 Sheet.qml:43 Sheet.qml:76132#: Dialog.qml:32 Popover.qml:42 Sheet.qml:43 Sheet.qml:76
112msgid "Open"133msgid "Open"
113msgstr ""134msgstr ""
114135
115#: Icons.qml:30136#: Icons.qml:29
116msgid "Scaling"137msgid "Scaling"
117msgstr ""138msgstr ""
118139
119#: Icons.qml:55140#: Icons.qml:79
120msgid "Colorization"
121msgstr ""
122
123#: Icons.qml:80
124msgid "Theme"141msgid "Theme"
125msgstr ""142msgstr ""
126143
144#: ListItemLayouts.qml:208 NewListItems.qml:79
145msgid "Leading and trailing actions"
146msgstr ""
147
127#: ListItems.qml:28 ListItems.qml:36 ListItems.qml:46 ListItems.qml:60148#: ListItems.qml:28 ListItems.qml:36 ListItems.qml:46 ListItems.qml:60
128#: ListItems.qml:66 ListItems.qml:76 ListItems.qml:85 ListItems.qml:94149#: ListItems.qml:66 ListItems.qml:76 ListItems.qml:85 ListItems.qml:94
129#: ListItems.qml:160 ListItems.qml:173 ListItems.qml:193150#: ListItems.qml:160 ListItems.qml:173 ListItems.qml:193
@@ -159,30 +180,26 @@
159msgstr ""180msgstr ""
160181
161#: ListItems.qml:95 ListItems.qml:113 ListItems.qml:122 ListItems.qml:132182#: ListItems.qml:95 ListItems.qml:113 ListItems.qml:122 ListItems.qml:132
162#: ListItems.qml:161 ListItems.qml:176 OptionSelectors.qml:35183#: ListItems.qml:161 ListItems.qml:176 OptionSelectors.qml:33
163#: OptionSelectors.qml:45 OptionSelectors.qml:56 OptionSelectors.qml:86184#: OptionSelectors.qml:84 OptionSelectors.qml:99
164#: OptionSelectors.qml:101
165msgid "Value 1"185msgid "Value 1"
166msgstr ""186msgstr ""
167187
168#: ListItems.qml:96 ListItems.qml:114 ListItems.qml:123 ListItems.qml:133188#: ListItems.qml:96 ListItems.qml:114 ListItems.qml:123 ListItems.qml:133
169#: ListItems.qml:162 ListItems.qml:177 OptionSelectors.qml:36189#: ListItems.qml:162 ListItems.qml:177 OptionSelectors.qml:85
170#: OptionSelectors.qml:46 OptionSelectors.qml:57 OptionSelectors.qml:87190#: OptionSelectors.qml:100
171#: OptionSelectors.qml:102
172msgid "Value 2"191msgid "Value 2"
173msgstr ""192msgstr ""
174193
175#: ListItems.qml:97 ListItems.qml:115 ListItems.qml:124 ListItems.qml:134194#: ListItems.qml:97 ListItems.qml:115 ListItems.qml:124 ListItems.qml:134
176#: ListItems.qml:163 ListItems.qml:178 OptionSelectors.qml:37195#: ListItems.qml:163 ListItems.qml:178 OptionSelectors.qml:86
177#: OptionSelectors.qml:47 OptionSelectors.qml:58 OptionSelectors.qml:88196#: OptionSelectors.qml:101
178#: OptionSelectors.qml:103
179msgid "Value 3"197msgid "Value 3"
180msgstr ""198msgstr ""
181199
182#: ListItems.qml:98 ListItems.qml:116 ListItems.qml:125 ListItems.qml:135200#: ListItems.qml:98 ListItems.qml:116 ListItems.qml:125 ListItems.qml:135
183#: ListItems.qml:164 ListItems.qml:179 OptionSelectors.qml:38201#: ListItems.qml:164 ListItems.qml:179 OptionSelectors.qml:87
184#: OptionSelectors.qml:48 OptionSelectors.qml:59 OptionSelectors.qml:89202#: OptionSelectors.qml:102
185#: OptionSelectors.qml:104
186msgid "Value 4"203msgid "Value 4"
187msgstr ""204msgstr ""
188205
@@ -190,35 +207,35 @@
190msgid "Item selector"207msgid "Item selector"
191msgstr ""208msgstr ""
192209
193#: ListItems.qml:112 TextInputs.qml:114210#: ListItems.qml:112 TextInputs.qml:117
194msgid "Expanding"211msgid "Expanding"
195msgstr ""212msgstr ""
196213
197#: ListItems.qml:129 OptionSelectors.qml:53214#: ListItems.qml:129 OptionSelectors.qml:54
198msgid "Multiple Selection"215msgid "Multiple Selection"
199msgstr ""216msgstr ""
200217
201#: ListItems.qml:139 OptionSelectors.qml:64218#: ListItems.qml:139 OptionSelectors.qml:62
202msgid "Custom Model"219msgid "Custom Model"
203msgstr ""220msgstr ""
204221
205#: ListItems.qml:165 ListItems.qml:180 OptionSelectors.qml:90222#: ListItems.qml:165 ListItems.qml:180 OptionSelectors.qml:88
206#: OptionSelectors.qml:105223#: OptionSelectors.qml:103
207msgid "Value 5"224msgid "Value 5"
208msgstr ""225msgstr ""
209226
210#: ListItems.qml:166 ListItems.qml:181 OptionSelectors.qml:91227#: ListItems.qml:166 ListItems.qml:181 OptionSelectors.qml:89
211#: OptionSelectors.qml:106228#: OptionSelectors.qml:104
212msgid "Value 6"229msgid "Value 6"
213msgstr ""230msgstr ""
214231
215#: ListItems.qml:167 ListItems.qml:182 OptionSelectors.qml:92232#: ListItems.qml:167 ListItems.qml:182 OptionSelectors.qml:90
216#: OptionSelectors.qml:107233#: OptionSelectors.qml:105
217msgid "Value 7"234msgid "Value 7"
218msgstr ""235msgstr ""
219236
220#: ListItems.qml:168 ListItems.qml:183 OptionSelectors.qml:93237#: ListItems.qml:168 ListItems.qml:183 OptionSelectors.qml:91
221#: OptionSelectors.qml:108238#: OptionSelectors.qml:106
222msgid "Value 8"239msgid "Value 8"
223msgstr ""240msgstr ""
224241
@@ -254,59 +271,118 @@
254msgid "Expandable"271msgid "Expandable"
255msgstr ""272msgstr ""
256273
274#: NewListItems.qml:39
275msgid "Colored"
276msgstr ""
277
278#: NewListItems.qml:42
279msgid "Highlight color"
280msgstr ""
281
282#: NewListItems.qml:71
283msgid "Leading actions"
284msgstr ""
285
286#: NewListItems.qml:75
287msgid "Trailing actions"
288msgstr ""
289
290#: NewListItems.qml:84
291msgid "Custom action delegates"
292msgstr ""
293
294#: NewListItems.qml:111
295msgid "Edit"
296msgstr ""
297
298#: NewListItems.qml:114
299msgid "Move"
300msgstr ""
301
302#: NewListItems.qml:163
303msgid "Basic"
304msgstr ""
305
306#: NewListItems.qml:163 NewListItems.qml:168 NewListItems.qml:169
307#: NewListItems.qml:213 NewListItems.qml:214
308msgid "Colored divider"
309msgstr ""
310
311#: NewListItems.qml:163
312msgid "Immutable"
313msgstr ""
314
315#: NewListItems.qml:163 NewListItems.qml:170 NewListItems.qml:215
316msgid "No divider"
317msgstr ""
318
257#: OptionSelectors.qml:24319#: OptionSelectors.qml:24
258msgid "Option Selector"320msgid "Option Selector"
259msgstr ""321msgstr ""
260322
261#: OptionSelectors.qml:85323#: OptionSelectors.qml:34
324msgid "This is the second value"
325msgstr ""
326
327#: OptionSelectors.qml:35
328msgid ""
329"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy "
330"nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."
331msgstr ""
332
333#: OptionSelectors.qml:36
334msgid "Once upon a time there was a story nobody told."
335msgstr ""
336
337#: OptionSelectors.qml:83
262msgid "Custom container height"338msgid "Custom container height"
263msgstr ""339msgstr ""
264340
265#: OptionSelectors.qml:98341#: OptionSelectors.qml:96
266msgid "No initial selection, scrollable."342msgid "No initial selection, scrollable."
267msgstr ""343msgstr ""
268344
269#: Pickers.qml:29345#: Pickers.qml:31
270msgid "Linear"346msgid "Linear"
271msgstr ""347msgstr ""
272348
273#: Pickers.qml:48349#: Pickers.qml:63
274msgid "Circular"350msgid "Circular"
275msgstr ""351msgstr ""
276352
277#: Pickers.qml:73 ProgressBars.qml:48353#: Pickers.qml:100 ProgressBars.qml:49
278msgid "Infinite"354msgid "Infinite"
279msgstr ""355msgstr ""
280356
281#: Pickers.qml:110357#: Pickers.qml:137
282msgid "Clock"358msgid "Clock"
283msgstr ""359msgstr ""
284360
285#: Pickers.qml:147361#: Pickers.qml:174
286msgid "Overlay"362msgid "Overlay"
287msgstr ""363msgstr ""
288364
289#: Popover.qml:41365#: Popover.qml:38
290msgid "Flickable"366msgid "Flickable"
291msgstr ""367msgstr ""
292368
293#: Popover.qml:77369#: Popover.qml:74
294msgid "Action #1"370msgid "Action #1"
295msgstr ""371msgstr ""
296372
297#: Popover.qml:81373#: Popover.qml:78
298msgid "Action #2"374msgid "Action #2"
299msgstr ""375msgstr ""
300376
301#: Popover.qml:85377#: Popover.qml:82
302msgid "Action #3"378msgid "Action #3"
303msgstr ""379msgstr ""
304380
305#: Popover.qml:89381#: Popover.qml:86
306msgid "Action #4"382msgid "Action #4"
307msgstr ""383msgstr ""
308384
309#: Popover.qml:93385#: Popover.qml:90
310msgid "Action #5"386msgid "Action #5"
311msgstr ""387msgstr ""
312388
@@ -314,14 +390,22 @@
314msgid "Progress Bar"390msgid "Progress Bar"
315msgstr ""391msgstr ""
316392
317#: ProgressBars.qml:58393#: ProgressBars.qml:59
318msgid "No label"394msgid "No label"
319msgstr ""395msgstr ""
320396
321#: ProgressBars.qml:80397#: ProgressBars.qml:81
322msgid "Activity Indicator"398msgid "Activity Indicator"
323msgstr ""399msgstr ""
324400
401#: ProportionalShape.qml:28
402msgid "Sizes"
403msgstr ""
404
405#: Sections.qml:34
406msgid "Enabled"
407msgstr ""
408
325#: Sheet.qml:28409#: Sheet.qml:28
326msgid "The visual style of the Sheet is early work and thus clunky looking."410msgid "The visual style of the Sheet is early work and thus clunky looking."
327msgstr ""411msgstr ""
@@ -330,7 +414,7 @@
330msgid "Title"414msgid "Title"
331msgstr ""415msgstr ""
332416
333#: Sliders.qml:36 Sliders.qml:51 Sliders.qml:68417#: Sliders.qml:36 Sliders.qml:51 Sliders.qml:68 Sliders.qml:93
334#, qt-format418#, qt-format
335msgid "Actual value: %1"419msgid "Actual value: %1"
336msgstr ""420msgstr ""
@@ -343,43 +427,51 @@
343msgid "Range"427msgid "Range"
344msgstr ""428msgstr ""
345429
346#: Styles.qml:27430#: Sliders.qml:74
347msgid "Switch between old and new style header"431msgid "Labels"
348msgstr ""432msgstr ""
349433
350#: Styles.qml:40434#: Sliders.qml:85
351msgid "Switch between themes"435msgid "Small"
352msgstr ""436msgstr ""
353437
354#: TextInputs.qml:49438#: Sliders.qml:87
439msgid "Medium"
440msgstr ""
441
442#: Sliders.qml:89
443msgid "Large"
444msgstr ""
445
446#: TextInputs.qml:50
355msgid "Type me in..."447msgid "Type me in..."
356msgstr ""448msgstr ""
357449
358#: TextInputs.qml:55450#: TextInputs.qml:56
359msgid "Password"451msgid "Password"
360msgstr ""452msgstr ""
361453
362#: TextInputs.qml:66454#: TextInputs.qml:67
363msgid "Numbers"455msgid "Numbers"
364msgstr ""456msgstr ""
365457
366#: TextInputs.qml:77458#: TextInputs.qml:78
367msgid "Read-only"459msgid "Read-only"
368msgstr ""460msgstr ""
369461
370#: TextInputs.qml:81462#: TextInputs.qml:82
371msgid "Nobody type here"463msgid "Nobody type here"
372msgstr ""464msgstr ""
373465
374#: TextInputs.qml:92466#: TextInputs.qml:94
375msgid "No interaction allowed"467msgid "No interaction allowed"
376msgstr ""468msgstr ""
377469
378#: TextInputs.qml:104470#: TextInputs.qml:107
379msgid "Default"471msgid "Default"
380msgstr ""472msgstr ""
381473
382#: TextInputs.qml:126474#: TextInputs.qml:129
383msgid "Rich Text"475msgid "Rich Text"
384msgstr ""476msgstr ""
385477
@@ -391,22 +483,18 @@
391msgid "Checked"483msgid "Checked"
392msgstr ""484msgstr ""
393485
394#: Toolbar.qml:30486#: UbuntuShape.qml:28
395msgid "Share"487msgid "Aspect"
396msgstr ""488msgstr ""
397489
398#: Toolbar.qml:46490#: UbuntuShape.qml:73
399msgid "See below"491msgid "Radius"
400msgstr ""492msgstr ""
401493
402#: UbuntuShape.qml:49494#: UbuntuShape.qml:115
403msgid "Image"495msgid "Image"
404msgstr ""496msgstr ""
405497
406#: UbuntuShape.qml:64498#: UbuntuShape.qml:134
407msgid "Radius"499msgid "Gradient"
408msgstr ""
409
410#: UbuntuShape.qml:97
411msgid "Sizes"
412msgstr ""500msgstr ""
413501
=== modified file 'po/ubuntu-ui-toolkit.pot'
--- po/ubuntu-ui-toolkit.pot 2014-11-06 15:50:17 +0000
+++ po/ubuntu-ui-toolkit.pot 2015-11-17 15:49:37 +0000
@@ -8,19 +8,140 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-ui-toolkit\n"9"Project-Id-Version: ubuntu-ui-toolkit\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-11-05 14:29+0100\n"11"POT-Creation-Date: 2015-11-05 10:05+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"15"Language: \n"
16"MIME-Version: 1.0\n"16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=UTF-8\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20#: Ubuntu/Components/ListItems/Empty.qml:41320
21#: Ubuntu/Components/1.2/TextInputPopover.qml:29
22#: Ubuntu/Components/1.3/TextInputPopover.qml:29
23msgid "Select All"
24msgstr ""
25
26#: Ubuntu/Components/1.2/TextInputPopover.qml:36
27#: Ubuntu/Components/1.3/TextInputPopover.qml:36
28msgid "Cut"
29msgstr ""
30
31#: Ubuntu/Components/1.2/TextInputPopover.qml:48
32#: Ubuntu/Components/1.3/TextInputPopover.qml:48
33msgid "Copy"
34msgstr ""
35
36#: Ubuntu/Components/1.2/TextInputPopover.qml:57
37#: Ubuntu/Components/1.3/TextInputPopover.qml:57
38msgid "Paste"
39msgstr ""
40
41#: Ubuntu/Components/1.2/ToolbarItems.qml:143
42#: Ubuntu/Components/1.3/ToolbarItems.qml:143
43msgid "Back"
44msgstr ""
45
46#: Ubuntu/Components/ListItems/1.2/Empty.qml:398
47#: Ubuntu/Components/ListItems/1.3/Empty.qml:398
21msgid "Delete"48msgid "Delete"
22msgstr ""49msgstr ""
2350
51#: Ubuntu/Components/plugin/adapters/dbuspropertywatcher_p.cpp:51
52msgid "No service/path specified"
53msgstr ""
54
55#: Ubuntu/Components/plugin/adapters/dbuspropertywatcher_p.cpp:69
56#, qt-format
57msgid "Invalid bus type: %1."
58msgstr ""
59
60#. TRANSLATORS: Time based "this is happening/happened now"
61#: Ubuntu/Components/plugin/i18n.cpp:268
62msgid "Now"
63msgstr ""
64
65#: Ubuntu/Components/plugin/i18n.cpp:275
66#, qt-format
67msgid "%1 minute ago"
68msgid_plural "%1 minutes ago"
69msgstr[0] ""
70msgstr[1] ""
71
72#: Ubuntu/Components/plugin/i18n.cpp:277
73#, qt-format
74msgid "%1 minute"
75msgid_plural "%1 minutes"
76msgstr[0] ""
77msgstr[1] ""
78
79#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
80#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
81#: Ubuntu/Components/plugin/i18n.cpp:284
82msgid "h:mm ap"
83msgstr ""
84
85#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
86#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
87#: Ubuntu/Components/plugin/i18n.cpp:287
88msgid "HH:mm"
89msgstr ""
90
91#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
92#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
93#: Ubuntu/Components/plugin/i18n.cpp:293
94msgid "'Yesterday 'h:mm ap"
95msgstr ""
96
97#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
98#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
99#: Ubuntu/Components/plugin/i18n.cpp:296
100msgid "'Yesterday 'HH:mm"
101msgstr ""
102
103#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
104#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
105#: Ubuntu/Components/plugin/i18n.cpp:302
106msgid "'Tomorrow 'h:mm ap"
107msgstr ""
108
109#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
110#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
111#: Ubuntu/Components/plugin/i18n.cpp:305
112msgid "'Tomorrow 'HH:mm"
113msgstr ""
114
115#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
116#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
117#: Ubuntu/Components/plugin/i18n.cpp:312
118msgid "ddd' 'h:mm ap"
119msgstr ""
120
121#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
122#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
123#: Ubuntu/Components/plugin/i18n.cpp:315
124msgid "ddd' 'HH:mm"
125msgstr ""
126
127#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
128#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
129#: Ubuntu/Components/plugin/i18n.cpp:322
130msgid "ddd d MMM' 'h:mm ap"
131msgstr ""
132
133#. TRANSLATORS: Please translated these to your locale datetime format using the format specified by
134#. https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2
135#: Ubuntu/Components/plugin/i18n.cpp:325
136msgid "ddd d MMM' 'HH:mm"
137msgstr ""
138
139#: Ubuntu/Components/plugin/privates/listitemdragarea.cpp:122
140msgid ""
141"ListView has no ViewItems.dragUpdated() signal handler implemented. No "
142"dragging will be possible."
143msgstr ""
144
24#: Ubuntu/Components/plugin/statesaverbackend_p.cpp:176145#: Ubuntu/Components/plugin/statesaverbackend_p.cpp:176
25#, qt-format146#, qt-format
26msgid ""147msgid ""
@@ -33,13 +154,13 @@
33msgid "property \"%1\" does not exist or is not writable for object %2"154msgid "property \"%1\" does not exist or is not writable for object %2"
34msgstr ""155msgstr ""
35156
36#: Ubuntu/Components/plugin/ucalarm.cpp:42157#: Ubuntu/Components/plugin/ucalarm.cpp:41
37#: Ubuntu/Components/plugin/ucalarm.cpp:136158#: Ubuntu/Components/plugin/ucalarm.cpp:643
38msgid "Alarm"159msgid "Alarm"
39msgstr ""160msgstr ""
40161
41#: Ubuntu/Components/plugin/ucalarm.cpp:684162#: Ubuntu/Components/plugin/ucalarm.cpp:635
42#: Ubuntu/Components/plugin/ucalarm.cpp:716163#: Ubuntu/Components/plugin/ucalarm.cpp:667
43msgid "Alarm has a pending operation."164msgid "Alarm has a pending operation."
44msgstr ""165msgstr ""
45166
@@ -66,10 +187,28 @@
66msgid "%1 is expecting additional arguments: %2"187msgid "%1 is expecting additional arguments: %2"
67msgstr ""188msgstr ""
68189
69#: Ubuntu/Components/plugin/ucmousefilters.cpp:1064190#: Ubuntu/Components/plugin/uclistitemstyle.cpp:145
191msgid "consider overriding swipeEvent() slot!"
192msgstr ""
193
194#: Ubuntu/Components/plugin/uclistitemstyle.cpp:165
195msgid "consider overriding rebound() slot!"
196msgstr ""
197
198#: Ubuntu/Components/plugin/ucmousefilters.cpp:1065
70msgid "Ignoring AfterItem priority for InverseMouse filters."199msgid "Ignoring AfterItem priority for InverseMouse filters."
71msgstr ""200msgstr ""
72201
202#: Ubuntu/Components/plugin/ucserviceproperties.cpp:77
203msgid "Changing connection parameters forbidden."
204msgstr ""
205
206#: Ubuntu/Components/plugin/ucserviceproperties.cpp:160
207#, qt-format
208msgid ""
209"Binding detected on property '%1' will be removed by the service updates."
210msgstr ""
211
73#: Ubuntu/Components/plugin/ucstatesaver.cpp:46212#: Ubuntu/Components/plugin/ucstatesaver.cpp:46
74msgid "Warning: attachee must have an ID. State will not be saved."213msgid "Warning: attachee must have an ID. State will not be saved."
75msgstr ""214msgstr ""
@@ -80,61 +219,63 @@
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"
81msgstr ""220msgstr ""
82221
83#: Ubuntu/Components/plugin/ucstatesaver.cpp:102222#: Ubuntu/Components/plugin/ucstatesaver.cpp:107
84#, qt-format223#, qt-format
85msgid ""224msgid ""
86"All the parents must have an id.\n"225"All the parents must have an id.\n"
87"State saving disabled for %1, class %2"226"State saving disabled for %1, class %2"
88msgstr ""227msgstr ""
89228
90#: Ubuntu/Components/plugin/uctheme.cpp:233229#: Ubuntu/Components/plugin/uctheme.cpp:208
91msgid "Theme not found: "230#, qt-format
92msgstr ""231msgid "Theme not found: \"%1\""
93232msgstr ""
94#: Ubuntu/Components/Popups/ComposerSheet.qml:80233
234#: Ubuntu/Components/plugin/uctheme.cpp:539
235msgid "Not a Palette component."
236msgstr ""
237
238#: Ubuntu/Components/plugin/ucviewitemsattached.cpp:462
239msgid "Dragging mode requires ListView"
240msgstr ""
241
242#: Ubuntu/Components/plugin/ucviewitemsattached.cpp:468
243msgid ""
244"Dragging is only supported when using a QAbstractItemModel, ListModel or "
245"list."
246msgstr ""
247
248#: Ubuntu/Components/Popups/1.2/ComposerSheet.qml:78
249#: Ubuntu/Components/Popups/1.3/ComposerSheet.qml:78
95msgid "Cancel"250msgid "Cancel"
96msgstr ""251msgstr ""
97252
98#: Ubuntu/Components/Popups/ComposerSheet.qml:90253#: Ubuntu/Components/Popups/1.2/ComposerSheet.qml:88
254#: Ubuntu/Components/Popups/1.3/ComposerSheet.qml:88
99msgid "Confirm"255msgid "Confirm"
100msgstr ""256msgstr ""
101257
102#: Ubuntu/Components/Popups/DefaultSheet.qml:89258#: Ubuntu/Components/Popups/1.2/DefaultSheet.qml:85
259#: Ubuntu/Components/Popups/1.3/DefaultSheet.qml:85
103msgid "Close"260msgid "Close"
104msgstr ""261msgstr ""
105262
106#: Ubuntu/Components/Popups/DefaultSheet.qml:99263#: Ubuntu/Components/Popups/1.2/DefaultSheet.qml:95
264#: Ubuntu/Components/Popups/1.3/DefaultSheet.qml:95
107msgid "Done"265msgid "Done"
108msgstr ""266msgstr ""
109267
110#: Ubuntu/Components/TextInputPopover.qml:27268#: Ubuntu/Components/Themes/Ambiance/1.2/ProgressBarStyle.qml:51
111msgid "Select All"269#: Ubuntu/Components/Themes/Ambiance/1.3/ProgressBarStyle.qml:50
112msgstr ""
113
114#: Ubuntu/Components/TextInputPopover.qml:33
115msgid "Cut"
116msgstr ""
117
118#: Ubuntu/Components/TextInputPopover.qml:42
119msgid "Copy"
120msgstr ""
121
122#: Ubuntu/Components/TextInputPopover.qml:49
123msgid "Paste"
124msgstr ""
125
126#: Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml:57
127msgid "In Progress"270msgid "In Progress"
128msgstr ""271msgstr ""
129272
130#: Ubuntu/Components/Themes/Ambiance/PullToRefreshStyle.qml:28273#: Ubuntu/Components/Themes/Ambiance/1.2/PullToRefreshStyle.qml:28
274#: Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml:28
131msgid "Release to refresh..."275msgid "Release to refresh..."
132msgstr ""276msgstr ""
133277
134#: Ubuntu/Components/Themes/Ambiance/PullToRefreshStyle.qml:28278#: Ubuntu/Components/Themes/Ambiance/1.2/PullToRefreshStyle.qml:28
279#: Ubuntu/Components/Themes/Ambiance/1.3/PullToRefreshStyle.qml:28
135msgid "Pull to refresh..."280msgid "Pull to refresh..."
136msgstr ""281msgstr ""
137
138#: Ubuntu/Components/ToolbarItems.qml:142
139msgid "Back"
140msgstr ""
141282
=== modified file 'src/Ubuntu/Components/1.2/MainViewBase.qml'
--- src/Ubuntu/Components/1.2/MainViewBase.qml 2015-04-30 08:32:44 +0000
+++ src/Ubuntu/Components/1.2/MainViewBase.qml 2015-11-17 15:49:37 +0000
@@ -48,12 +48,12 @@
4848
49 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-1171249 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
50 */50 */
51 property string theme: (ColorUtils.luminance(backgroundColor) >= 0.85) ?51 property string themeName: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
52 "Ambiance" : "SuruDark"52 "Ambiance" : "SuruDark"
53 onThemeChanged: {53 onThemeNameChanged: {
54 // only change the theme if the current one is a system one.54 // only change the theme if the current one is a system one.
55 if (theme !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {55 if (themeName !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
56 Theme.name = "Ubuntu.Components.Themes.%1".arg(theme);56 Theme.name = "Ubuntu.Components.Themes.%1".arg(themeName);
57 }57 }
58 }58 }
59 }59 }
6060
=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-10-14 15:44:15 +0000
+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2015-11-17 15:49:37 +0000
@@ -166,6 +166,11 @@
166 and the preferred width is set to 40 grid units. This width is set every time166 and the preferred width is set to 40 grid units. This width is set every time
167 the layout is activated.167 the layout is activated.
168168
169 When a \l Page with the \l Page::header property set is added to an
170 AdaptivePageLayout, the AdaptivePageLayout will synchronize the height of that
171 header with the height of the headers in other columns, i.e., the height of
172 each of the headers will be set to the maximum implicitHeight of all the headers.
173
169 \sa PageStack, PageColumnsLayout, PageColumn174 \sa PageStack, PageColumnsLayout, PageColumn
170*/175*/
171176
@@ -452,7 +457,17 @@
452 // replace page holder's child457 // replace page holder's child
453 var holder = body.children[targetColumn];458 var holder = body.children[targetColumn];
454 holder.detachCurrentPage();459 holder.detachCurrentPage();
455 holder.attachPage(pageWrapper);460 holder.attachPage(pageWrapper); // sets pageWrapper.pageHolder
461
462 // set the back action for Page.header:
463 var page = pageWrapper.object;
464 if (page && page.hasOwnProperty("header") && page.header &&
465 page.header.hasOwnProperty("navigationActions")) {
466 // Page.header is an instance of PageHeader.
467 var backAction = backActionComponent.createObject(
468 pageWrapper, { 'wrapper': pageWrapper } );
469 page.header.navigationActions = [ backAction ] ;
470 }
456 }471 }
457472
458 function getWrapper(page) {473 function getWrapper(page) {
@@ -644,6 +659,42 @@
644 }659 }
645 }660 }
646661
662 // An instance will be added to each Page with
663 Component {
664 id: backActionComponent
665
666 Action {
667 // used when the Page has a Page.header property set.
668 id: backAction
669 objectName: "apl_back_action"
670 iconName: "back"
671 text: "Back"
672
673 // set when backAction is created.
674 property PageWrapper wrapper
675 onTriggered: layout.removePages(wrapper.object)
676
677 visible: {
678 var parentWrapper;
679 try {
680 parentWrapper = d.tree.parent(wrapper);
681 } catch(err) {
682 // Root node has no parent node.
683 return false;
684 }
685 if (!wrapper.pageHolder) {
686 // columns are being re-arranged.
687 return false;
688 }
689 // wrapper.column is the virtual column, pageHolder.column the actual column.
690 var column = wrapper.pageHolder.column;
691 var nextInColumn = d.tree.top(column, column < d.columns - 1, 1);
692 return parentWrapper === nextInColumn;
693 }
694 }
695 }
696
697
647 // Page holder component, can have only one Page as child at a time, all stacked pages698 // Page holder component, can have only one Page as child at a time, all stacked pages
648 // will be parented into hiddenPool699 // will be parented into hiddenPool
649 Component {700 Component {
@@ -670,6 +721,15 @@
670 property var page: pageWrapper ? pageWrapper.object : null721 property var page: pageWrapper ? pageWrapper.object : null
671 property bool customHeader: page && page.hasOwnProperty("header") &&722 property bool customHeader: page && page.hasOwnProperty("header") &&
672 page.header723 page.header
724 onPageChanged: body.updateHeaderHeight(0)
725 Connections {
726 target: page
727 onHeaderChanged: body.updateHeaderHeight(0)
728 }
729 Connections {
730 target: page ? page.header : null
731 onImplicitHeightChanged: body.updateHeaderHeight(page.header.implicitHeight)
732 }
673733
674 // prevent the pages from taking the app header height into account.734 // prevent the pages from taking the app header height into account.
675 __propagated: null735 __propagated: null
@@ -692,6 +752,8 @@
692 }752 }
693 }753 }
694754
755 // subHeader is to be deprecated in UITK 1.4 and will be replaced
756 // by the Page.header property (introduced in 1.3).
695 property alias head: subHeader757 property alias head: subHeader
696 StyledItem {758 StyledItem {
697 id: subHeader759 id: subHeader
@@ -703,7 +765,6 @@
703 height: body.headerHeight765 height: body.headerHeight
704766
705 styleName: "PageHeadStyle"767 styleName: "PageHeadStyle"
706 theme.version: Ubuntu.toolkitVersion
707 objectName: "Header" + column768 objectName: "Header" + column
708769
709 property real preferredHeight: subHeader.__styleInstance ?770 property real preferredHeight: subHeader.__styleInstance ?
@@ -795,8 +856,8 @@
795 onXChanged: holder.Layout.preferredWidth = x856 onXChanged: holder.Layout.preferredWidth = x
796 }857 }
797858
798 function attachPage(page) {859 function attachPage(wrapper) {
799 pageWrapper = page;860 pageWrapper = wrapper;
800 pageWrapper.parent = holderBody;861 pageWrapper.parent = holderBody;
801 pageWrapper.pageHolder = holder;862 pageWrapper.pageHolder = holder;
802 pageWrapper.active = true;863 pageWrapper.active = true;
@@ -854,17 +915,32 @@
854 property real headerHeight: 0915 property real headerHeight: 0
855916
856 function updateHeaderHeight(newHeight) {917 function updateHeaderHeight(newHeight) {
918 var page;
919 var i;
857 if (newHeight > body.headerHeight) {920 if (newHeight > body.headerHeight) {
858 body.headerHeight = newHeight;921 body.headerHeight = newHeight;
859 } else {922 } else {
860 var h = 0;923 var h = 0;
861 var subHeight = 0;924 var subHeight = 0;
862 for (var i = 0; i < children.length; i++) {925 for (i = 0; i < children.length; i++) {
863 subHeight = children[i].head.preferredHeight;926 page = children[i].page;
927 if (page && page.hasOwnProperty("header") && page.header) {
928 subHeight = page.header.implicitHeight;
929 } else {
930 subHeight = children[i].head.preferredHeight;
931 }
864 if (subHeight > h) h = subHeight;932 if (subHeight > h) h = subHeight;
865 }933 }
866 body.headerHeight = h;934 body.headerHeight = h;
867 }935 }
936
937 // Update all the Page.header heights.
938 for (i = 0; i < body.children.length; i++) {
939 page = body.children[i].page;
940 if (page && page.hasOwnProperty("header") && page.header) {
941 page.header.height = headerHeight;
942 }
943 }
868 }944 }
869945
870 onChildrenChanged: {946 onChildrenChanged: {
871947
=== modified file 'src/Ubuntu/Components/1.3/AnimatedItem.qml'
--- src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-04-25 08:54:58 +0000
+++ src/Ubuntu/Components/1.3/AnimatedItem.qml 2015-11-17 15:49:37 +0000
@@ -25,14 +25,13 @@
25*/25*/
2626
27import QtQuick 2.427import QtQuick 2.4
28import Ubuntu.Components 1.3 as Toolkit28import Ubuntu.Components 1.3
2929
30Toolkit.StyledItem {30StyledItem {
31 id: root31 id: root
32 /*!32 /*!
33 \deprecated33 \deprecated
34 Specifies whether the component is on the visible area of the Flickable or not.34 Specifies whether the component is on the visible area of the Flickable or not.
35 */35 */
36 theme.version: Toolkit.Ubuntu.toolkitVersion
37 property bool onScreen: true36 property bool onScreen: true
38}37}
3938
=== modified file 'src/Ubuntu/Components/1.3/AppHeader.qml'
--- src/Ubuntu/Components/1.3/AppHeader.qml 2015-10-01 21:23:04 +0000
+++ src/Ubuntu/Components/1.3/AppHeader.qml 2015-11-17 15:49:37 +0000
@@ -151,6 +151,5 @@
151 }151 }
152 }152 }
153153
154 theme.version: Components.Ubuntu.toolkitVersion
155 styleName: "PageHeadStyle"154 styleName: "PageHeadStyle"
156}155}
157156
=== removed file 'src/Ubuntu/Components/1.3/BottomEdgeHint.qml'
--- src/Ubuntu/Components/1.3/BottomEdgeHint.qml 2015-09-21 14:44:13 +0000
+++ src/Ubuntu/Components/1.3/BottomEdgeHint.qml 1970-01-01 00:00:00 +0000
@@ -1,155 +0,0 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20/*!
21 \qmlabstract BottomEdgeHint
22 \inqmlmodule Ubuntu.Components 1.3
23 \ingroup ubuntu
24 \brief The BottomEdgeHint shows the availability of extra features
25 available from the bottom edge of the application.
26
27 It displays either a label or an icon at the bottom of the application.
28
29 It has 2 states: hidden or visible. When hidden, part of it is still visible
30 to hint at the existence of the bottom edge.
31
32 When used with a mouse it acts like a button. The typical action associated
33 with clicking on it should be revealing the extra features provided by the
34 bottom edge.
35
36 Example:
37 \qml
38 BottomEdgeHint {
39 id: bottomEdgeHint
40 text: i18n.tr("Favorites")
41 onClicked: revealBottomEdge()
42 }
43 \endqml
44
45*/
46Item {
47 id: bottomEdgeHint
48
49 anchors {
50 bottom: parent.bottom
51 bottomMargin: bottomEdgeHint.state == "Hidden" ? -bottomEdgeHint.height + units.gu(1.5) : 0
52 horizontalCenter: parent.horizontalCenter
53 Behavior on bottomMargin { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
54 }
55
56 width: label.paintedWidth + units.gu(7)
57 height: units.gu(4)
58
59 /*!
60 This handler is called when there is a mouse click on the BottomEdgeHint
61 and the BottomEdgeHint is not disabled.
62 */
63 signal clicked()
64
65 Keys.onEnterPressed: clicked()
66 Keys.onReturnPressed: clicked()
67
68 /*!
69 The label displayed by the BottomEdgeHint.
70 */
71 property string text
72
73 /*!
74 The icon displayed by the BottomEdgeHint.
75
76 This is the URL of any image file.
77 If both iconSource and iconName are defined, iconName will be ignored.
78 */
79 property url iconSource: iconName ? "image://theme/" + iconName : ""
80
81 /*!
82 The icon associated with the BottomEdgeHint in the icon theme.
83
84 If both iconSource and iconName are defined, iconName will be ignored.
85 */
86 property string iconName
87
88 /*!
89 BottomEdgeHint can take 2 states of visibility: "Hidden" and "Visible".
90
91 When "Visible", the full hint with its content is shown.
92
93 When "Hidden", only part of the hint is visible leaving more space for application content.
94 */
95 property string state: "Visible"
96
97 MouseArea {
98 id: mouseArea
99 anchors.fill: parent
100 hoverEnabled: true
101 onEntered: bottomEdgeHint.state = "Visible"
102 onClicked: {
103 Haptics.play();
104 bottomEdgeHint.clicked();
105 mouse.accepted = false;
106 }
107 }
108
109 clip: true
110
111 UbuntuShape {
112 id: background
113
114 anchors {
115 bottom: parent.bottom
116 horizontalCenter: bottomEdgeHint.horizontalCenter
117 bottomMargin: -units.gu(1)
118 }
119
120 width: bottomEdgeHint.width - 2 * hoverExpansion
121 height: bottomEdgeHint.height + units.gu(1) - hoverExpansion
122
123 property real hoverExpansion: mouseArea.containsMouse ? 0 : units.gu(0.5)
124 Behavior on hoverExpansion { UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } }
125
126 backgroundColor: theme.palette.normal.overlay
127 }
128
129 Label {
130 id: label
131
132 anchors {
133 top: parent.top
134 horizontalCenter: parent.horizontalCenter
135 }
136 text: icon.name ? "" : bottomEdgeHint.text
137 textSize: Label.Medium
138 height: bottomEdgeHint.height
139 verticalAlignment: Text.AlignVCenter
140 horizontalAlignment: Text.AlignHCenter
141 }
142
143 Icon {
144 id: icon
145
146 name: bottomEdgeHint.iconName
147 anchors {
148 bottom: parent.bottom
149 bottomMargin: units.gu(0.5)
150 horizontalCenter: parent.horizontalCenter
151 }
152 width: height
153 height: units.gu(2)
154 }
155}
1560
=== modified file 'src/Ubuntu/Components/1.3/Button.qml'
--- src/Ubuntu/Components/1.3/Button.qml 2015-08-20 06:56:44 +0000
+++ src/Ubuntu/Components/1.3/Button.qml 2015-11-17 15:49:37 +0000
@@ -121,6 +121,5 @@
121 */121 */
122 property string iconPosition: "left"122 property string iconPosition: "left"
123123
124 theme.version: Ubuntu.toolkitVersion
125 styleName: "ButtonStyle"124 styleName: "ButtonStyle"
126}125}
127126
=== modified file 'src/Ubuntu/Components/1.3/CheckBox.qml'
--- src/Ubuntu/Components/1.3/CheckBox.qml 2015-09-16 16:58:51 +0000
+++ src/Ubuntu/Components/1.3/CheckBox.qml 2015-11-17 15:49:37 +0000
@@ -49,6 +49,5 @@
49 */49 */
50 onTriggered: checked = !checked50 onTriggered: checked = !checked
5151
52 theme.version: Ubuntu.toolkitVersion
53 styleName: "CheckBoxStyle"52 styleName: "CheckBoxStyle"
54}53}
5554
=== modified file 'src/Ubuntu/Components/1.3/OptionSelector.qml'
--- src/Ubuntu/Components/1.3/OptionSelector.qml 2015-09-07 10:05:58 +0000
+++ src/Ubuntu/Components/1.3/OptionSelector.qml 2015-11-17 15:49:37 +0000
@@ -225,7 +225,6 @@
225 right: parent.right225 right: parent.right
226 }226 }
227 state: optionSelector.expanded ? "expanded" : "collapsed"227 state: optionSelector.expanded ? "expanded" : "collapsed"
228 theme.version: Toolkit.Ubuntu.toolkitVersion
229 styleName: "OptionSelectorStyle"228 styleName: "OptionSelectorStyle"
230 states: [ State {229 states: [ State {
231 name: "expanded"230 name: "expanded"
232231
=== removed file 'src/Ubuntu/Components/1.3/Page.qdoc'
--- src/Ubuntu/Components/1.3/Page.qdoc 2015-04-25 08:54:58 +0000
+++ src/Ubuntu/Components/1.3/Page.qdoc 1970-01-01 00:00:00 +0000
@@ -1,132 +0,0 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype Page
19 \inqmlmodule Ubuntu.Components 1.1
20 \ingroup ubuntu
21 \brief A page is the basic Item that must be used inside the \l MainView,
22 \l PageStack and \l Tabs.
23 Anchors and height of a Page are automatically determined to align with
24 the header of the \l MainView, but can be overridden.
25
26 \l MainView provides a header for Pages it includes.
27 The text and actions of the header are determined by the \l title
28 and \l head properties of the page:
29
30 \qml
31 import QtQuick 2.4
32 import Ubuntu.Components 1.2
33
34 MainView {
35 width: units.gu(48)
36 height: units.gu(60)
37
38 Page {
39 title: i18n.tr("Example page")
40
41 Label {
42 anchors.centerIn: parent
43 text: i18n.tr("Hello world!")
44 }
45
46 head.actions: [
47 Action {
48 iconName: "search"
49 text: i18n.tr("Search")
50 },
51 Action {
52 iconName: "contacts"
53 text: i18n.tr("Contacts")
54 }
55 ]
56 }
57 }
58 \endqml
59 See \l MainView for more examples on how to use the header.
60 Advanced navigation structures can be created by adding Pages to a \l PageStack or \l Tabs.
61
62 The Page automatically anchors to the left and bottom of its parent. The width of the Page
63 will be the full width of its parent \l MainView or \l PageStack or \l Tab,
64 and the height will adapt to leave space for the header when needed. It is possible to
65 use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
66 so that the Page can control its width and height.
67*/
68
69/*!
70 \qmlproperty string Page::title
71 The title of the page. Will be shown in the header of the \l MainView.
72 If the page is used inside a \l Tab, the default title is the \l Tab title.
73 For a Page not inside a \l Tab, the default title is an empty string.
74 */
75
76/*!
77 \qmlproperty Item Page::tools
78 \deprecated
79 The toolbar items associated with this Page.
80 DEPRECATED. Use \b head.actions instead.
81 */
82
83/*!
84 \qmlproperty PageHeadConfiguration Page::head
85 \readonly
86 Configuration of the header for this page.
87 */
88
89/*!
90 \qmlproperty Flickable Page::flickable
91 Optional flickable that controls the header. This property
92 is automatically set to the first child of the page that is Flickable
93 and anchors to the top of the page or fills the page. For example:
94 \qml
95 import QtQuick 2.4
96 import Ubuntu.Components 1.2
97
98 MainView {
99 width: units.gu(30)
100 height: units.gu(50)
101 Page {
102 id: page
103 title: "example"
104 //flickable: null // uncomment for a fixed header
105 Flickable {
106 id: content
107 anchors.fill: parent
108 contentHeight: units.gu(70)
109 Label {
110 text: "hello"
111 anchors.centerIn: parent
112 }
113 }
114 }
115 }
116 \endqml
117 In this example, page.flickable will automatically be set to content because it is
118 a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
119 hide the header.
120
121 Set this property to null to avoid automatic flickable detection, which disables hiding
122 of the header by scrolling in the Flickable. In cases where a flickable should control the header,
123 but it is not automatically detected, the flickable property can be set.
124 */
125
126/*!
127 \qmlproperty list<Action> Page::actions
128 Local actions. These actions will be made available outside the application
129 (for example, to HUD) when the Page is active. For actions that are always available
130 when the application is running, use the actions property of \l MainView.
131 For actions in the header, see \l head.
132*/
1330
=== modified file 'src/Ubuntu/Components/1.3/Page.qml'
--- src/Ubuntu/Components/1.3/Page.qml 2015-10-15 10:07:59 +0000
+++ src/Ubuntu/Components/1.3/Page.qml 2015-11-17 15:49:37 +0000
@@ -19,8 +19,55 @@
19import "pageUtils.js" as Utils19import "pageUtils.js" as Utils
2020
21/*!21/*!
22 \internal22 \qmltype Page
23 Documentation is in Page.qdoc23 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu
25 \brief A page is the basic Item that must be used inside the \l MainView,
26 \l PageStack and \l Tabs.
27 Anchors and height of a Page are automatically determined to align with
28 the header of the \l MainView, but can be overridden.
29
30
31 \l MainView provides a header for Pages it includes if no
32 \l header property was set.
33 The text and actions of the header are determined by the \l title
34 and \l head properties of the page:
35
36 \qml
37 import QtQuick 2.4
38 import Ubuntu.Components 1.2
39
40 MainView {
41 width: units.gu(48)
42 height: units.gu(60)
43
44 Page {
45 title: i18n.tr("Example page")
46
47 Label {
48 anchors.centerIn: parent
49 text: i18n.tr("Hello world!")
50 }
51
52 head.actions: [
53 Action {
54 iconName: "search"
55 text: i18n.tr("Search")
56 },
57 Action {
58 iconName: "contacts"
59 text: i18n.tr("Contacts")
60 }
61 ]
62 }
63 }
64 \endqml
65
66 The Page automatically anchors to the left and bottom of its parent. The width of the Page
67 will be the full width of its parent \l MainView or \l PageStack or \l Tab,
68 and the height will adapt to leave space for the header when needed. It is possible to
69 use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
70 so that the Page can control its width and height.
24*/71*/
25PageTreeNode {72PageTreeNode {
26 id: page73 id: page
@@ -35,13 +82,13 @@
3582
36 /*!83 /*!
37 The header property for this page. Setting this property will reparent the84 The header property for this page. Setting this property will reparent the
38 header to the page and disable the \l Mainview's application header.85 header to the page and disable the \l MainView's application header.
39 \qml86 \qml
40 Page {87 Page {
41 id: page88 id: page
42 title: "Page with header"89 title: "Page with header"
43 header: PageHeader {90 header: PageHeader {
44 title: page.header91 title: page.title
45 trailingActionBar.actions: [92 trailingActionBar.actions: [
46 Action { iconName: "settings" },93 Action { iconName: "settings" },
47 Action { iconName: "info" }94 Action { iconName: "info" }
@@ -49,17 +96,65 @@
49 }96 }
50 }97 }
51 \endqml98 \endqml
99 \sa PageHeader
52 */100 */
53 property Item header101 property Item header
54 onHeaderChanged: internal.updateHeader()102 onHeaderChanged: internal.updateHeader()
55 Component.onCompleted: internal.updateHeader()103 Component.onCompleted: internal.updateHeader()
56104
105 /*! \internal */
57 isLeaf: true106 isLeaf: true
107
108 /*!
109 The title of the page. Will be shown in the header of the \l MainView.
110 If the page is used inside a \l Tab, the default title is the \l Tab title.
111 For a Page not inside a \l Tab, the default title is an empty string.
112 */
58 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""113 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""
114
115 /*!
116 Optional flickable that controls the MainView header. This property
117 is automatically set to the first child of the page that is Flickable
118 and anchors to the top of the page or fills the page. For example:
119 \qml
120 import QtQuick 2.4
121 import Ubuntu.Components 1.2
122
123 MainView {
124 width: units.gu(30)
125 height: units.gu(50)
126 Page {
127 id: page
128 title: "example"
129 //flickable: null // uncomment for a fixed header
130 Flickable {
131 id: content
132 anchors.fill: parent
133 contentHeight: units.gu(70)
134 Label {
135 text: "hello"
136 anchors.centerIn: parent
137 }
138 }
139 }
140 }
141 \endqml
142 In this example, page.flickable will automatically be set to content because it is
143 a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
144 hide the header.
145
146 Set this property to null to avoid automatic flickable detection, which disables hiding
147 of the header by scrolling in the Flickable. In cases where a flickable should control the header,
148 but it is not automatically detected, the flickable property can be set.
149 */
59 property Flickable flickable: Utils.getFlickableChild(page)150 property Flickable flickable: Utils.getFlickableChild(page)
60151
61 /*!152 /*!
62 \qmlproperty PageHeadConfiguration head153 \qmlproperty PageHeadConfiguration Page::head
154 \readonly
155 \deprecated
156 Configuration of the header for this page.
157 Deprecated: This configuration will be replaced by setting the \l header property.
63 */158 */
64 readonly property alias head: headerConfig159 readonly property alias head: headerConfig
65 Toolkit13.PageHeadConfiguration {160 Toolkit13.PageHeadConfiguration {
66161
=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
--- src/Ubuntu/Components/1.3/PageHeader.qml 2015-10-15 14:17:25 +0000
+++ src/Ubuntu/Components/1.3/PageHeader.qml 2015-11-17 15:49:37 +0000
@@ -40,8 +40,8 @@
40Header {40Header {
41 id: header41 id: header
42 anchors {42 anchors {
43 left: parent.left43 left: parent ? parent.left : undefined
44 right: parent.right44 right: parent ? parent.right : undefined
45 }45 }
4646
47 /*!47 /*!
@@ -109,9 +109,25 @@
109 titleLoader.sourceComponent = __styleInstance.titleComponent;109 titleLoader.sourceComponent = __styleInstance.titleComponent;
110 }110 }
111 }111 }
112
113 // When the style changes, make sure that the titleLoader loads
114 // the new titleComponent.
115 property Item styleInstance: __styleInstance
116 onStyleInstanceChanged: updateContents()
112 }117 }
113118
114 /*!119 /*!
120 The actions to be shown in the leading action bar.
121 This property is automatically set by the
122 \l AdaptivePageLayout and other navigation components to configure the
123 back action for the \l Page.
124 Application developers should not set this property, because the
125 value may be overridden by Ubuntu components that have navigation.
126 Instead, set \l leadingActionBar's actions property.
127 */
128 property list<Action> navigationActions
129
130 /*!
115 \qmlproperty ActionBar leadingActionBar131 \qmlproperty ActionBar leadingActionBar
116 The \l ActionBar for the leading navigation actions.132 The \l ActionBar for the leading navigation actions.
117 Example:133 Example:
@@ -125,6 +141,9 @@
125 ]141 ]
126 }142 }
127 \endqml143 \endqml
144 The default value of \l leadingActionBar actions is
145 \l navigationActions, but that value can be changed to show
146 different actions in front of the title.
128 See \l ActionBar.147 See \l ActionBar.
129 */148 */
130 readonly property alias leadingActionBar: leading149 readonly property alias leadingActionBar: leading
@@ -138,7 +157,8 @@
138 height: header.__styleInstance.contentHeight157 height: header.__styleInstance.contentHeight
139 numberOfSlots: 1158 numberOfSlots: 1
140 delegate: header.__styleInstance.defaultActionDelegate159 delegate: header.__styleInstance.defaultActionDelegate
141 visible: actions.length > 0160 actions: header.navigationActions
161 visible: leading.width > 0 // at least 1 visible action
142 StyleHints {162 StyleHints {
143 overflowIconName: "navigation-menu"163 overflowIconName: "navigation-menu"
144 }164 }
@@ -182,7 +202,7 @@
182 height: header.__styleInstance.contentHeight202 height: header.__styleInstance.contentHeight
183 numberOfSlots: 3203 numberOfSlots: 3
184 delegate: header.__styleInstance.defaultActionDelegate204 delegate: header.__styleInstance.defaultActionDelegate
185 visible: actions.length > 0205 visible: trailing.width > 0 // at least 1 visible action
186 }206 }
187207
188 /*!208 /*!
@@ -203,6 +223,5 @@
203 height: visible ? implicitHeight : 0223 height: visible ? implicitHeight : 0
204 }224 }
205225
206 theme.version: Ubuntu.toolkitVersion
207 styleName: "PageHeaderStyle"226 styleName: "PageHeaderStyle"
208}227}
209228
=== modified file 'src/Ubuntu/Components/1.3/PageStack.qml'
--- src/Ubuntu/Components/1.3/PageStack.qml 2015-07-10 07:42:38 +0000
+++ src/Ubuntu/Components/1.3/PageStack.qml 2015-11-17 15:49:37 +0000
@@ -16,6 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import "../1.2/stack.js" as Stack18import "../1.2/stack.js" as Stack
19import Ubuntu.Components 1.3
1920
20/*!21/*!
21 \qmltype PageStack22 \qmltype PageStack
@@ -171,6 +172,13 @@
171 } else {172 } else {
172 internal.pushWrapperObject();173 internal.pushWrapperObject();
173 }174 }
175 // set the back action for Page.header:
176 if (pageObject && pageObject.hasOwnProperty("header") && pageObject.header &&
177 pageObject.header.hasOwnProperty("navigationActions")) {
178 // Page.header is an instance of PageHeader.
179 pageObject.header.navigationActions = [ backAction ];
180 }
181
174 return pageObject;182 return pageObject;
175 }183 }
176184
@@ -206,6 +214,16 @@
206 internal.stackUpdated();214 internal.stackUpdated();
207 }215 }
208216
217 Action {
218 // used when the Page has a Page.header property set.
219 id: backAction
220 visible: pageStack.depth > 0
221 iconName: "back"
222 text: "Back"
223 onTriggered: pageStack.pop()
224 objectName: "pagestack_back_action"
225 }
226
209 QtObject {227 QtObject {
210 id: internal228 id: internal
211 property Item headStyle: (pageStack.__propagated229 property Item headStyle: (pageStack.__propagated
212230
=== modified file 'src/Ubuntu/Components/1.3/PageTreeNode.qml'
--- src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-10-14 19:18:58 +0000
+++ src/Ubuntu/Components/1.3/PageTreeNode.qml 2015-11-17 15:49:37 +0000
@@ -148,6 +148,4 @@
148 node.parentNode = internal.getParentPageTreeNode(node);148 node.parentNode = internal.getParentPageTreeNode(node);
149 }149 }
150 }150 }
151
152 theme.version: Toolkit.Ubuntu.toolkitVersion
153}151}
154152
=== modified file 'src/Ubuntu/Components/1.3/PageWrapper.qml'
--- src/Ubuntu/Components/1.3/PageWrapper.qml 2015-09-24 15:28:58 +0000
+++ src/Ubuntu/Components/1.3/PageWrapper.qml 2015-11-17 15:49:37 +0000
@@ -46,7 +46,7 @@
46 property bool canDestroy: false46 property bool canDestroy: false
4747
48 /*!48 /*!
49 Column number in MultiColumnView.49 Column number in AdaptivePageLayout.
50 */50 */
51 property int column: 051 property int column: 0
5252
@@ -61,7 +61,7 @@
61 property Item parentWrapper61 property Item parentWrapper
6262
63 /*!63 /*!
64 Page holder in MultiColumnView64 Page holder in AdaptivePageLayout.
65 */65 */
66 property Item pageHolder66 property Item pageHolder
6767
6868
=== modified file 'src/Ubuntu/Components/1.3/ProgressBar.qml'
--- src/Ubuntu/Components/1.3/ProgressBar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/ProgressBar.qml 2015-11-17 15:49:37 +0000
@@ -70,6 +70,5 @@
70 */70 */
71 property bool showProgressPercentage: true71 property bool showProgressPercentage: true
7272
73 theme.version: Ubuntu.toolkitVersion
74 styleName: "ProgressBarStyle"73 styleName: "ProgressBarStyle"
75}74}
7675
=== modified file 'src/Ubuntu/Components/1.3/PullToRefresh.qml'
--- src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/PullToRefresh.qml 2015-11-17 15:49:37 +0000
@@ -222,7 +222,6 @@
222 */222 */
223 signal refresh()223 signal refresh()
224224
225 theme.version: Ubuntu.toolkitVersion
226 styleName: "PullToRefreshStyle"225 styleName: "PullToRefreshStyle"
227 implicitHeight: __styleInstance.implicitHeight226 implicitHeight: __styleInstance.implicitHeight
228 anchors {227 anchors {
229228
=== modified file 'src/Ubuntu/Components/1.3/Scrollbar.qml'
--- src/Ubuntu/Components/1.3/Scrollbar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/Scrollbar.qml 2015-11-17 15:49:37 +0000
@@ -146,6 +146,5 @@
146 }146 }
147 }147 }
148148
149 theme.version: Toolkit.Ubuntu.toolkitVersion
150 styleName: "ScrollbarStyle"149 styleName: "ScrollbarStyle"
151}150}
152151
=== modified file 'src/Ubuntu/Components/1.3/Sections.qml'
--- src/Ubuntu/Components/1.3/Sections.qml 2015-07-14 12:49:58 +0000
+++ src/Ubuntu/Components/1.3/Sections.qml 2015-11-17 15:49:37 +0000
@@ -29,7 +29,6 @@
29StyledItem {29StyledItem {
30 id: sections30 id: sections
31 styleName: "SectionsStyle"31 styleName: "SectionsStyle"
32 theme.version: Ubuntu.toolkitVersion
3332
34 /*!33 /*!
35 List of actions that represent the sections.34 List of actions that represent the sections.
3635
=== modified file 'src/Ubuntu/Components/1.3/Slider.qml'
--- src/Ubuntu/Components/1.3/Slider.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/Slider.qml 2015-11-17 15:49:37 +0000
@@ -206,6 +206,5 @@
206 onLiveValueChanged: if (isPressed) slider.requestFocus(Qt.MouseFocusReason)206 onLiveValueChanged: if (isPressed) slider.requestFocus(Qt.MouseFocusReason)
207 }207 }
208208
209 theme.version: Toolkit.Ubuntu.toolkitVersion
210 styleName: "SliderStyle"209 styleName: "SliderStyle"
211}210}
212211
=== modified file 'src/Ubuntu/Components/1.3/TabBar.qml'
--- src/Ubuntu/Components/1.3/TabBar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/TabBar.qml 2015-11-17 15:49:37 +0000
@@ -97,7 +97,6 @@
9797
98 implicitHeight: units.gu(7.5)98 implicitHeight: units.gu(7.5)
99 activeFocusOnPress: true99 activeFocusOnPress: true
100 theme.version: Toolkit.Ubuntu.toolkitVersion
101 styleName: "TabBarStyle"100 styleName: "TabBarStyle"
102101
103 QtObject {102 QtObject {
104103
=== modified file 'src/Ubuntu/Components/1.3/TextArea.qml'
--- src/Ubuntu/Components/1.3/TextArea.qml 2015-09-07 10:05:58 +0000
+++ src/Ubuntu/Components/1.3/TextArea.qml 2015-11-17 15:49:37 +0000
@@ -886,6 +886,5 @@
886 }886 }
887 }887 }
888888
889 theme.version: Ubuntu.Ubuntu.toolkitVersion
890 styleName: "TextAreaStyle"889 styleName: "TextAreaStyle"
891}890}
892891
=== modified file 'src/Ubuntu/Components/1.3/TextCursor.qml'
--- src/Ubuntu/Components/1.3/TextCursor.qml 2015-10-30 13:38:52 +0000
+++ src/Ubuntu/Components/1.3/TextCursor.qml 2015-11-17 15:49:37 +0000
@@ -41,7 +41,6 @@
41 handler.main.cursorDelegate :41 handler.main.cursorDelegate :
42 __styleInstance.cursorDelegate42 __styleInstance.cursorDelegate
4343
44 theme.version: Ubuntu.Ubuntu.toolkitVersion
45 styleName: "TextCursorStyle"44 styleName: "TextCursorStyle"
4645
47 objectName: "textCursor"46 objectName: "textCursor"
4847
=== modified file 'src/Ubuntu/Components/1.3/TextField.qml'
--- src/Ubuntu/Components/1.3/TextField.qml 2015-09-07 10:05:58 +0000
+++ src/Ubuntu/Components/1.3/TextField.qml 2015-11-17 15:49:37 +0000
@@ -1013,6 +1013,5 @@
1013 cursorPosition = 0;1013 cursorPosition = 0;
1014 }1014 }
10151015
1016 theme.version: Ubuntu.Ubuntu.toolkitVersion
1017 styleName: "TextFieldStyle"1016 styleName: "TextFieldStyle"
1018}1017}
10191018
=== modified file 'src/Ubuntu/Components/1.3/TextInputPopover.qml'
--- src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-09-16 05:28:29 +0000
+++ src/Ubuntu/Components/1.3/TextInputPopover.qml 2015-11-17 15:49:37 +0000
@@ -86,7 +86,6 @@
86 width: Math.max(units.gu(5), implicitWidth) + units.gu(2)86 width: Math.max(units.gu(5), implicitWidth) + units.gu(2)
87 height: units.gu(6)87 height: units.gu(6)
88 action: actions[modelData]88 action: actions[modelData]
89 theme.version: Ubuntu.toolkitVersion
90 styleName: "ToolbarButtonStyle"89 styleName: "ToolbarButtonStyle"
91 }90 }
92 }91 }
9392
=== modified file 'src/Ubuntu/Components/1.3/Toolbar.qml'
--- src/Ubuntu/Components/1.3/Toolbar.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/Toolbar.qml 2015-11-17 15:49:37 +0000
@@ -135,7 +135,6 @@
135 property bool opened: toolbar.opened135 property bool opened: toolbar.opened
136 property bool animating: toolbar.animating136 property bool animating: toolbar.animating
137137
138 theme.version: Toolkit.Ubuntu.toolkitVersion
139 styleName: "ToolbarStyle"138 styleName: "ToolbarStyle"
140 }139 }
141140
142141
=== modified file 'src/Ubuntu/Components/1.3/ToolbarButton.qml'
--- src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-05-21 10:50:35 +0000
+++ src/Ubuntu/Components/1.3/ToolbarButton.qml 2015-11-17 15:49:37 +0000
@@ -84,6 +84,5 @@
84 height: parent ? parent.height : undefined84 height: parent ? parent.height : undefined
85 width: units.gu(5)85 width: units.gu(5)
8686
87 theme.version: Ubuntu.toolkitVersion
88 styleName: "ToolbarButtonStyle"87 styleName: "ToolbarButtonStyle"
89}88}
9089
=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
--- src/Ubuntu/Components/ComponentModule.pro 2015-10-02 22:48:13 +0000
+++ src/Ubuntu/Components/ComponentModule.pro 2015-11-17 15:49:37 +0000
@@ -132,7 +132,6 @@
132 1.3/UbuntuListView.qml \132 1.3/UbuntuListView.qml \
133 1.3/UbuntuNumberAnimation.qml \133 1.3/UbuntuNumberAnimation.qml \
134 1.3/ListItemPopover.qml \134 1.3/ListItemPopover.qml \
135 1.3/BottomEdgeHint.qml \
136 1.3/PageColumn.qml \135 1.3/PageColumn.qml \
137 1.3/PageColumnsLayout.qml \136 1.3/PageColumnsLayout.qml \
138 1.3/ProgressionSlot.qml \137 1.3/ProgressionSlot.qml \
@@ -141,7 +140,6 @@
141OTHER_FILES+= qmldir \140OTHER_FILES+= qmldir \
142 1.3/CrossFadeImage.qdoc \141 1.3/CrossFadeImage.qdoc \
143 1.3/UbuntuListView11.qdoc \142 1.3/UbuntuListView11.qdoc \
144 1.3/Page.qdoc \
145 1.3/PageHeadConfiguration.qdoc \143 1.3/PageHeadConfiguration.qdoc \
146 1.3/MainView.qdoc \144 1.3/MainView.qdoc \
147 1.3/Icon.qdoc145 1.3/Icon.qdoc
148146
=== modified file 'src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml'
--- src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/ListItems/1.3/ItemSelector.qml 2015-11-17 15:49:37 +0000
@@ -216,7 +216,6 @@
216 right: parent.right216 right: parent.right
217 }217 }
218 state: itemSelector.expanded ? "expanded" : "collapsed"218 state: itemSelector.expanded ? "expanded" : "collapsed"
219 theme.version: Ubuntu.toolkitVersion
220 styleName: "ListItemOptionSelectorStyle"219 styleName: "ListItemOptionSelectorStyle"
221220
222 states: [ State {221 states: [ State {
223222
=== modified file 'src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml'
--- src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/ListItems/1.3/ProgressionVisual.qml 2015-11-17 15:49:37 +0000
@@ -25,6 +25,5 @@
25 property bool showSplit: false25 property bool showSplit: false
26 property real splitMargin26 property real splitMargin
2727
28 theme.version: Ubuntu.toolkitVersion
29 styleName: "ProgressionVisualStyle"28 styleName: "ProgressionVisualStyle"
30}29}
3130
=== modified file 'src/Ubuntu/Components/Pickers/1.3/DatePicker.qml'
--- src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Pickers/1.3/DatePicker.qml 2015-11-17 15:49:37 +0000
@@ -420,7 +420,6 @@
420 }420 }
421 }421 }
422422
423 theme.version: Ubuntu.toolkitVersion
424 styleName: "DatePickerStyle"423 styleName: "DatePickerStyle"
425 Binding {424 Binding {
426 target: __styleInstance425 target: __styleInstance
427426
=== modified file 'src/Ubuntu/Components/Pickers/1.3/Dialer.qml'
--- src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Pickers/1.3/Dialer.qml 2015-11-17 15:49:37 +0000
@@ -145,7 +145,6 @@
145 implicitHeight: size145 implicitHeight: size
146 activeFocusOnPress: true146 activeFocusOnPress: true
147147
148 theme.version: Ubuntu.toolkitVersion
149 styleName: "DialerStyle"148 styleName: "DialerStyle"
150149
151 Item {150 Item {
152151
=== modified file 'src/Ubuntu/Components/Pickers/1.3/DialerHand.qml'
--- src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Pickers/1.3/DialerHand.qml 2015-11-17 15:49:37 +0000
@@ -143,7 +143,6 @@
143 width: parent.width143 width: parent.width
144 height: parent.height144 height: parent.height
145 activeFocusOnPress: true145 activeFocusOnPress: true
146 theme.version: Ubuntu.toolkitVersion
147 styleName: "DialerHandStyle"146 styleName: "DialerHandStyle"
148147
149 /*! \internal */148 /*! \internal */
150149
=== modified file 'src/Ubuntu/Components/Pickers/1.3/Picker.qml'
--- src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-09-24 20:05:52 +0000
+++ src/Ubuntu/Components/Pickers/1.3/Picker.qml 2015-11-17 15:49:37 +0000
@@ -165,7 +165,6 @@
165165
166 activeFocusOnPress: true166 activeFocusOnPress: true
167167
168 theme.version: Ubuntu.toolkitVersion
169 styleName: "PickerStyle"168 styleName: "PickerStyle"
170169
171 /*! \internal */170 /*! \internal */
172171
=== modified file 'src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml'
--- src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-09-24 20:05:52 +0000
+++ src/Ubuntu/Components/Pickers/1.3/PickerDelegate.qml 2015-11-17 15:49:37 +0000
@@ -45,7 +45,6 @@
45 internal.itemList.currentIndex = index;45 internal.itemList.currentIndex = index;
46 }46 }
4747
48 theme.version: Ubuntu.toolkitVersion
49 styleName: "PickerDelegateStyle"48 styleName: "PickerDelegateStyle"
5049
51 QtObject {50 QtObject {
5251
=== modified file 'src/Ubuntu/Components/Popups/1.3/Dialog.qml'
--- src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-09-21 14:44:13 +0000
+++ src/Ubuntu/Components/Popups/1.3/Dialog.qml 2015-11-17 15:49:37 +0000
@@ -213,7 +213,6 @@
213 }213 }
214 }214 }
215215
216 theme.version: Ubuntu.toolkitVersion
217 styleName: "DialogForegroundStyle"216 styleName: "DialogForegroundStyle"
218 }217 }
219}218}
220219
=== modified file 'src/Ubuntu/Components/Popups/1.3/Popover.qml'
--- src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-08-12 19:53:20 +0000
+++ src/Ubuntu/Components/Popups/1.3/Popover.qml 2015-11-17 15:49:37 +0000
@@ -241,7 +241,6 @@
241 signal showCompleted()241 signal showCompleted()
242 signal hideCompleted()242 signal hideCompleted()
243243
244 theme.version: Ubuntu.toolkitVersion
245 styleName: "PopoverForegroundStyle"244 styleName: "PopoverForegroundStyle"
246 }245 }
247246
248247
=== modified file 'src/Ubuntu/Components/Popups/1.3/SheetBase.qml'
--- src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-05-22 13:54:38 +0000
+++ src/Ubuntu/Components/Popups/1.3/SheetBase.qml 2015-11-17 15:49:37 +0000
@@ -109,7 +109,6 @@
109 }109 }
110 }110 }
111111
112 theme.version: Ubuntu.toolkitVersion
113 styleName: "SheetForegroundStyle"112 styleName: "SheetForegroundStyle"
114 }113 }
115}114}
116115
=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
--- src/Ubuntu/Components/Styles/Styles.pro 2015-10-08 21:19:56 +0000
+++ src/Ubuntu/Components/Styles/Styles.pro 2015-11-17 15:49:37 +0000
@@ -13,7 +13,3 @@
13load(ubuntu_qml_module)13load(ubuntu_qml_module)
1414
15OTHER_FILES+=qmldir15OTHER_FILES+=qmldir
16
17
18
19
2016
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-04-24 14:52:19 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.2/OptionSelectorStyle.qml 2015-11-17 15:49:37 +0000
@@ -20,6 +20,7 @@
2020
21Item {21Item {
22 id: ambianceStyle22 id: ambianceStyle
23 objectName: "OptionSelector12"
2324
24 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")25 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
25 property url tick: Qt.resolvedUrl("../artwork/tick.png")26 property url tick: Qt.resolvedUrl("../artwork/tick.png")
2627
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-10-15 14:17:25 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-11-17 15:49:37 +0000
@@ -34,7 +34,7 @@
34 */34 */
35 defaultDelegate: AbstractButton {35 defaultDelegate: AbstractButton {
36 style: IconButtonStyle { }36 style: IconButtonStyle { }
37 objectName: action.objectName + "_action_button"37 objectName: action.objectName + "_button"
38 height: parent ? parent.height : undefined38 height: parent ? parent.height : undefined
39 action: modelData39 action: modelData
40 }40 }
@@ -88,7 +88,7 @@
88 iconSource: actionBarStyle.overflowIconSource88 iconSource: actionBarStyle.overflowIconSource
89 iconName: actionBarStyle.overflowIconName89 iconName: actionBarStyle.overflowIconName
90 text: actionBarStyle.overflowText90 text: actionBarStyle.overflowText
91 objectName: "overflow"91 objectName: "overflow_action"
92 visible: numberOfSlots.requested > numberOfSlots.available92 visible: numberOfSlots.requested > numberOfSlots.available
93 onTriggered: {93 onTriggered: {
94 var overflowButton = actionsRepeater.itemAt(actionsRepeater.count - 1);94 var overflowButton = actionsRepeater.itemAt(actionsRepeater.count - 1);
9595
=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 2015-11-17 15:49:37 +0000
@@ -0,0 +1,149 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 1.3
20
21Item {
22 id: bottomEdgeHintStyle
23 implicitWidth: styledItem.parent.width
24 implicitHeight: units.gu(4)
25
26 readonly property BottomEdgeHint hint: styledItem
27
28 // translate hint status into state
29 state: {
30 switch (hint.status) {
31 case BottomEdgeHint.Hidden: return "Hidden";
32 case BottomEdgeHint.Inactive: return "Inactive"
33 case BottomEdgeHint.Active: return "Active"
34 case BottomEdgeHint.Locked: return "Locked"
35 }
36 }
37
38 states: [
39 State {
40 name: "Inactive"
41 extend: ""
42 },
43 State {
44 name: "Active"
45 PropertyChanges {
46 target: h1
47 anchors.verticalCenterOffset: styledItem.height / 2
48 }
49 PropertyChanges {
50 target: h2
51 anchors.topMargin: 0
52 }
53 },
54 State {
55 name: "Hidden"
56 PropertyChanges {
57 target: styledItem
58 opacity: 0.0
59 }
60 },
61 State {
62 name: "Locked"
63 PropertyChanges {
64 target: h1
65 anchors.verticalCenterOffset: styledItem.height / 2
66 }
67 PropertyChanges {
68 target: h2
69 anchors.topMargin: 0
70 }
71 }
72 ]
73 transitions: [
74 Transition {
75 from: "*"
76 to: "Active"
77 reversible: true
78 UbuntuNumberAnimation {
79 targets: [h1, h2]
80 properties: "anchors.verticalCenterOffset, anchors.topMargin"
81 }
82 },
83 Transition {
84 from: "*"
85 to: "Hidden"
86 reversible: true
87 UbuntuNumberAnimation {
88 target: styledItem
89 property: "opacity"
90 duration: UbuntuAnimation.SlowDuration
91 }
92 }
93 ]
94
95 clip: true
96
97 Icon {
98 id: h1
99 width: units.gu(2)
100 height: width
101 anchors {
102 centerIn: parent
103 topMargin: styledItem.height
104 }
105 name: "up"
106 }
107
108 Rectangle {
109 id: h2
110 anchors {
111 top: parent.top
112 left: parent.left
113 right: parent.right
114 topMargin: styledItem.height
115 }
116 height: styledItem.height
117 color: theme.palette.normal.overlay
118 ThinDivider {
119 anchors.top: parent.top
120 }
121
122 Row {
123 anchors {
124 top: parent.top
125 bottom: parent.bottom
126 horizontalCenter: parent.horizontalCenter
127 }
128 spacing: units.gu(1)
129 Icon {
130 id: icon
131 name: styledItem.iconName
132 source: styledItem.iconSource
133 width: height
134 height: units.gu(2)
135 anchors.verticalCenter: parent.verticalCenter
136 color: theme.palette.normal.overlayText
137 }
138 Label {
139 id: label
140 text: styledItem.text
141 textSize: Label.Medium
142 color: theme.palette.normal.overlayText
143 height: styledItem.height
144 anchors.verticalCenter: parent.verticalCenter
145 verticalAlignment: Text.AlignVCenter
146 }
147 }
148 }
149}
0150
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-07-22 13:14:43 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-11-17 15:49:37 +0000
@@ -20,6 +20,7 @@
2020
21Item {21Item {
22 id: ambianceStyle22 id: ambianceStyle
23 objectName: "OptionSelector13"
2324
24 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")25 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
25 property url tick: Qt.resolvedUrl("../artwork/tick.png")26 property url tick: Qt.resolvedUrl("../artwork/tick.png")
2627
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-10-13 21:55:11 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2015-11-17 15:49:37 +0000
@@ -21,7 +21,7 @@
21 id: pageHeaderStyle21 id: pageHeaderStyle
2222
23 foregroundColor: theme.palette.selected.backgroundText23 foregroundColor: theme.palette.selected.backgroundText
24 backgroundColor: "white"24 backgroundColor: theme.palette.normal.background
25 dividerColor: Qt.rgba(0, 0, 0, 0.1)25 dividerColor: Qt.rgba(0, 0, 0, 0.1)
26 property int fontWeight: Font.Light26 property int fontWeight: Font.Light
27 property int textSize: Label.Large27 property int textSize: Label.Large
@@ -31,7 +31,7 @@
3131
32 defaultActionDelegate: AbstractButton {32 defaultActionDelegate: AbstractButton {
33 style: IconButtonStyle { }33 style: IconButtonStyle { }
34 objectName: action.objectName + "_action_button"34 objectName: action.objectName + "_button"
35 height: parent ? parent.height : undefined35 height: parent ? parent.height : undefined
36 action: modelData36 action: modelData
37 StyleHints {37 StyleHints {
3838
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-10-02 22:48:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-11-17 15:49:37 +0000
@@ -113,6 +113,9 @@
113 1.3/ToolbarStyle.qml \113 1.3/ToolbarStyle.qml \
114 1.3/IconButtonStyle.qml \114 1.3/IconButtonStyle.qml \
115 1.3/PageHeaderStyle.qml \115 1.3/PageHeaderStyle.qml \
116 1.3/BottomEdgeHintStyle.qml \
116 $$ARTWORK_FILES117 $$ARTWORK_FILES
117118
118load(ubuntu_qml_module)119load(ubuntu_qml_module)
120
121OTHER_FILES+=qmldir
119122
=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
--- src/Ubuntu/Components/plugin/plugin.cpp 2015-10-01 12:34:29 +0000
+++ src/Ubuntu/Components/plugin/plugin.cpp 2015-11-17 15:49:37 +0000
@@ -70,6 +70,7 @@
70#include "ucheader.h"70#include "ucheader.h"
71#include "uclabel.h"71#include "uclabel.h"
72#include "uclistitemlayout.h"72#include "uclistitemlayout.h"
73#include "ucbottomedgehint.h"
7374
74#include <sys/types.h>75#include <sys/types.h>
75#include <unistd.h>76#include <unistd.h>
@@ -230,7 +231,6 @@
230 qmlRegisterType<UCUbuntuShapeOverlay>(uri, 1, 2, "UbuntuShapeOverlay");231 qmlRegisterType<UCUbuntuShapeOverlay>(uri, 1, 2, "UbuntuShapeOverlay");
231232
232 // register 1.3 API233 // register 1.3 API
233 qmlRegisterType<UCItemAttached>();
234 qmlRegisterType<UCListItem, 1>(uri, 1, 3, "ListItem");234 qmlRegisterType<UCListItem, 1>(uri, 1, 3, "ListItem");
235 qmlRegisterType<UCListItemExpansion>();235 qmlRegisterType<UCListItemExpansion>();
236 qmlRegisterType<UCTheme>(uri, 1, 3, "ThemeSettings");236 qmlRegisterType<UCTheme>(uri, 1, 3, "ThemeSettings");
@@ -249,6 +249,7 @@
249 qmlRegisterType<UCListItemLayout>(uri, 1, 3, "ListItemLayout");249 qmlRegisterType<UCListItemLayout>(uri, 1, 3, "ListItemLayout");
250 qmlRegisterType<UCHeader>(uri, 1, 3, "Header");250 qmlRegisterType<UCHeader>(uri, 1, 3, "Header");
251 qmlRegisterType<UCLabel>(uri, 1, 3, "Label");251 qmlRegisterType<UCLabel>(uri, 1, 3, "Label");
252 qmlRegisterType<UCBottomEdgeHint>(uri, 1, 3, "BottomEdgeHint");
252}253}
253254
254void UbuntuComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)255void UbuntuComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
255256
=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
--- src/Ubuntu/Components/plugin/plugin.pri 2015-10-01 08:47:31 +0000
+++ src/Ubuntu/Components/plugin/plugin.pri 2015-11-17 15:49:37 +0000
@@ -91,7 +91,10 @@
91 $$PWD/ucheader.h \91 $$PWD/ucheader.h \
92 $$PWD/uclabel.h \92 $$PWD/uclabel.h \
93 $$PWD/uclistitemlayout.h \93 $$PWD/uclistitemlayout.h \
94 $$PWD/privates/threelabelsslot_p.h94 $$PWD/privates/threelabelsslot_p.h \
95 $$PWD/ucimportversionchecker_p.h \
96 $$PWD/ucbottomedgehint.h \
97 $$PWD/privates/gesturedetector.h
9598
96SOURCES += $$PWD/plugin.cpp \99SOURCES += $$PWD/plugin.cpp \
97 $$PWD/uctheme.cpp \100 $$PWD/uctheme.cpp \
@@ -153,7 +156,10 @@
153 $$PWD/ucheader.cpp \156 $$PWD/ucheader.cpp \
154 $$PWD/uclabel.cpp \157 $$PWD/uclabel.cpp \
155 $$PWD/uclistitemlayout.cpp \158 $$PWD/uclistitemlayout.cpp \
156 $$PWD/privates/threelabelsslot_p.cpp159 $$PWD/privates/threelabelsslot_p.cpp \
160 $$PWD/ucimportversionchecker_p.cpp \
161 $$PWD/ucbottomedgehint.cpp \
162 $$PWD/privates/gesturedetector.cpp
157163
158# adapters164# adapters
159SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp165SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp
160166
=== added file 'src/Ubuntu/Components/plugin/privates/gesturedetector.cpp'
--- src/Ubuntu/Components/plugin/privates/gesturedetector.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/privates/gesturedetector.cpp 2015-11-17 15:49:37 +0000
@@ -0,0 +1,142 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#include "gesturedetector.h"
20#include "ucunits.h"
21#include <QtCore/QEvent>
22#include <QtCore/QRectF>
23#include <QtGui/QTouchEvent>
24#include <QtQuick/QQuickItem>
25#include <QtGui/QGuiApplication>
26#include <QtGui/QStyleHints>
27
28#define DETECTION_AREA_THICKNESS_GU 1.2
29
30GestureDetector::GestureDetector(QObject *parent)
31 : QObject(parent)
32 , m_owner(qobject_cast<QQuickItem*>(parent))
33 , m_status(Ready)
34 , m_bottomUpSwipeDetected(false)
35{
36 Q_ASSERT(m_owner);
37}
38GestureDetector::~GestureDetector()
39{
40 Q_FOREACH(QObject *object, m_filteredItems) {
41 object->removeEventFilter(this);
42 }
43 m_filteredItems.clear();
44}
45
46void GestureDetector::onFilteredItemDeleted(QObject *object)
47{
48 if (object) {
49 object->removeEventFilter(this);
50 m_filteredItems.removeAll(object);
51 }
52}
53
54void GestureDetector::setStatus(Status status)
55{
56 if (status == m_status) {
57 return;
58 }
59 m_status = status;
60 Q_EMIT statusChanged(m_status);
61}
62
63bool GestureDetector::isDetecting()
64{
65 return (m_status > Ready && m_status < Completed);
66}
67
68void GestureDetector::setItemFilter(QObject *item)
69{
70 m_filteredItems.append(item);
71 item->installEventFilter(this);
72 connect(item, &QObject::destroyed, this, &GestureDetector::onFilteredItemDeleted);
73}
74
75void GestureDetector::removeItemFilter(QObject *item)
76{
77 m_filteredItems.removeAll(item);
78 item->removeEventFilter(this);
79 disconnect(item, &QObject::destroyed, this, &GestureDetector::onFilteredItemDeleted);
80}
81
82bool GestureDetector::handleTouchEvent(QObject *target, QTouchEvent *event)
83{
84 switch (event->type()) {
85 case QEvent::TouchBegin: {
86 setStatus(Ready);
87 QPointF itemPoint = m_owner->mapFromScene(event->touchPoints()[0].scenePos());
88 qreal thickness = UCUnits::instance().gu(DETECTION_AREA_THICKNESS_GU);
89 QRectF detectionArea(0.0, m_owner->height() - thickness, m_owner->width(), thickness);
90 if (detectionArea.contains(itemPoint)) {
91 m_startPoint = itemPoint;
92 setStatus(Started);
93 if (target == parent()) {
94 event->accept();
95 return true;
96 }
97 }
98 return false;
99 }
100 case QEvent::TouchEnd:
101 {
102 m_startPoint = QPointF();
103 setStatus(Completed);
104 return false;
105 }
106 case QEvent::TouchCancel: {
107 m_startPoint = QPointF();
108 setStatus(Ready);
109 return false;
110 }
111 case QEvent::TouchUpdate: {
112 if (m_status == Started) {
113 QPointF itemPoint = m_owner->mapFromScene(event->touchPoints()[0].scenePos());
114 if (abs(m_startPoint.y() - itemPoint.y()) >= qApp->styleHints()->startDragDistance()) {
115 setStatus(Detected);
116 Q_EMIT bottomUpSwipeDetected();
117 }
118 }
119 return false;
120 }
121 default: return false;
122 }
123}
124
125bool GestureDetector::eventFilter(QObject *target, QEvent *event)
126{
127 if (m_filteredItems.contains(target)) {
128 QEvent::Type type = event->type();
129 if (type == QEvent::TouchBegin
130 || type == QEvent::TouchUpdate
131 || type == QEvent::TouchEnd
132 || type == QEvent::TouchCancel) {
133 QTouchEvent *touch = static_cast<QTouchEvent*>(event);
134 return handleTouchEvent(target, touch);
135 } else {
136 // pass it on
137 return false;
138 }
139 } else {
140 return QObject::eventFilter(target, event);
141 }
142}
0143
=== added file 'src/Ubuntu/Components/plugin/privates/gesturedetector.h'
--- src/Ubuntu/Components/plugin/privates/gesturedetector.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/privates/gesturedetector.h 2015-11-17 15:49:37 +0000
@@ -0,0 +1,75 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#ifndef GESTUREDETECTOR_H
20#define GESTUREDETECTOR_H
21
22#include <QtCore/QObject>
23#include <QtCore/QPointF>
24#include <QtCore/QList>
25
26/*
27 * A simple gesture detection filter class that can be used in components to detect
28 * various gestures. Yet swipe from bottom up is the only gesture handled.
29 * It does not grab or consume the event from the environment, acts as a filter.
30 */
31class QTouchEvent;
32class QQuickItem;
33class GestureDetector : public QObject
34{
35 Q_OBJECT
36public:
37 enum Status {
38 Ready,
39 Started,
40 Detected,
41 Completed
42 };
43 explicit GestureDetector(QObject *parent = 0);
44 ~GestureDetector();
45
46 bool isDetecting();
47
48 void setItemFilter(QObject *item);
49 void removeItemFilter(QObject *item);
50
51 bool handleTouchEvent(QObject *target, QTouchEvent *event);
52
53Q_SIGNALS:
54 void statusChanged(Status status);
55
56 void bottomUpSwipeDetected();
57
58public Q_SLOTS:
59
60protected:
61 bool eventFilter(QObject *target, QEvent *event);
62
63 void setStatus(Status status);
64
65private:
66 QList<QObject*> m_filteredItems;
67 QPointF m_startPoint;
68 QQuickItem *m_owner;
69 Status m_status;
70 bool m_bottomUpSwipeDetected:1;
71
72 void onFilteredItemDeleted(QObject *object);
73};
74
75#endif // GESTUREDETECTOR_H
076
=== modified file 'src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp'
--- src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp 2015-10-12 14:32:17 +0000
+++ src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp 2015-11-17 15:49:37 +0000
@@ -143,7 +143,7 @@
143 Q_D(UCThreeLabelsSlot);143 Q_D(UCThreeLabelsSlot);
144 if (d->m_title == Q_NULLPTR) {144 if (d->m_title == Q_NULLPTR) {
145 d->m_title = new UCLabel(this);145 d->m_title = new UCLabel(this);
146 QQmlData::get(d->m_title, true);146 QQmlEngine::setContextForObject(d->m_title, qmlContext(this));
147 d->m_title->init();147 d->m_title->init();
148148
149 QQuickAnchors *titleAnchors = QQuickItemPrivate::get(d->m_title)->anchors();149 QQuickAnchors *titleAnchors = QQuickItemPrivate::get(d->m_title)->anchors();
@@ -180,7 +180,7 @@
180 Q_D(UCThreeLabelsSlot);180 Q_D(UCThreeLabelsSlot);
181 if (d->m_subtitle == Q_NULLPTR) {181 if (d->m_subtitle == Q_NULLPTR) {
182 d->m_subtitle = new UCLabel(this);182 d->m_subtitle = new UCLabel(this);
183 QQmlData::get(d->m_subtitle, true);183 QQmlEngine::setContextForObject(d->m_subtitle, qmlContext(this));
184 d->m_subtitle->init();184 d->m_subtitle->init();
185185
186 QQuickAnchors *subtitleAnchors = QQuickItemPrivate::get(d->m_subtitle)->anchors();186 QQuickAnchors *subtitleAnchors = QQuickItemPrivate::get(d->m_subtitle)->anchors();
@@ -202,7 +202,7 @@
202 Q_D(UCThreeLabelsSlot);202 Q_D(UCThreeLabelsSlot);
203 if (d->m_summary == Q_NULLPTR) {203 if (d->m_summary == Q_NULLPTR) {
204 d->m_summary = new UCLabel(this);204 d->m_summary = new UCLabel(this);
205 QQmlData::get(d->m_summary, true);205 QQmlEngine::setContextForObject(d->m_summary, qmlContext(this));
206 d->m_summary->init();206 d->m_summary->init();
207207
208 QQuickAnchors *summaryAnchors = QQuickItemPrivate::get(d->m_summary)->anchors();208 QQuickAnchors *summaryAnchors = QQuickItemPrivate::get(d->m_summary)->anchors();
209209
=== modified file 'src/Ubuntu/Components/plugin/quickutils.cpp'
--- src/Ubuntu/Components/plugin/quickutils.cpp 2015-08-24 12:55:50 +0000
+++ src/Ubuntu/Components/plugin/quickutils.cpp 2015-11-17 15:49:37 +0000
@@ -32,7 +32,8 @@
3232
33QuickUtils::QuickUtils(QObject *parent) :33QuickUtils::QuickUtils(QObject *parent) :
34 QObject(parent),34 QObject(parent),
35 m_rootView(0)35 m_rootView(0),
36 m_mouseAttached(true)
36{37{
37 QGuiApplication::instance()->installEventFilter(this);38 QGuiApplication::instance()->installEventFilter(this);
38 m_omitIM << "ibus" << "none" << "compose";39 m_omitIM << "ibus" << "none" << "compose";
3940
=== modified file 'src/Ubuntu/Components/plugin/quickutils.h'
--- src/Ubuntu/Components/plugin/quickutils.h 2015-08-24 12:55:50 +0000
+++ src/Ubuntu/Components/plugin/quickutils.h 2015-11-17 15:49:37 +0000
@@ -31,6 +31,7 @@
31 Q_PROPERTY(QQuickItem *rootObject READ rootObject NOTIFY rootObjectChanged)31 Q_PROPERTY(QQuickItem *rootObject READ rootObject NOTIFY rootObjectChanged)
32 Q_PROPERTY(QString inputMethodProvider READ inputMethodProvider)32 Q_PROPERTY(QString inputMethodProvider READ inputMethodProvider)
33 Q_PROPERTY(bool touchScreenAvailable READ touchScreenAvailable NOTIFY touchScreenAvailableChanged)33 Q_PROPERTY(bool touchScreenAvailable READ touchScreenAvailable NOTIFY touchScreenAvailableChanged)
34 Q_PROPERTY(bool mouseAttached MEMBER m_mouseAttached NOTIFY mouseAttachedChanged)
34public:35public:
35 static QuickUtils& instance()36 static QuickUtils& instance()
36 {37 {
@@ -48,11 +49,17 @@
48 QObject* createQmlObject(const QUrl &url, QQmlEngine *engine);49 QObject* createQmlObject(const QUrl &url, QQmlEngine *engine);
49 static bool showDeprecationWarnings();50 static bool showDeprecationWarnings();
5051
52 bool mouseAttached()
53 {
54 return m_mouseAttached;
55 }
56
51Q_SIGNALS:57Q_SIGNALS:
52 void rootObjectChanged();58 void rootObjectChanged();
53 void activated();59 void activated();
54 void deactivated();60 void deactivated();
55 void touchScreenAvailableChanged();61 void touchScreenAvailableChanged();
62 void mouseAttachedChanged();
5663
57protected:64protected:
58 bool eventFilter(QObject *, QEvent *);65 bool eventFilter(QObject *, QEvent *);
@@ -61,6 +68,7 @@
61 explicit QuickUtils(QObject *parent = 0);68 explicit QuickUtils(QObject *parent = 0);
62 QPointer<QQuickView> m_rootView;69 QPointer<QQuickView> m_rootView;
63 QStringList m_omitIM;70 QStringList m_omitIM;
71 bool m_mouseAttached;
6472
65 void lookupQuickView();73 void lookupQuickView();
66};74};
6775
=== added file 'src/Ubuntu/Components/plugin/ucbottomedgehint.cpp'
--- src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-11-17 15:49:37 +0000
@@ -0,0 +1,347 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#include "ucbottomedgehint.h"
20#include "ucstyleditembase_p.h"
21#include "quickutils.h"
22#include "ucunits.h"
23#include <QtQml/private/qqmlproperty_p.h>
24#include <QtQuick/private/qquickflickable_p.h>
25
26/*!
27 \qmltype BottomEdgeHint
28 \inqmlmodule Ubuntu.Components 1.3
29 \ingroup ubuntu
30 \inherits StyledItem
31 \brief The BottomEdgeHint shows the availability of extra features
32 available from the bottom edge of the application.
33
34 It displays a label and/or an icon at the bottom of the component it is
35 attached to.
36
37 When used with a mouse it acts like a button. The typical action associated
38 with clicking on it should be revealing the extra features provided by the
39 bottom edge.
40
41 Example:
42 \qml
43 BottomEdgeHint {
44 id: bottomEdgeHint
45 text: i18n.tr("Favorites")
46 onClicked: revealBottomEdge()
47 }
48 \endqml
49
50 The component is styled through \b BottomEdgeHintStyle.
51*/
52UCBottomEdgeHint::UCBottomEdgeHint(QQuickItem *parent)
53 : UCStyledItemBase(parent)
54 , m_gestureDetector(this)
55 , m_flickable(Q_NULLPTR)
56 , m_deactivateTimeout(800)
57 // FIXME: we need QInputDeviceInfo to be complete with the locked!!
58 , m_status(QuickUtils::instance().mouseAttached() ? Locked : Inactive)
59 , m_pressed(false)
60{
61 /*
62 * we cannot use setStyleName as that will trigger style loading
63 * and the qmlEngine is not known at this phase of the of the initialization
64 * Therefore we simply set the style name default. Style loading will
65 * happen during component completion.
66 */
67 UCStyledItemBasePrivate::get(this)->styleDocument = "BottomEdgeHintStyle";
68
69 // connect old stateChanged
70 connect(this, &QQuickItem::stateChanged, this, &UCBottomEdgeHint::stateChanged);
71
72 // connect to gesture detection
73 connect(&m_gestureDetector, &GestureDetector::bottomUpSwipeDetected,
74 this, &UCBottomEdgeHint::onBottomUpSwipeDetected);
75 connect(&m_gestureDetector, &GestureDetector::statusChanged,
76 this, &UCBottomEdgeHint::onGestureStatusChanged);
77
78 // FIXME: use QInputDeviceInfo once available
79 connect(&QuickUtils::instance(), &QuickUtils::mouseAttachedChanged, [this]() {
80 setStatus(QuickUtils::instance().mouseAttached() ? Locked : Active);
81 if (m_status == Active) {
82 m_deactivationTimer.start(m_deactivateTimeout, this);
83 }
84 });
85
86 // accept mouse events
87 setAcceptedMouseButtons(Qt::LeftButton);
88}
89
90void UCBottomEdgeHint::itemChange(ItemChange change, const ItemChangeData &data)
91{
92 UCStyledItemBase::itemChange(change, data);
93 if (change == ItemParentHasChanged) {
94 QQmlProperty bottomAnchors(this, "anchors.bottom", qmlContext(this));
95 if (data.item && !QQmlPropertyPrivate::binding(bottomAnchors)) {
96 QQuickAnchors *anchors = QQuickItemPrivate::get(this)->anchors();
97 anchors->setBottom(QQuickItemPrivate::get(data.item)->bottom());
98 }
99 }
100}
101
102void UCBottomEdgeHint::timerEvent(QTimerEvent *event)
103{
104 UCStyledItemBase::timerEvent(event);
105 if (event->timerId() == m_deactivationTimer.timerId()) {
106 setStatus(Inactive);
107 m_deactivationTimer.stop();
108 }
109}
110
111// handle clicked event when locked and enter or return is pressed
112void UCBottomEdgeHint::keyPressEvent(QKeyEvent *event)
113{
114 UCStyledItemBase::keyPressEvent(event);
115 if ((status() >= Active) && (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)) {
116 Q_EMIT clicked();
117 }
118}
119
120// handle gesture detection
121void UCBottomEdgeHint::touchEvent(QTouchEvent *event)
122{
123 UCStyledItemBase::touchEvent(event);
124 m_gestureDetector.handleTouchEvent(this, event);
125}
126
127// handle click event
128void UCBottomEdgeHint::mousePressEvent(QMouseEvent *event)
129{
130 if (contains(event->localPos()) && (m_status >= Active)) {
131 m_pressed = true;
132 } else {
133 UCStyledItemBase::mousePressEvent(event);
134 }
135}
136void UCBottomEdgeHint::mouseReleaseEvent(QMouseEvent *event)
137{
138 UCStyledItemBase::mouseReleaseEvent(event);
139 if (m_pressed && (m_status >= Active)) {
140 Q_EMIT clicked();
141 }
142}
143
144// watch gesture detection status changes
145void UCBottomEdgeHint::onBottomUpSwipeDetected()
146{
147 m_deactivationTimer.stop();
148 setStatus(Active);
149}
150
151void UCBottomEdgeHint::onGestureStatusChanged(GestureDetector::Status status)
152{
153 if (status == GestureDetector::Completed) {
154 if (m_status == Active) {
155 m_deactivationTimer.start(m_deactivateTimeout, this);
156 }
157 }
158}
159
160/*!
161 \qmlsignal void BottomEdgeHint::clicked()
162 This handler is called when there is a mouse click on the BottomEdgeHint
163 and the BottomEdgeHint is not disabled.
164*/
165
166/*!
167 \qmlproperty string BottomEdgeHint::text
168 The label displayed by the BottomEdgeHint.
169 */
170
171/*!
172 \qmlproperty url BottomEdgeHint::iconSource
173 The icon displayed by the BottomEdgeHint.
174
175 This is the URL of any image file.
176 If both iconSource and \l iconName are defined, \l iconName will be ignored.
177 */
178
179/*!
180 \qmlproperty string BottomEdgeHint::iconName
181 The icon associated with the BottomEdgeHint in the icon theme.
182
183 If both \l iconSource and iconName are defined, iconName will be ignored.
184 */
185
186/*!
187 \qmlproperty Flickable BottomEdgeHint::flickable
188 The property holds the flickable, which when flicked hides the hint.
189 \e Hidden state is reached when this property is set to a Flickable
190 which is flicking or moving. It is recommended to set the property
191 when the hint is placed above a flickable content. Defaults to null.
192 */
193void UCBottomEdgeHint::setFlickable(QQuickFlickable *flickable)
194{
195 if (flickable == m_flickable) {
196 return;
197 }
198 if (m_flickable) {
199 disconnect(m_flickable, &QQuickFlickable::flickingChanged,
200 this, &UCBottomEdgeHint::handleFlickableActivation);
201 disconnect(m_flickable, &QQuickFlickable::movingChanged,
202 this, &UCBottomEdgeHint::handleFlickableActivation);
203 m_gestureDetector.removeItemFilter(m_flickable);
204 }
205 m_flickable = flickable;
206 if (m_flickable) {
207 connect(m_flickable, &QQuickFlickable::flickingChanged,
208 this, &UCBottomEdgeHint::handleFlickableActivation, Qt::DirectConnection);
209 connect(m_flickable, &QQuickFlickable::movingChanged,
210 this, &UCBottomEdgeHint::handleFlickableActivation, Qt::DirectConnection);
211 m_gestureDetector.setItemFilter(m_flickable);
212 }
213 Q_EMIT flickableChanged();
214}
215
216// flickable moves hide the hint only if the current status is not Locked
217void UCBottomEdgeHint::handleFlickableActivation()
218{
219 if (m_status < Locked && !m_gestureDetector.isDetecting() && !m_deactivationTimer.isActive()) {
220 bool moving = m_flickable->isFlicking() || m_flickable->isMoving();
221 if (moving) {
222 setStatus(Hidden);
223 } else if (m_status == Hidden) {
224 setStatus(Inactive);
225 }
226 }
227}
228
229/*!
230 \qmlproperty string BottomEdgeHint::state
231 \deprecated
232 BottomEdgeHint can take 2 states of visibility: \e Hidden, \e Visible.
233 \table
234 \header
235 \li State
236 \li Description
237 \row
238 \li Hidden
239 \li The hint is not shown at all and cannot be activated.
240 \row
241 \li Visible
242 \li The hint is in a state where it is visible but not active. \l clicked
243 signal is not emitted.
244 \endtable
245
246 Defaults to \e Visible.
247 */
248QString UCBottomEdgeHint::state() const
249{
250 return QQuickItem::state();
251}
252void UCBottomEdgeHint::setState(const QString &state)
253{
254 QQuickItem::setState(state);
255
256 qmlInfo(this) << "Overloaded 'state' property deprecated, will be removed from 1.3 release. Use 'status' instead.";
257 QQuickItem *style = UCStyledItemBasePrivate::get(this)->styleItem;
258 if (!style) {
259 return;
260 }
261 if (state == "Hidden") {
262 setStatus(Hidden);
263 }
264 if (state == "Visible") {
265 setStatus(Inactive);
266 }
267}
268
269/*!
270 \qmlproperty Status BottomEdgeHint::status
271 The property represents the status of the hint. The property is writable so it
272 can be set to any of the following values programatically:
273 \table
274 \header
275 \li Status
276 \li Description
277 \row
278 \li Hidden
279 \li The hint is not shown. Equivalent with setting \e visible to \c false,
280 however visuals may do animations when altering this property. It can
281 only be set if the current status is not \e Locked.
282 \row
283 \li Inactive
284 \li The hint is shown and inactive. Styles can represent this state with
285 different visuals. When inactive, \l clicked signal cannot be emitted.
286 \row
287 \li Active
288 \li The hint is shown and active, meaning \l clicked signal is emitted when
289 clicked with mouse.
290 \row
291 \li Locked
292 \li Similar to \e Active the hint is shown and active, but no automatic transition
293 to any other state is allowed. This is relevant for style implementations.
294 \endtable
295 \note \e Locked status value is set automatically when the system detects a
296 mouse attached. In this case any change into other state value than \e Locked
297 is rejected.
298 Defaults to
299 \list
300 \li Inactive if no mouse is attached or
301 \li Locked if there is a mouse detected.
302 \endlist
303 */
304UCBottomEdgeHint::Status UCBottomEdgeHint::status()
305{
306 // FIXME: we won't need this once we get the QInputDeviceInfo reporting mouse attach/detach
307 if (QuickUtils::instance().mouseAttached()) {
308 m_status = Locked;
309 }
310 return m_status;
311}
312
313void UCBottomEdgeHint::setStatus(Status status)
314{
315 // FIXME: we need QInputDeviceInfo to complete this!
316 // cannot unlock if mouse is attached or we don't have touch screen available
317 if (status == m_status || (status != Locked && QuickUtils::instance().mouseAttached())) {
318 return;
319 }
320 m_status = status;
321 // make sure we stop the deactivation timer if Inactive or Locked
322 if (status != Active && m_deactivationTimer.isActive()) {
323 m_deactivationTimer.stop();
324 }
325 Q_EMIT statusChanged();
326}
327
328/*!
329 * \qmlproperty int BottomEdgeHint::deactivateTimeout
330 * The property specifies the timeout interval in milliseconds the \l status
331 * is set to \e Inactive after a gesture based activation. Gesture based activation
332 * is only possible when mouse is not attached to the device. Defaults to 800
333 * milliseconds.
334 */
335
336void UCBottomEdgeHint::setDeactivateTimeout(int timeout)
337{
338 if (timeout == m_deactivateTimeout || timeout < 0) {
339 return;
340 }
341 m_deactivateTimeout = timeout;
342 if (m_deactivationTimer.isActive()) {
343 m_deactivationTimer.stop();
344 m_deactivationTimer.start(m_deactivateTimeout, this);
345 }
346 Q_EMIT deactivateTimeoutChanged();
347}
0348
=== added file 'src/Ubuntu/Components/plugin/ucbottomedgehint.h'
--- src/Ubuntu/Components/plugin/ucbottomedgehint.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/ucbottomedgehint.h 2015-11-17 15:49:37 +0000
@@ -0,0 +1,92 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#ifndef UCBOTTOMEDGEHINT_H
20#define UCBOTTOMEDGEHINT_H
21
22#include "ucstyleditembase.h"
23#include "privates/gesturedetector.h"
24
25class QQuickFlickable;
26class UCBottomEdgeHint : public UCStyledItemBase
27{
28 Q_OBJECT
29 Q_ENUMS(Status)
30 Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL)
31 Q_PROPERTY(QUrl iconSource MEMBER m_iconSource NOTIFY iconSourceChanged FINAL)
32 Q_PROPERTY(QString iconName MEMBER m_iconName NOTIFY iconNameChanged FINAL)
33 Q_PROPERTY(QQuickFlickable *flickable MEMBER m_flickable WRITE setFlickable NOTIFY flickableChanged FINAL)
34 Q_PROPERTY(Status status MEMBER m_status WRITE setStatus NOTIFY statusChanged FINAL)
35 Q_PROPERTY(int deactivateTimeout MEMBER m_deactivateTimeout WRITE setDeactivateTimeout NOTIFY deactivateTimeoutChanged FINAL)
36 // deprecated
37 Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
38public:
39 enum Status {
40 Hidden,
41 Inactive,
42 Active,
43 Locked
44 };
45 explicit UCBottomEdgeHint(QQuickItem *parent = 0);
46
47 void setFlickable(QQuickFlickable *flickable);
48 Status status();
49 void setStatus(Status status);
50
51 // deprecated
52 QString state() const;
53 void setState(const QString &state);
54 void setDeactivateTimeout(int timeout);
55
56Q_SIGNALS:
57 void textChanged();
58 void iconSourceChanged();
59 void iconNameChanged();
60 void flickableChanged();
61 void statusChanged();
62 void deactivateTimeoutChanged();
63
64 void clicked();
65
66 // deprecated
67 void stateChanged();
68protected:
69 void itemChange(ItemChange change, const ItemChangeData &data);
70 void timerEvent(QTimerEvent *event);
71 void keyPressEvent(QKeyEvent *event);
72 void touchEvent(QTouchEvent *event);
73 void mousePressEvent(QMouseEvent *event);
74 void mouseReleaseEvent(QMouseEvent *event);
75
76 void handleFlickableActivation();
77 void onBottomUpSwipeDetected();
78 void onGestureStatusChanged(GestureDetector::Status status);
79
80private:
81 GestureDetector m_gestureDetector;
82 QBasicTimer m_deactivationTimer;
83 QString m_text;
84 QUrl m_iconSource;
85 QString m_iconName;
86 QQuickFlickable *m_flickable;
87 int m_deactivateTimeout;
88 Status m_status;
89 bool m_pressed:1;
90};
91
92#endif // UCBOTTOMEDGEHINT_H
093
=== modified file 'src/Ubuntu/Components/plugin/ucheader.cpp'
--- src/Ubuntu/Components/plugin/ucheader.cpp 2015-10-01 21:23:04 +0000
+++ src/Ubuntu/Components/plugin/ucheader.cpp 2015-11-17 15:49:37 +0000
@@ -208,6 +208,7 @@
208}208}
209209
210void UCHeader::show(bool animate) {210void UCHeader::show(bool animate) {
211 if (m_exposed && !m_moving && y() == 0.0) return;
211 if (!m_exposed) {212 if (!m_exposed) {
212 m_exposed = true;213 m_exposed = true;
213 Q_EMIT exposedChanged();214 Q_EMIT exposedChanged();
@@ -233,6 +234,7 @@
233}234}
234235
235void UCHeader::hide(bool animate) {236void UCHeader::hide(bool animate) {
237 if (!m_exposed && !m_moving && y() == -1.0*height()) return;
236 if (m_exposed) {238 if (m_exposed) {
237 m_exposed = false;239 m_exposed = false;
238 Q_EMIT exposedChanged();240 Q_EMIT exposedChanged();
239241
=== added file 'src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp'
--- src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/ucimportversionchecker_p.cpp 2015-11-17 15:49:37 +0000
@@ -0,0 +1,58 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#include "ucimportversionchecker_p.h"
20#include "ucnamespace.h"
21
22#include <QtQuick>
23#include <QtQml/private/qqmldata_p.h>
24#include <QtQml/private/qqmlcontext_p.h>
25#include <QtQml/private/qqmlpropertycache_p.h>
26#include <QtQml/private/qqmlmetatype_p.h>
27
28/*!
29 * \internal
30 *
31 * The function returns the version the module is imported with based on a QML
32 * component instance. It only checks till reaches 1.2 version. Implementations
33 * must implement the propertyForVersion method and must probvide a property for
34 * each version requested.
35 */
36quint16 UCImportVersionChecker::importVersion(QObject *object)
37{
38 QQmlData *data = QQmlData::get(object);
39 Q_ASSERT(data);
40 QQmlContextData *cdata = QQmlContextData::get(qmlContext(object));
41 Q_ASSERT(cdata);
42 QQmlEngine *engine = qmlEngine(object);
43 Q_ASSERT(engine);
44
45 // start from the highest available version till we reach 1.2
46 for (quint16 minor = MINOR_VERSION(LATEST_UITK_VERSION); minor > 2; minor--) {
47 quint16 version = BUILD_VERSION(1, minor);
48 const QString property(propertyForVersion(version));
49 Q_ASSERT(!property.isEmpty());
50 QQmlPropertyData l;
51 QQmlPropertyData *p = QQmlPropertyCache::property(engine, object, property, cdata, l);
52 if (data->propertyCache->isAllowedInRevision(p)) {
53 return version;
54 }
55 }
56 // if none found, simply fall back to 1.2
57 return BUILD_VERSION(1, 2);
58}
059
=== added file 'src/Ubuntu/Components/plugin/ucimportversionchecker_p.h'
--- src/Ubuntu/Components/plugin/ucimportversionchecker_p.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/ucimportversionchecker_p.h 2015-11-17 15:49:37 +0000
@@ -0,0 +1,34 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#ifndef UCIMPORTVERSIONCHECKER_P_H
20#define UCIMPORTVERSIONCHECKER_P_H
21
22#include <QtCore>
23
24class UCImportVersionChecker
25{
26public:
27 UCImportVersionChecker() {}
28
29 virtual QString propertyForVersion(quint16 version) const = 0;
30
31 virtual quint16 importVersion(QObject *object);
32};
33
34#endif // UCIMPORTVERSIONCHECKER_P_H
035
=== modified file 'src/Ubuntu/Components/plugin/uclabel.cpp'
--- src/Ubuntu/Components/plugin/uclabel.cpp 2015-09-28 16:18:19 +0000
+++ src/Ubuntu/Components/plugin/uclabel.cpp 2015-11-17 15:49:37 +0000
@@ -78,6 +78,7 @@
78 */78 */
79UCLabel::UCLabel(QQuickItem* parent)79UCLabel::UCLabel(QQuickItem* parent)
80 : QQuickText(parent)80 : QQuickText(parent)
81 , UCThemingExtension(this)
81 , m_textSize(Medium)82 , m_textSize(Medium)
82 , m_flags(0)83 , m_flags(0)
83{84{
@@ -91,7 +92,6 @@
9192
92void UCLabel::init()93void UCLabel::init()
93{94{
94 initTheming(this);
95 postThemeChanged();95 postThemeChanged();
96 updatePixelSize();96 updatePixelSize();
97 m_defaultFont = font();97 m_defaultFont = font();
@@ -103,13 +103,6 @@
103 connect(this, &UCLabel::colorChanged, this, &UCLabel::_q_customColor, Qt::DirectConnection);103 connect(this, &UCLabel::colorChanged, this, &UCLabel::_q_customColor, Qt::DirectConnection);
104}104}
105105
106void UCLabel::customEvent(QEvent *event)
107{
108 if (UCThemeEvent::isThemeEvent(event)) {
109 handleThemeEvent(static_cast<UCThemeEvent*>(event));
110 }
111}
112
113void UCLabel::postThemeChanged()106void UCLabel::postThemeChanged()
114{107{
115 if (m_flags & ColorSet) {108 if (m_flags & ColorSet) {
116109
=== modified file 'src/Ubuntu/Components/plugin/uclabel.h'
--- src/Ubuntu/Components/plugin/uclabel.h 2015-10-01 12:34:29 +0000
+++ src/Ubuntu/Components/plugin/uclabel.h 2015-11-17 15:49:37 +0000
@@ -23,7 +23,7 @@
23class UCLabel : public QQuickText, public UCThemingExtension23class UCLabel : public QQuickText, public UCThemingExtension
24{24{
25 Q_OBJECT25 Q_OBJECT
2626 Q_INTERFACES(UCThemingExtension)
27 Q_ENUMS(TextSize)27 Q_ENUMS(TextSize)
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)
2929
@@ -61,7 +61,6 @@
61protected:61protected:
62 // from QQuickItem62 // from QQuickItem
63 void classBegin();63 void classBegin();
64 void customEvent(QEvent *event);
6564
66 // from UCItemExtension65 // from UCItemExtension
67 void preThemeChanged(){}66 void preThemeChanged(){}
6867
=== modified file 'src/Ubuntu/Components/plugin/uclistitem.cpp'
--- src/Ubuntu/Components/plugin/uclistitem.cpp 2015-10-12 14:32:17 +0000
+++ src/Ubuntu/Components/plugin/uclistitem.cpp 2015-11-17 15:49:37 +0000
@@ -61,7 +61,7 @@
61 QColor colorFrom;61 QColor colorFrom;
62 QColor colorTo;62 QColor colorTo;
63 QGradientStops gradient;63 QGradientStops gradient;
64 UCListItemPrivate *listItem;64 UCListItem *listItem;
65};65};
6666
67UCListItemDivider::UCListItemDivider(UCListItem *parent)67UCListItemDivider::UCListItemDivider(UCListItem *parent)
@@ -77,14 +77,16 @@
77{77{
78 Q_D(UCListItemDivider);78 Q_D(UCListItemDivider);
79 QQml_setParent_noEvent(this, listItem);79 QQml_setParent_noEvent(this, listItem);
80 d->listItem = UCListItemPrivate::get(listItem);80 d->listItem = listItem;
81 setParentItem(listItem);81 setParentItem(listItem);
82 // anchor to left/right/bottom of the ListItem82 // anchor to left/right/bottom of the ListItem
83 QQuickAnchors *anchors = d->anchors();83 QQuickAnchors *anchors = d->anchors();
84 anchors->setLeft(d->listItem->left());84 UCListItemPrivate *pListItem = UCListItemPrivate::get(listItem);
85 anchors->setRight(d->listItem->right());85 anchors->setLeft(pListItem->left());
86 anchors->setBottom(d->listItem->bottom());86 anchors->setRight(pListItem->right());
87 anchors->setBottom(pListItem->bottom());
87 // connect visible change so we relayout contentItem88 // connect visible change so we relayout contentItem
89 // FIXME: do this with itemChange!!!
88 connect(this, SIGNAL(visibleChanged()), listItem, SLOT(_q_relayout()));90 connect(this, SIGNAL(visibleChanged()), listItem, SLOT(_q_relayout()));
89}91}
9092
@@ -132,7 +134,8 @@
132 dividerNode = d->sceneGraphContext()->createRectangleNode();134 dividerNode = d->sceneGraphContext()->createRectangleNode();
133 }135 }
134136
135 bool lastItem = d->listItem->countOwner ? (d->listItem->index() == (d->listItem->countOwner->property("count").toInt() - 1)): false;137 UCListItemPrivate *pListItem = UCListItemPrivate::get(d->listItem);
138 bool lastItem = pListItem->countOwner ? (pListItem->index() == (pListItem->countOwner->property("count").toInt() - 1)): false;
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)))) {
137 dividerNode->setRect(boundingRect());140 dividerNode->setRect(boundingRect());
138 dividerNode->setGradientStops(d->gradient);141 dividerNode->setGradientStops(d->gradient);
@@ -195,6 +198,7 @@
195 , xAxisMoveThresholdGU(DEFAULT_SWIPE_THRESHOLD_GU)198 , xAxisMoveThresholdGU(DEFAULT_SWIPE_THRESHOLD_GU)
196 , button(Qt::NoButton)199 , button(Qt::NoButton)
197 , highlighted(false)200 , highlighted(false)
201 , swipeEnabled(true)
198 , contentMoved(false)202 , contentMoved(false)
199 , swiped(false)203 , swiped(false)
200 , suppressClick(false)204 , suppressClick(false)
@@ -1174,7 +1178,7 @@
1174{1178{
1175 Q_Q(UCListItem);1179 Q_Q(UCListItem);
1176 // themes 1.2 and below should not have context menu support, so leave1180 // themes 1.2 and below should not have context menu support, so leave
1177 quint16 version(getTheme()->version());1181 quint16 version(importVersion(q));
1178 if (version <= BUILD_VERSION(1, 2)) {1182 if (version <= BUILD_VERSION(1, 2)) {
1179 return;1183 return;
1180 }1184 }
@@ -1252,10 +1256,15 @@
1252// returns true if the mouse is swiped over the threshold value1256// returns true if the mouse is swiped over the threshold value
1253bool UCListItemPrivate::swipedOverThreshold(const QPointF &mousePos, const QPointF relativePos)1257bool UCListItemPrivate::swipedOverThreshold(const QPointF &mousePos, const QPointF relativePos)
1254{1258{
1259 if ((!leadingActions || UCListItemActionsPrivate::get(leadingActions)->actions.size() <= 0) &&
1260 (!trailingActions || UCListItemActionsPrivate::get(trailingActions)->actions.size() <= 0))
1261 {
1262 return false;
1263 }
1255 qreal threshold = UCUnits::instance().gu(xAxisMoveThresholdGU);1264 qreal threshold = UCUnits::instance().gu(xAxisMoveThresholdGU);
1256 qreal mouseX = mousePos.x();1265 qreal mouseX = mousePos.x();
1257 qreal pressedX = relativePos.x();1266 qreal pressedX = relativePos.x();
1258 return ((mouseX < (pressedX - threshold)) || (mouseX > (pressedX + threshold)));1267 return swipeEnabled && ((mouseX < (pressedX - threshold)) || (mouseX > (pressedX + threshold)));
1259}1268}
12601269
1261void UCListItem::mouseMoveEvent(QMouseEvent *event)1270void UCListItem::mouseMoveEvent(QMouseEvent *event)
@@ -1270,7 +1279,7 @@
12701279
1271 // accept the tugging only if the move is within the threshold1280 // accept the tugging only if the move is within the threshold
1272 // use saved button because MouseMove has no button() and buttons() isn't reliable1281 // use saved button because MouseMove has no button() and buttons() isn't reliable
1273 if (d->button == Qt::LeftButton && d->highlighted && !d->swiped && (d->leadingActions || d->trailingActions)) {1282 if (d->button == Qt::LeftButton && d->highlighted && !d->swiped) {
1274 // check if we can initiate the drag at all1283 // check if we can initiate the drag at all
1275 // only X direction matters, if Y-direction leaves the threshold, but X not, the tug is not valid1284 // only X direction matters, if Y-direction leaves the threshold, but X not, the tug is not valid
1276 if (d->swipedOverThreshold(event->localPos(), d->pressedPos)) {1285 if (d->swipedOverThreshold(event->localPos(), d->pressedPos)) {
@@ -1643,7 +1652,7 @@
1643{1652{
1644 Q_D(UCListItem);1653 Q_D(UCListItem);
1645 d->customColor = false;1654 d->customColor = false;
1646 d->highlightColor = d->getTheme()->getPaletteColor("selected", "background");1655 d->highlightColor = getTheme()->getPaletteColor("selected", "background");
1647 update();1656 update();
1648 Q_EMIT highlightColorChanged();1657 Q_EMIT highlightColorChanged();
1649}1658}
@@ -1794,4 +1803,49 @@
1794 }1803 }
1795}1804}
17961805
1806/*!
1807 * \qmlproperty bool ListItem::swipeEnabled
1808 * \since Ubuntu.Components 1.3
1809 * The property enables the swiping of the leading- or trailing actions. This
1810 * is useful when an overlay component needs to handle mouse moves or drag events
1811 * without the ListItem to steal the events. Defaults to true.
1812 * \qml
1813 * import QtQuick 2.4
1814 * import Ubuntu.Components 1.3
1815 *
1816 * ListView {
1817 * width: units.gu(40)
1818 * height: units.gu(70)
1819 * model: 25
1820 * delegate: ListItem {
1821 * swipeEnabled: !mouseArea.drag.active
1822 * Rectangle {
1823 * color: "red"
1824 * width: units.gu(2)
1825 * height: width
1826 * MouseArea {
1827 * id: mouseArea
1828 * anchors.fill: parent
1829 * drag.target: parent
1830 * }
1831 * }
1832 * }
1833 * }
1834 * \endqml
1835 */
1836bool UCListItem::isSwipeEnabled() const
1837{
1838 Q_D(const UCListItem);
1839 return d->swipeEnabled;
1840}
1841void UCListItem::setSwipeEnabled(bool swipeEnabled)
1842{
1843 Q_D(UCListItem);
1844 if (d->swipeEnabled == swipeEnabled) {
1845 return;
1846 }
1847 d->swipeEnabled = swipeEnabled;
1848 Q_EMIT swipeEnabledChanged();
1849}
1850
1797#include "moc_uclistitem.cpp"1851#include "moc_uclistitem.cpp"
17981852
=== modified file 'src/Ubuntu/Components/plugin/uclistitem.h'
--- src/Ubuntu/Components/plugin/uclistitem.h 2015-09-23 14:31:26 +0000
+++ src/Ubuntu/Components/plugin/uclistitem.h 2015-11-17 15:49:37 +0000
@@ -47,6 +47,7 @@
47 Q_CLASSINFO("DefaultProperty", "listItemData")47 Q_CLASSINFO("DefaultProperty", "listItemData")
48 // 1.348 // 1.3
49 Q_PROPERTY(UCListItemExpansion* expansion READ expansion CONSTANT REVISION 1)49 Q_PROPERTY(UCListItemExpansion* expansion READ expansion CONSTANT REVISION 1)
50 Q_PROPERTY(bool swipeEnabled READ isSwipeEnabled WRITE setSwipeEnabled NOTIFY swipeEnabledChanged FINAL REVISION 1)
50public:51public:
51 explicit UCListItem(QQuickItem *parent = 0);52 explicit UCListItem(QQuickItem *parent = 0);
52 ~UCListItem();53 ~UCListItem();
@@ -65,6 +66,8 @@
65 void resetHighlightColor();66 void resetHighlightColor();
66 // 1.367 // 1.3
67 UCListItemExpansion *expansion();68 UCListItemExpansion *expansion();
69 bool isSwipeEnabled() const;
70 void setSwipeEnabled(bool swipeEnabled);
6871
69protected:72protected:
70 virtual QObject *attachedViewItems(QObject *object, bool create);73 virtual QObject *attachedViewItems(QObject *object, bool create);
@@ -92,6 +95,7 @@
92 void selectModeChanged();95 void selectModeChanged();
93 void actionChanged();96 void actionChanged();
94 void listItemChildrenChanged();97 void listItemChildrenChanged();
98 Q_REVISION(1) void swipeEnabledChanged();
9599
96 void clicked();100 void clicked();
97 void pressAndHold();101 void pressAndHold();
98102
=== modified file 'src/Ubuntu/Components/plugin/uclistitem_p.h'
--- src/Ubuntu/Components/plugin/uclistitem_p.h 2015-09-23 14:31:26 +0000
+++ src/Ubuntu/Components/plugin/uclistitem_p.h 2015-11-17 15:49:37 +0000
@@ -95,6 +95,7 @@
95 qreal xAxisMoveThresholdGU;95 qreal xAxisMoveThresholdGU;
96 Qt::MouseButton button;96 Qt::MouseButton button;
97 bool highlighted:1;97 bool highlighted:1;
98 bool swipeEnabled:1;
98 bool contentMoved:1;99 bool contentMoved:1;
99 bool swiped:1;100 bool swiped:1;
100 bool suppressClick:1;101 bool suppressClick:1;
101102
=== modified file 'src/Ubuntu/Components/plugin/uclistitemlayout.cpp'
--- src/Ubuntu/Components/plugin/uclistitemlayout.cpp 2015-10-01 08:47:31 +0000
+++ src/Ubuntu/Components/plugin/uclistitemlayout.cpp 2015-11-17 15:49:37 +0000
@@ -212,16 +212,7 @@
212UCListItemLayout::UCListItemLayout(QQuickItem *parent)212UCListItemLayout::UCListItemLayout(QQuickItem *parent)
213 : UCSlotsLayout(parent)213 : UCSlotsLayout(parent)
214{214{
215 //don't set the parent, we have to create qqmldata first215
216 UCThreeLabelsSlot *main = new UCThreeLabelsSlot();
217
218 //create QML data for mainSlot otherwise qmlAttachedProperties
219 //calls in SlotsLayout will fail
220 QQmlData::get(main, true);
221 main->setParent(this);
222
223 //this will also set the parentItem
224 UCSlotsLayout::setMainSlot(main);
225}216}
226217
227/*!218/*!
@@ -269,7 +260,25 @@
269 return qobject_cast<UCThreeLabelsSlot *>(mainSlot())->summary();260 return qobject_cast<UCThreeLabelsSlot *>(mainSlot())->summary();
270}261}
271262
272void UCListItemLayout::setMainSlot(QQuickItem *slot) {263QQuickItem *UCListItemLayout::mainSlot() {
264 if (UCSlotsLayout::mainSlot() == Q_NULLPTR) {
265 //don't set the parent, we have to create qqmldata first
266 UCThreeLabelsSlot *main = new UCThreeLabelsSlot();
267
268 //create QML data for mainSlot otherwise qmlAttachedProperties
269 //calls in SlotsLayout will fail (setContextForObject will create the QQmlData)
270 QQmlEngine::setContextForObject(main, qmlContext(this));
271 main->setParent(this);
272
273 //this will also set the parentItem
274 UCSlotsLayout::setMainSlot(main, false);
275 }
276
277 return UCSlotsLayout::mainSlot();
278}
279
280void UCListItemLayout::setMainSlot(QQuickItem *slot, bool fireSignal) {
273 Q_UNUSED(slot);281 Q_UNUSED(slot);
282 Q_UNUSED(fireSignal);
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.";
275}284}
276285
=== modified file 'src/Ubuntu/Components/plugin/uclistitemlayout.h'
--- src/Ubuntu/Components/plugin/uclistitemlayout.h 2015-09-30 15:53:49 +0000
+++ src/Ubuntu/Components/plugin/uclistitemlayout.h 2015-11-17 15:49:37 +0000
@@ -30,9 +30,10 @@
30public:30public:
31 explicit UCListItemLayout(QQuickItem *parent = 0);31 explicit UCListItemLayout(QQuickItem *parent = 0);
3232
33 QQuickItem *mainSlot() override;
33 //we don't allow changing the main slot on ListItemLayout because otherwise34 //we don't allow changing the main slot on ListItemLayout because otherwise
34 //accessing title/subtitle/summary would lead to a crash35 //accessing title/subtitle/summary would lead to a crash
35 void setMainSlot(QQuickItem *slot) override;36 void setMainSlot(QQuickItem *slot, bool fireSignal = true) override;
3637
37 UCLabel *title();38 UCLabel *title();
38 UCLabel *subtitle();39 UCLabel *subtitle();
3940
=== modified file 'src/Ubuntu/Components/plugin/ucqquickimageextension.cpp'
--- src/Ubuntu/Components/plugin/ucqquickimageextension.cpp 2015-05-22 19:39:01 +0000
+++ src/Ubuntu/Components/plugin/ucqquickimageextension.cpp 2015-11-17 15:49:37 +0000
@@ -41,7 +41,7 @@
41 m_image(static_cast<QQuickImageBase*>(parent))41 m_image(static_cast<QQuickImageBase*>(parent))
42{42{
43 QObject::connect(&UCUnits::instance(), SIGNAL(gridUnitChanged()),43 QObject::connect(&UCUnits::instance(), SIGNAL(gridUnitChanged()),
44 this, SLOT(reloadSource()), Qt::UniqueConnection);44 this, SLOT(reloadSource()));
45 // connect sourceChanged signal to extendedSourceChanged45 // connect sourceChanged signal to extendedSourceChanged
46 QObject::connect(m_image, &QQuickImageBase::sourceChanged,46 QObject::connect(m_image, &QQuickImageBase::sourceChanged,
47 this, &UCQQuickImageExtension::extendedSourceChanged);47 this, &UCQQuickImageExtension::extendedSourceChanged);
4848
=== modified file 'src/Ubuntu/Components/plugin/ucslotslayout.cpp'
--- src/Ubuntu/Components/plugin/ucslotslayout.cpp 2015-10-12 14:32:17 +0000
+++ src/Ubuntu/Components/plugin/ucslotslayout.cpp 2015-11-17 15:49:37 +0000
@@ -990,13 +990,18 @@
990 }990 }
991 \endqml991 \endqml
992 */992 */
993QQuickItem *UCSlotsLayout::mainSlot()
994{
995 Q_D(const UCSlotsLayout);
996 return d->mainSlot;
997}
993QQuickItem *UCSlotsLayout::mainSlot() const998QQuickItem *UCSlotsLayout::mainSlot() const
994{999{
995 Q_D(const UCSlotsLayout);1000 Q_D(const UCSlotsLayout);
996 return d->mainSlot;1001 return d->mainSlot;
997}1002}
9981003
999void UCSlotsLayout::setMainSlot(QQuickItem *item)1004void UCSlotsLayout::setMainSlot(QQuickItem *item, bool fireSignal)
1000{1005{
1001 Q_D(UCSlotsLayout);1006 Q_D(UCSlotsLayout);
1002 if (d->mainSlot != item && item != Q_NULLPTR) {1007 if (d->mainSlot != item && item != Q_NULLPTR) {
@@ -1008,7 +1013,10 @@
1008 }1013 }
1009 d->mainSlot = item;1014 d->mainSlot = item;
1010 d->mainSlot->setParentItem(this);1015 d->mainSlot->setParentItem(this);
1011 Q_EMIT mainSlotChanged();1016
1017 if (fireSignal) {
1018 Q_EMIT mainSlotChanged();
1019 }
1012 }1020 }
1013}1021}
10141022
10151023
=== modified file 'src/Ubuntu/Components/plugin/ucslotslayout.h'
--- src/Ubuntu/Components/plugin/ucslotslayout.h 2015-09-30 15:53:49 +0000
+++ src/Ubuntu/Components/plugin/ucslotslayout.h 2015-11-17 15:49:37 +0000
@@ -36,8 +36,9 @@
36public:36public:
37 explicit UCSlotsLayout(QQuickItem *parent = 0);37 explicit UCSlotsLayout(QQuickItem *parent = 0);
3838
39 QQuickItem *mainSlot() const;39 virtual QQuickItem *mainSlot();
40 virtual void setMainSlot(QQuickItem *item);40 virtual QQuickItem *mainSlot() const;
41 virtual void setMainSlot(QQuickItem *item, bool fireSignal = true);
4142
42 UCSlotsLayoutPadding *padding();43 UCSlotsLayoutPadding *padding();
4344
4445
=== modified file 'src/Ubuntu/Components/plugin/ucstyleditembase.cpp'
--- src/Ubuntu/Components/plugin/ucstyleditembase.cpp 2015-10-06 07:16:37 +0000
+++ src/Ubuntu/Components/plugin/ucstyleditembase.cpp 2015-11-17 15:49:37 +0000
@@ -28,7 +28,7 @@
28UCStyledItemBasePrivate::UCStyledItemBasePrivate()28UCStyledItemBasePrivate::UCStyledItemBasePrivate()
29 : styleComponent(Q_NULLPTR)29 : styleComponent(Q_NULLPTR)
30 , styleItem(Q_NULLPTR)30 , styleItem(Q_NULLPTR)
31 , styleVersion(LATEST_UITK_VERSION)31 , styleVersion(0)
32 , activeFocusOnPress(false)32 , activeFocusOnPress(false)
33 , wasStyleLoaded(false)33 , wasStyleLoaded(false)
34{34{
@@ -108,6 +108,7 @@
108 */108 */
109UCStyledItemBase::UCStyledItemBase(QQuickItem *parent)109UCStyledItemBase::UCStyledItemBase(QQuickItem *parent)
110 : QQuickItem(*(new UCStyledItemBasePrivate), parent)110 : QQuickItem(*(new UCStyledItemBasePrivate), parent)
111 , UCThemingExtension(this)
111{112{
112 Q_D(UCStyledItemBase);113 Q_D(UCStyledItemBase);
113 d->init();114 d->init();
@@ -115,6 +116,7 @@
115116
116UCStyledItemBase::UCStyledItemBase(UCStyledItemBasePrivate &dd, QQuickItem *parent)117UCStyledItemBase::UCStyledItemBase(UCStyledItemBasePrivate &dd, QQuickItem *parent)
117 : QQuickItem(dd, parent)118 : QQuickItem(dd, parent)
119 , UCThemingExtension(this)
118{120{
119 Q_D(UCStyledItemBase);121 Q_D(UCStyledItemBase);
120 d->init();122 d->init();
@@ -308,7 +310,7 @@
308 // either styleComponent or styleName is valid310 // either styleComponent or styleName is valid
309 QQmlComponent *component = styleComponent;311 QQmlComponent *component = styleComponent;
310 if (!component) {312 if (!component) {
311 component = getTheme()->createStyleComponent(styleDocument + ".qml", q, styleVersion);313 component = q->getTheme()->createStyleComponent(styleDocument + ".qml", q, styleVersion);
312 }314 }
313 if (!component) {315 if (!component) {
314 return false;316 return false;
@@ -442,41 +444,38 @@
442 * if any, or to the system default theme.444 * if any, or to the system default theme.
443 */445 */
444446
445void UCStyledItemBasePrivate::preThemeChanged()447void UCStyledItemBase::preThemeChanged()
446{448{
447 wasStyleLoaded = (styleItem != Q_NULLPTR);449 Q_D(UCStyledItemBase);
448 preStyleChanged();450 d->wasStyleLoaded = (d->styleItem != Q_NULLPTR);
451 d->preStyleChanged();
449}452}
450void UCStyledItemBasePrivate::postThemeChanged()453void UCStyledItemBase::postThemeChanged()
451{454{
452 Q_EMIT q_func()->themeChanged();455 Q_EMIT themeChanged();
453 if (!wasStyleLoaded) {456 Q_D(UCStyledItemBase);
457 if (!d->wasStyleLoaded) {
454 return;458 return;
455 }459 }
456 postStyleChanged();460 d->postStyleChanged();
457 loadStyleItem();461 d->loadStyleItem();
458}462}
459463
460void UCStyledItemBase::classBegin()464QString UCStyledItemBasePrivate::propertyForVersion(quint16 version) const
461{465{
462 QQuickItem::classBegin();466 switch (MINOR_VERSION(version)) {
463 d_func()->initTheming(this);467 case 3: return QStringLiteral("theme");
468 default: return QString();
469 }
464}470}
465471
466void UCStyledItemBase::componentComplete()472void UCStyledItemBase::componentComplete()
467{473{
468 QQuickItem::componentComplete();474 QQuickItem::componentComplete();
469 Q_D(UCStyledItemBase);475 Q_D(UCStyledItemBase);
470476 // make sure the theme version is up to date
471 QQmlData *data = QQmlData::get(this);477 d->styleVersion = d->importVersion(this);
472 QQmlContextData *cdata = QQmlContextData::get(qmlContext(this));478 UCTheme::checkMixedVersionImports(this, d->styleVersion);
473 QQmlPropertyData l;
474 QQmlPropertyData *pdata = QQmlPropertyCache::property(qmlEngine(this), this, QStringLiteral("theme"), cdata, l);
475 // FIXME MainView internal styler uses theme property, meaning imports13 will be true,
476 // therefore we must check the type of the property as well in case anyone else overrides it
477 d->styleVersion = data->propertyCache->isAllowedInRevision(pdata) && (property("theme").type() != QVariant::String)
478 ? BUILD_VERSION(1, 3)
479 : BUILD_VERSION(1, 2);
480 // no animation at this time479 // no animation at this time
481 // prepare style context if not been done yet480 // prepare style context if not been done yet
482 d->postStyleChanged();481 d->postStyleChanged();
@@ -509,13 +508,4 @@
509 return QQuickItem::childMouseEventFilter(child, event);508 return QQuickItem::childMouseEventFilter(child, event);
510}509}
511510
512// catch UCThemeEvent
513void UCStyledItemBase::customEvent(QEvent *event)
514{
515 Q_D(UCStyledItemBase);
516 if (UCThemeEvent::isThemeEvent(event)) {
517 d->handleThemeEvent(static_cast<UCThemeEvent*>(event));
518 }
519}
520
521#include "moc_ucstyleditembase.cpp"511#include "moc_ucstyleditembase.cpp"
522512
=== modified file 'src/Ubuntu/Components/plugin/ucstyleditembase.h'
--- src/Ubuntu/Components/plugin/ucstyleditembase.h 2015-09-14 11:26:44 +0000
+++ src/Ubuntu/Components/plugin/ucstyleditembase.h 2015-11-17 15:49:37 +0000
@@ -20,20 +20,22 @@
20#define UCSTYLEDITEMBASE_H20#define UCSTYLEDITEMBASE_H
2121
22#include <QtQuick/QQuickItem>22#include <QtQuick/QQuickItem>
23#include "ucthemingextension.h"
2324
24class UCStyledItemBasePrivate;25class UCStyledItemBasePrivate;
25class UCTheme;26class UCTheme;
26class UCStyleHints;27class UCStyleHints;
27class UCStyledItemBase : public QQuickItem28class UCStyledItemBase : public QQuickItem, public UCThemingExtension
28{29{
29 Q_OBJECT30 Q_OBJECT
31 Q_INTERFACES(UCThemingExtension)
30 Q_PROPERTY(bool activeFocusOnPress32 Q_PROPERTY(bool activeFocusOnPress
31 READ activefocusOnPress WRITE setActiveFocusOnPress33 READ activefocusOnPress WRITE setActiveFocusOnPress
32 NOTIFY activeFocusOnPressChanged REVISION 1)34 NOTIFY activeFocusOnPressChanged REVISION 1)
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)
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)
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)
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)
37public:39public:
38 explicit UCStyledItemBase(QQuickItem *parent = 0);40 explicit UCStyledItemBase(QQuickItem *parent = 0);
3941
@@ -53,11 +55,13 @@
53protected:55protected:
54 UCStyledItemBase(UCStyledItemBasePrivate &, QQuickItem *parent);56 UCStyledItemBase(UCStyledItemBasePrivate &, QQuickItem *parent);
5557
56 void classBegin();58 // from UCThemingExtension interface
59 virtual void preThemeChanged();
60 virtual void postThemeChanged();
61
57 void componentComplete();62 void componentComplete();
58 void mousePressEvent(QMouseEvent *event);63 void mousePressEvent(QMouseEvent *event);
59 bool childMouseEventFilter(QQuickItem *child, QEvent *event);64 bool childMouseEventFilter(QQuickItem *child, QEvent *event);
60 void customEvent(QEvent *event);
6165
62private:66private:
63 Q_DECLARE_PRIVATE(UCStyledItemBase)67 Q_DECLARE_PRIVATE(UCStyledItemBase)
6468
=== modified file 'src/Ubuntu/Components/plugin/ucstyleditembase_p.h'
--- src/Ubuntu/Components/plugin/ucstyleditembase_p.h 2015-10-06 07:16:37 +0000
+++ src/Ubuntu/Components/plugin/ucstyleditembase_p.h 2015-11-17 15:49:37 +0000
@@ -22,11 +22,13 @@
22#include <QtQuick/private/qquickitem_p.h>22#include <QtQuick/private/qquickitem_p.h>
23#include "ucstyleditembase.h"23#include "ucstyleditembase.h"
24#include "ucthemingextension.h"24#include "ucthemingextension.h"
25#include "ucimportversionchecker_p.h"
2526
26class QQuickMouseArea;27class QQuickMouseArea;
27class UCStyledItemBase;28class UCStyledItemBase;
28class UCStyledItemBasePrivate : public QQuickItemPrivate, public UCThemingExtension29class UCStyledItemBasePrivate : public QQuickItemPrivate, public UCImportVersionChecker
29{30{
31 Q_INTERFACES(UCThemingExtension)
30 Q_DECLARE_PUBLIC(UCStyledItemBase)32 Q_DECLARE_PUBLIC(UCStyledItemBase)
31public:33public:
3234
@@ -55,8 +57,8 @@
55 virtual void postStyleChanged() {}57 virtual void postStyleChanged() {}
56 virtual bool loadStyleItem(bool animated = true);58 virtual bool loadStyleItem(bool animated = true);
5759
58 virtual void preThemeChanged();60 // from UCImportVersionChecker
59 virtual void postThemeChanged();61 virtual QString propertyForVersion(quint16 version) const;
6062
61public:63public:
6264
6365
=== modified file 'src/Ubuntu/Components/plugin/uctheme.cpp'
--- src/Ubuntu/Components/plugin/uctheme.cpp 2015-09-21 13:29:17 +0000
+++ src/Ubuntu/Components/plugin/uctheme.cpp 2015-11-17 15:49:37 +0000
@@ -44,6 +44,8 @@
44#include <QtQml/private/qqmlbinding_p.h>44#include <QtQml/private/qqmlbinding_p.h>
45#undef foreach45#undef foreach
4646
47
48quint16 UCTheme::previousVersion = 0;
47/*!49/*!
48 * \qmltype ThemeSettings50 * \qmltype ThemeSettings
49 * \instantiates UCTheme51 * \instantiates UCTheme
@@ -345,7 +347,6 @@
345 : QObject(parent)347 : QObject(parent)
346 , m_palette(UCTheme::defaultTheme().m_palette)348 , m_palette(UCTheme::defaultTheme().m_palette)
347 , m_engine(UCTheme::defaultTheme().m_engine)349 , m_engine(UCTheme::defaultTheme().m_engine)
348 , m_version(UCTheme::defaultTheme().m_version)
349 , m_defaultStyle(false)350 , m_defaultStyle(false)
350{351{
351 init();352 init();
@@ -355,7 +356,6 @@
355 : QObject(parent)356 : QObject(parent)
356 , m_palette(NULL)357 , m_palette(NULL)
357 , m_engine(NULL)358 , m_engine(NULL)
358 , m_version(LATEST_UITK_VERSION)
359 , m_defaultStyle(defaultStyle)359 , m_defaultStyle(defaultStyle)
360{360{
361 init();361 init();
@@ -460,6 +460,7 @@
460 }460 }
461 loadPalette();461 loadPalette();
462 Q_EMIT nameChanged();462 Q_EMIT nameChanged();
463 updateThemedItems();
463}464}
464void UCTheme::resetName()465void UCTheme::resetName()
465{466{
@@ -625,52 +626,41 @@
625626
626void UCTheme::attachItem(QQuickItem *item, bool attach)627void UCTheme::attachItem(QQuickItem *item, bool attach)
627{628{
628 UCItemAttached *theming = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(item, false));
629 if (!theming) {
630 return;
631 }
632 if (attach) {629 if (attach) {
633 connect(this, SIGNAL(nameChanged()), theming, SLOT(reloadTheme()), Qt::DirectConnection);630 m_attachedItems.append(item);
634 connect(this, SIGNAL(versionChanged()), theming, SLOT(reloadTheme()), Qt::DirectConnection);
635 } else {631 } else {
636 disconnect(this, SIGNAL(nameChanged()), theming, SLOT(reloadTheme()));632 m_attachedItems.removeOne(item);
637 disconnect(this, SIGNAL(versionChanged()), theming, SLOT(reloadTheme()));633 }
638 }634}
639}635
640636void UCTheme::updateThemedItems()
641/*!637{
642 * \qmlproperty uint16 ThemeSettings::version638 for (int i = 0; i < m_attachedItems.count(); i++) {
643 * \since Ubuntu.Components 1.3639 UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(m_attachedItems[i]);
644 * The property specifies the version of the toolkit the component is declared.640 if (extension) {
645 * This equivalent with the toolkit version the component document imports. Themes,641 extension->itemThemeReloaded(this);
646 * starting of version 1.3, should follow the same versioning as the toolkit does.642 }
647 * If a component's style is not found under the given version, styling will try643 }
648 * to locate the style with a lower minor version until it finds a match.644}
649 *645
650 * The current version of an imported toolkit module is reported by the646/*
651 * \l Ubuntu::toolkitVersion property. If a document imports Ubuntu.Components 1.2,647 * Updates the version used by the toolkit/application
652 * the components will load the system or application themes associated to that
653 * version, and \l Ubuntu::toolkitVersion will report that version. If the document
654 * imports 1.3 version, the components will load 1.3 themes. Setting this property
655 * will initiate a full theme reload.
656 *
657 * Usually developers do not need to set this property on toolkit components as
658 * those already set the version. However themes provided by applications should
659 * take care of versioning the styles and on how to do theming.
660 *
661 * \sa Ubuntu::toolkitVersion, Ubuntu::version, {Themes}
662 */648 */
663quint16 UCTheme::version()649void UCTheme::checkMixedVersionImports(QQuickItem *item, quint16 version)
664{650{
665 return m_version;651 static bool wasShown = false;
666}652 if (version != previousVersion && previousVersion && !wasShown) {
667void UCTheme::setVersion(quint16 version)653 // the first change is due to the first import detection, any further changes would mean there are
668{654 // multiple version imports
669 if (m_version == version) {655 QString msg = QStringLiteral("Mixing of Ubuntu.Components module versions %1.%2 and %3.%4 detected!")
670 return;656 .arg(MAJOR_VERSION(version))
657 .arg(MINOR_VERSION(version))
658 .arg(MAJOR_VERSION(previousVersion))
659 .arg(MINOR_VERSION(previousVersion));
660 qmlInfo(item) << msg;
661 wasShown = true;
671 }662 }
672 m_version = version;663 previousVersion = version;
673 Q_EMIT versionChanged();
674}664}
675665
676/*666/*
@@ -680,10 +670,7 @@
680QQmlComponent* UCTheme::createStyleComponent(const QString& styleName, QObject* parent, quint16 version)670QQmlComponent* UCTheme::createStyleComponent(const QString& styleName, QObject* parent, quint16 version)
681{671{
682 QQmlComponent *component = NULL;672 QQmlComponent *component = NULL;
683673 Q_ASSERT(version);
684 if (!version) {
685 version = m_version;
686 }
687674
688 if (parent != NULL) {675 if (parent != NULL) {
689 QQmlEngine* engine = qmlEngine(parent);676 QQmlEngine* engine = qmlEngine(parent);
@@ -732,7 +719,7 @@
732 m_palette = 0;719 m_palette = 0;
733 }720 }
734 // theme may not have palette defined721 // theme may not have palette defined
735 QUrl paletteUrl = styleUrl("Palette.qml", m_version);722 QUrl paletteUrl = styleUrl("Palette.qml", previousVersion ? previousVersion : LATEST_UITK_VERSION);
736 if (paletteUrl.isValid()) {723 if (paletteUrl.isValid()) {
737 m_palette = QuickUtils::instance().createQmlObject(paletteUrl, m_engine);724 m_palette = QuickUtils::instance().createQmlObject(paletteUrl, m_engine);
738 if (m_palette) {725 if (m_palette) {
739726
=== modified file 'src/Ubuntu/Components/plugin/uctheme.h'
--- src/Ubuntu/Components/plugin/uctheme.h 2015-09-21 07:21:36 +0000
+++ src/Ubuntu/Components/plugin/uctheme.h 2015-11-17 15:49:37 +0000
@@ -28,6 +28,8 @@
28#include <QtQml/QQmlParserStatus>28#include <QtQml/QQmlParserStatus>
29#include <QtQml/QQmlProperty>29#include <QtQml/QQmlProperty>
3030
31#include <QtQml/private/qpodvector_p.h>
32
31#include "ucdefaulttheme.h"33#include "ucdefaulttheme.h"
3234
33class UCStyledItemBase;35class UCStyledItemBase;
@@ -40,8 +42,9 @@
40 Q_PROPERTY(UCTheme *parentTheme READ parentTheme NOTIFY parentThemeChanged FINAL)42 Q_PROPERTY(UCTheme *parentTheme READ parentTheme NOTIFY parentThemeChanged FINAL)
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)
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)
43 Q_PROPERTY(quint16 version READ version WRITE setVersion NOTIFY versionChanged FINAL)
44public:45public:
46
47 static quint16 previousVersion;
45 struct ThemeRecord {48 struct ThemeRecord {
46 ThemeRecord() :49 ThemeRecord() :
47 shared(false), deprecated(false)50 shared(false), deprecated(false)
@@ -75,8 +78,7 @@
75 void resetName();78 void resetName();
76 QObject* palette();79 QObject* palette();
77 void setPalette(QObject *config);80 void setPalette(QObject *config);
78 quint16 version();81 static void checkMixedVersionImports(QQuickItem *item, quint16 version);
79 void setVersion(quint16 version);
8082
81 // internal, used by the deprecated Theme.createStyledComponent()83 // internal, used by the deprecated Theme.createStyledComponent()
82 QQmlComponent* createStyleComponent(const QString& styleName, QObject* parent, quint16 version = 0);84 QQmlComponent* createStyleComponent(const QString& styleName, QObject* parent, quint16 version = 0);
@@ -110,6 +112,7 @@
110 void updateThemePaths();112 void updateThemePaths();
111 QUrl styleUrl(const QString& styleName, quint16 version, bool *isFallback = NULL);113 QUrl styleUrl(const QString& styleName, quint16 version, bool *isFallback = NULL);
112 void loadPalette(bool notify = true);114 void loadPalette(bool notify = true);
115 void updateThemedItems();
113116
114 class PaletteConfig117 class PaletteConfig
115 {118 {
@@ -161,8 +164,8 @@
161 QPointer<QObject> m_palette; // the palette might be from the default style if the theme doesn't define palette164 QPointer<QObject> m_palette; // the palette might be from the default style if the theme doesn't define palette
162 QList<ThemeRecord> m_themePaths;165 QList<ThemeRecord> m_themePaths;
163 UCDefaultTheme m_defaultTheme;166 UCDefaultTheme m_defaultTheme;
167 QPODVector<QQuickItem*, 4> m_attachedItems;
164 QQmlEngine *m_engine;168 QQmlEngine *m_engine;
165 quint16 m_version;
166 bool m_defaultStyle:1;169 bool m_defaultStyle:1;
167 bool m_completed:1;170 bool m_completed:1;
168171
169172
=== modified file 'src/Ubuntu/Components/plugin/ucthemingextension.cpp'
--- src/Ubuntu/Components/plugin/ucthemingextension.cpp 2015-10-08 10:48:10 +0000
+++ src/Ubuntu/Components/plugin/ucthemingextension.cpp 2015-11-17 15:49:37 +0000
@@ -23,103 +23,85 @@
23#include <QtGui/QGuiApplication>23#include <QtGui/QGuiApplication>
2424
25/*25/*
26 * The UCThemingExtension class provides theme handling on Items extending an existing26 * The UCThemingExtension interface provides theme handling on Items extending an existing
27 * QQuickItem derivate class. Items subject fo theming should derive from this class27 * QQuickItem derivate class. Items subject fo theming should derive from this class
28 * and implement the virtual methods, as well as add the following two methods:28 * and implement the pure virtual methods.
29 * 1) classBegin(item) should be called from the QQuickItem::classBegin() method
30 * 2) handleThemeEvent() should be called from QQuickItem::customEvent() method
31 * The item can expose the theme property and use the getters defined by the29 * The item can expose the theme property and use the getters defined by the
32 * class.30 * class.
33 * Iin case the item exposes the theme property, it can use the getters from the31 * In case the item exposes the theme property, it can use the getters from the
34 * extension and declare the themeChanged signal.32 * extension and declare the themeChanged signal.
35 */33 */
3634
37static int themeUpdatedId = QEvent::registerEventType();35void notifyThemeChange(QQuickItem *item, UCTheme *oldTheme, UCTheme *newTheme)
38static int themeReloadedId = QEvent::registerEventType();36{
3937 Q_FOREACH(QQuickItem *child, item->childItems()) {
40UCThemeEvent::UCThemeEvent(UCTheme *reloadedTheme)38 UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(child);
41 : QEvent((QEvent::Type)themeReloadedId)39 if (extension) {
42 , m_oldTheme(Q_NULLPTR)40 extension->itemThemeChanged(oldTheme, newTheme);
43 , m_newTheme(reloadedTheme)41 }
44{42 // StyledItem will handle the broadcast itself depending on whether the theme change was appropriate or not
45 setAccepted(false);43 // and will complete the ascendantStyled/theme itself
46}44 if (!extension) {
4745 notifyThemeChange(child, oldTheme, newTheme);
48UCThemeEvent::UCThemeEvent(UCTheme *oldTheme, UCTheme *newTheme)46 }
49 : QEvent((QEvent::Type)themeUpdatedId)47 }
50 , m_oldTheme(oldTheme)48}
51 , m_newTheme(newTheme)49
52{50void notifyThemeReloaded(QQuickItem *item, UCTheme *theme)
53 setAccepted(false);51{
54}52 Q_FOREACH(QQuickItem *child, item->childItems()) {
5553 UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(child);
56UCThemeEvent::UCThemeEvent(const UCThemeEvent &other)54 if (extension) {
57 : QEvent(other.type())55 extension->itemThemeReloaded(theme);
58 , m_oldTheme(other.m_oldTheme)56 }
59 , m_newTheme(other.m_newTheme)57 // StyledItem will handle the broadcast itself depending on whether the theme change was appropriate or not
60{58 // and will complete the ascendantStyled/theme itself
61 setAccepted(false);59 if (!extension) {
62}60 notifyThemeReloaded(child, theme);
6361 }
64bool UCThemeEvent::isThemeEvent(const QEvent *event)62 }
65{
66 return ((int)event->type() == themeUpdatedId) || ((int)event->type() == themeReloadedId);
67}
68
69void UCThemingExtension::forwardEvent(QQuickItem *item, UCThemeEvent *event)
70{
71 Q_FOREACH(QQuickItem *child, item->childItems()) {
72 QGuiApplication::sendEvent(child, event);
73 // StyledItem will handle the broadcast itself depending on whether the theme change was appropriate or not
74 // and will complete the ascendantStyled/theme itself
75 if (child->childItems().size() > 0 && !UCItemAttached::isThemed(child)) {
76 forwardEvent(child, event);
77 }
78 }
79}
80
81void UCThemingExtension::broadcastThemeChange(QQuickItem *item, UCTheme *oldTheme, UCTheme *newTheme)
82{
83 UCThemeEvent event(oldTheme, newTheme);
84 forwardEvent(item, &event);
85}
86
87void UCThemingExtension::broadcastThemeReloaded(QQuickItem *item, UCTheme *theme)
88{
89 UCThemeEvent event(theme);
90 forwardEvent(item, &event);
91}63}
9264
93/*************************************************************************65/*************************************************************************
94 * Attached to every Item in the system66 * Attached to every Item in the system
95 */67 */
96UCItemAttached::UCItemAttached(QObject *owner)68static uint xdata = QObject::registerUserData();
97 : QObject(owner)69class UCItemAttached : public QObjectUserData, public QQuickItemChangeListener
98 , m_item(static_cast<QQuickItem*>(owner))70{
71public:
72 explicit UCItemAttached(QQuickItem *owner = 0);
73 ~UCItemAttached();
74
75 QQuickItem *m_item;
76 QQuickItem *m_prevParent;
77
78 void itemParentChanged(QQuickItem *item, QQuickItem *newParent);
79
80private:
81
82 friend class UCThemingExtension;
83};
84
85UCItemAttached::UCItemAttached(QQuickItem *owner)
86 : m_item(owner)
99 , m_prevParent(Q_NULLPTR)87 , m_prevParent(Q_NULLPTR)
100 , m_extension(Q_NULLPTR)
101{88{
102 // get parent item changes89 QQuickItemPrivate::get(m_item)->addItemChangeListener(this, QQuickItemPrivate::Parent);
103 connect(m_item, &QQuickItem::parentChanged, this, &UCItemAttached::handleParentChanged);
104}90}
10591
106UCItemAttached::~UCItemAttached()92UCItemAttached::~UCItemAttached()
107{93{
108}94 QQuickItemPrivate::get(m_item)->removeItemChangeListener(this, QQuickItemPrivate::Parent);
10995}
110UCItemAttached *UCItemAttached::qmlAttachedProperties(QObject *owner)96
111{97bool UCThemingExtension::isThemed(QQuickItem *item)
112 return new UCItemAttached(owner);98{
113}99 UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(item);
114100 return extension != Q_NULLPTR;
115bool UCItemAttached::isThemed(QQuickItem *item)
116{
117 UCItemAttached *attached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(item, false));
118 return attached && (attached->m_extension != Q_NULLPTR);
119}101}
120102
121// handle parent changes103// handle parent changes
122void UCItemAttached::handleParentChanged(QQuickItem *newParent)104void UCItemAttached::itemParentChanged(QQuickItem *, QQuickItem *newParent)
123{105{
124 if (newParent == m_prevParent || QQuickItemPrivate::get(m_item)->wasDeleted) {106 if (newParent == m_prevParent || QQuickItemPrivate::get(m_item)->wasDeleted) {
125 return;107 return;
@@ -128,45 +110,43 @@
128 // make sure we have these handlers attached to each intermediate item110 // make sure we have these handlers attached to each intermediate item
129 QQuickItem *oldThemedAscendant = UCThemingExtension::ascendantThemed(m_prevParent);111 QQuickItem *oldThemedAscendant = UCThemingExtension::ascendantThemed(m_prevParent);
130 QQuickItem *newThemedAscendant = UCThemingExtension::ascendantThemed(newParent);112 QQuickItem *newThemedAscendant = UCThemingExtension::ascendantThemed(newParent);
131 UCItemAttached *oldAscendantAttached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(oldThemedAscendant, false));113 UCThemingExtension *oldExtension = qobject_cast<UCThemingExtension*>(oldThemedAscendant);
132 UCItemAttached *newAscendantAttached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(newThemedAscendant, false));114 UCThemingExtension *newExtension = qobject_cast<UCThemingExtension*>(newThemedAscendant);
133 UCThemingExtension *oldAscendantExtension = oldAscendantAttached ? oldAscendantAttached->m_extension : Q_NULLPTR;115 UCTheme *oldTheme = oldExtension ? oldExtension->getTheme() : &UCTheme::defaultTheme();
134 UCThemingExtension *newAscendantExtension = newAscendantAttached ? newAscendantAttached->m_extension : Q_NULLPTR;116 UCTheme *newTheme = newExtension ? newExtension->getTheme() : &UCTheme::defaultTheme();
135 UCTheme *oldTheme = oldAscendantExtension ? oldAscendantExtension->getTheme() : &UCTheme::defaultTheme();
136 UCTheme *newTheme = newAscendantExtension ? newAscendantExtension->getTheme() : &UCTheme::defaultTheme();
137117
138 if (oldTheme != newTheme) {118 if (oldTheme != newTheme) {
119 UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(m_item);
139 // send the event to m_item first120 // send the event to m_item first
140 UCThemeEvent event(oldTheme, newTheme);121 if (extension) {
141 if (m_extension) {
142 // only items with extensions should get this event122 // only items with extensions should get this event
143 m_extension->handleThemeEvent(&event);123 extension->itemThemeChanged(oldTheme, newTheme);
144 }124 }
145 // then broadcast to children, but only if the item is not a styled one125 // then broadcast to children, but only if the item is not a styled one
146 if (!m_extension) {126 if (!extension) {
147 UCThemingExtension::forwardEvent(m_item, &event);127 notifyThemeChange(m_item, oldTheme, newTheme);
148 }128 }
149 }129 }
150 m_prevParent = newParent;130 m_prevParent = newParent;
151}131}
152132
153void UCItemAttached::reloadTheme()
154{
155 Q_ASSERT(m_extension);
156 m_extension->preThemeChanged();
157 m_extension->postThemeChanged();
158 UCThemingExtension::broadcastThemeReloaded(m_item, static_cast<UCTheme*>(sender()));
159}
160
161/*************************************************************************133/*************************************************************************
162 *134 *
163 */135 */
164UCThemingExtension::UCThemingExtension()136UCThemingExtension::UCThemingExtension(QQuickItem *extendedItem)
165 : themedItem(Q_NULLPTR)137 : theme(&UCTheme::defaultTheme())
166 , attachedThemer(Q_NULLPTR)138 , themedItem(extendedItem)
167 , theme(&UCTheme::defaultTheme())
168 , themeType(Inherited)139 , themeType(Inherited)
169{140{
141 theme->attachItem(themedItem, true);
142 themedItem->setUserData(xdata, new UCItemAttached(themedItem));
143}
144
145UCThemingExtension::~UCThemingExtension()
146{
147 if (theme) {
148 theme->attachItem(themedItem, false);
149 }
170}150}
171151
172// set the parent of the theme if the themeType is Custom152// set the parent of the theme if the themeType is Custom
@@ -176,47 +156,50 @@
176 return;156 return;
177 }157 }
178 QQuickItem *upperThemed = ascendantThemed(QQuickItemPrivate::get(themedItem)->parentItem);158 QQuickItem *upperThemed = ascendantThemed(QQuickItemPrivate::get(themedItem)->parentItem);
179 UCItemAttached *attached = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(upperThemed));159 UCThemingExtension *extension = qobject_cast<UCThemingExtension*>(upperThemed);
180 UCTheme *parentTheme = (attached && attached->m_extension) ? attached->m_extension->getTheme() : &UCTheme::defaultTheme();160 UCTheme *parentTheme = extension ? extension->getTheme() : &UCTheme::defaultTheme();
181 if (parentTheme != theme) {161 if (parentTheme != theme) {
182 theme->setParentTheme(parentTheme);162 theme->setParentTheme(parentTheme);
183 }163 }
184}164}
185165
186void UCThemingExtension::initTheming(QQuickItem *item)166void UCThemingExtension::itemThemeChanged(UCTheme*, UCTheme *newTheme)
187{167{
188 themedItem = item;168 switch (themeType) {
189 attachedThemer = static_cast<UCItemAttached*>(qmlAttachedPropertiesObject<UCItemAttached>(themedItem));169 case Inherited: {
190 Q_ASSERT(attachedThemer);170 setTheme(newTheme, Inherited);
191 attachedThemer->m_extension = this;171 return;
192 theme->attachItem(item, true);172 }
173 case Custom: {
174 // set the theme's parent
175 theme->setParentTheme(newTheme);
176 return;
177 }
178 default: break;
179 }
193}180}
194181
195void UCThemingExtension::handleThemeEvent(UCThemeEvent *event)182void UCThemingExtension::itemThemeReloaded(UCTheme *theme)
196{183{
197 if ((int)event->type() == themeUpdatedId) {
198 switch (themeType) {
199 case Inherited: {
200 setTheme(event->newTheme(), Inherited);
201 return;
202 }
203 case Custom: {
204 // set the theme's parent
205 theme->setParentTheme(event->newTheme());
206 return;
207 }
208 default: break;
209 }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: