lp://staging/~kalikiana/ubuntu-ui-toolkit/appname
- Get this branch:
- bzr branch lp://staging/~kalikiana/ubuntu-ui-toolkit/appname
Branch merges
- PS Jenkins bot: Approve (continuous-integration)
- Zsombor Egri: Approve
- Tim Peeters: Pending requested
-
Diff: 376 lines (+286/-0)9 files modifiedmodules/Ubuntu/Components/MainView.qml (+5/-0)
modules/Ubuntu/Components/plugin/plugin.cpp (+7/-0)
modules/Ubuntu/Components/plugin/plugin.pro (+2/-0)
modules/Ubuntu/Components/plugin/ucapplication.cpp (+57/-0)
modules/Ubuntu/Components/plugin/ucapplication.h (+53/-0)
tests/unit/tst_mainview/AppName.qml (+23/-0)
tests/unit/tst_mainview/tst_mainview.cpp (+132/-0)
tests/unit/tst_mainview/tst_mainview.pro (+6/-0)
tests/unit/unit.pro (+1/-0)
Related bugs
Related blueprints
Branch information
Recent revisions
- 713. By Cris Dywan
-
Merge lp:ubuntu-ui-toolkit
-------------g This line and the following will be ignored --------------
removed:
modules/Ubuntu/ Components/ ToolbarActions. qml
added:
examples/ubuntu- ui-toolkit- gallery/ OptionSelectors .qml
examples/ubuntu- ui-toolkit- gallery/ Pickers. qml
examples/ubuntu- ui-toolkit- gallery/ images. png
modules/Ubuntu/ Components/ ListItems/ ItemSelector. qml
modules/Ubuntu/ Components/ OptionSelector. qml
modules/Ubuntu/ Components/ OptionSelectorD elegate. qml
modules/Ubuntu/ Components/ Pickers/
modules/Ubuntu/ Components/ Pickers/ Picker. qml
modules/Ubuntu/ Components/ Pickers/ PickerDelegate. qml
modules/Ubuntu/ Components/ Pickers/ qmldir
modules/Ubuntu/ Components/ Pickers/ ubuntu- components- pickers. qdoc
modules/Ubuntu/ Components/ Themes/ Ambiance/ ListItemOptionS electorStyle. qml
modules/Ubuntu/ Components/ Themes/ Ambiance/ OptionSelectorS tyle.qml
modules/Ubuntu/ Components/ Themes/ Ambiance/ PickerDelegateS tyle.qml
modules/Ubuntu/ Components/ Themes/ Ambiance/ PickerStyle. qml
modules/Ubuntu/ Components/ Themes/ SuruDark/ ListItemOptionS electorStyle. qml
modules/Ubuntu/ Components/ Themes/ SuruDark/ OptionSelectorS tyle.qml
modules/Ubuntu/ Components/ Themes/ SuruGradient/ ListItemOptionS electorStyle. qml
modules/Ubuntu/ Components/ Themes/ SuruGradient/ OptionSelectorS tyle.qml
modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/
modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ chevron_ down@30. png
modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ tick@30. png
modules/Ubuntu/ Components/ artwork/ chevron_ down@30. png
modules/Ubuntu/ Components/ artwork/ tick@30. png
modules/Ubuntu/ Components/ plugin/ unitythemeiconp rovider. cpp
modules/Ubuntu/ Components/ plugin/ unitythemeiconp rovider. h
tests/autopilot/ ubuntuuitoolkit /base.py
tests/autopilot/ ubuntuuitoolkit /tests/ test_base. py
tests/resources/ optionselector/
tests/resources/ optionselector/ test.png
tests/unit/tst_ theme/
tests/unit/tst_ theme/tst_ popoverforegrou ndstyle. qml
tests/unit/tst_ theme/tst_ theme.cpp
tests/unit/tst_ theme/tst_ theme.pro tests/
unit_x11/ tst_components/ tst_listitems_ itemselector. qml
tests/unit_x11/ tst_components/ tst_optionselec tor.qml
tests/unit_x11/ tst_components/ tst_picker. qml
modified:
CHANGES
components.api
debian/changelog
examples/ubuntu- ui-toolkit- gallery/ Buttons. qml
examples/ubuntu- ui-toolkit- gallery/ ListItems. qml
examples/ubuntu- ui-toolkit- gallery/ WidgetsModel. qml
examples/ubuntu- ui-toolkit- gallery/ ubuntu- ui-toolkit- gallery. desktop
modules/Ubuntu/ Components/ ActionList. qml
modules/Ubuntu/ Components/ CrossFadeImage. qml
modules/Ubuntu/ Components/ Icon.qml
modules/Ubuntu/ Components/ ListItems/ Empty.qml
modules/Ubuntu/ Components/ ListItems/ LabelVisual. qml
modules/Ubuntu/ Components/ ListItems/ MultiValue. qml
modules/Ubuntu/ Components/ ListItems/ ValueSelector. qml
modules/Ubuntu/ Components/ ListItems/ qmldir
modules/Ubuntu/ Components/ MainView. qml
modules/Ubuntu/ Components/ Page.qml
modules/Ubuntu/ Components/ PageStack. qml
modules/Ubuntu/ Components/ Panel.qml
modules/Ubuntu/ Components/ Tabs.qml
modules/Ubuntu/ Components/ Themes/ Ambiance/ qmldir
modules/Ubuntu/ Components/ Toolbar. qml
modules/Ubuntu/ Components/ deployment. pri
modules/Ubuntu/ Components/ overview. qdoc
modules/Ubuntu/ Components/ plugin/ giconprovider. cpp
modules/Ubuntu/ Components/ plugin/ plugin. cpp
modules/Ubuntu/ Components/ plugin/ plugin. pro
modules/Ubuntu/ Components/ qmldir
po/ca.po
po/de.po
po/es.po
po/fr.po
po/gl.po
po/he.po
po/ko.po
po/my.po
po/nl.po
po/sv.po
tests/autopilot/ ubuntuuitoolkit /emulators. py
tests/autopilot/ ubuntuuitoolkit /tests/ __init_ _.py
tests/autopilot/ ubuntuuitoolkit /tests/ gallery/ test_gallery. py
tests/autopilot/ ubuntuuitoolkit /tests/ test_emulators. py
tests/unit/tst_ components/ tst_toolbar. qml
tests/unit/unit. pro
tests/unit_x11/ tst_components/ tst_panel. qml
unknown:
documentation/qdoc.err
pending merges:
Leo Arias 2013-09-20 [merge] Added UbuntuUIToolkitAppTestCase as a base test case for the autopilot tests. Fixes: https:/ /bugs.launchpad .net/bugs/ 1227355.
Leo Arias 2013-09-19 Create the local desktop file dir.
Leo Arias 2013-09-19 Create the local desktop file dir.
Leo Arias 2013-09-18 Initialize the local_desktop_file_path as None.
Leo Arias 2013-09-18 Use skipIf from testtools.
Leo Arias 2013-09-18 Fixed ubuntuuitoolkit.tests. test_base. TestUbuntuUIToo lkitAppTestCase .test_phablet_ input_device_ class
Leo Arias 2013-09-18 Removed pdb.
Leo Arias 2013-09-18 Delete the desktop file on tear down.
Leo Arias 2013-09-18 Remove the gallery desktop file copied to .local.
Leo Arias 2013-09-18 Added the Icon and Path parameters.
Leo Arias 2013-09-18 Fixed pep8.
Leo Arias 2013-09-18 Copy the desktop file.
Leo Arias 2013-09-18 Cleaned the gallery tests, and use the desktop file when launching them.
Leo Arias 2013-09-18 Removed the newline from the desktop file.
Leo Arias 2013-09-18 Missing the -- in front of the desktop file parameter.
Leo Arias 2013-09-18 Just use the qmlscene binary.
Leo Arias 2013-09-18 Fixed the temp file usage.
Leo Arias 2013-09-18 Write the desktop file in ~/.local/share/applicati ons
Leo Arias 2013-09-17 Split the UbuntuUiToolkitTestCase for the cases of qml string and qml file. On qml string, write a desktop file.
Leo Arias 2013-09-17 [merge] Merged with trunk.
Leo Arias 2013-09-16 Use the base class on the uitk tests.
Leo Arias 2013-09-16 Removed the launching code, it will be part of the template.
Leo Arias 2013-09-13 Added tests for the app source checking.
Leo Arias 2013-09-13 Do not call the launch_application on set up, as suggested by thomi.
Leo Arias 2013-09-13 Added the launch installed click application.
Leo Arias 2013-09-13 Rolled back to remove the is_desktop method.
Leo Arias 2013-09-12 Added the code for the single qml app test case.
Leo Arias 2013-09-12 Changed the place of the patch.
Leo Arias 2013-09-12 On touch always launch the installed application.
Leo Arias 2013-09-12 Renamed the methods.
Leo Arias 2013-09-11 Forgot to add the test case.
Leo Arias 2013-09-11 Added a general base toolkit app autopilot test case.
Launchpad Translations on behalf of ... 2013-09-17 Launchpad automatic translations update.
Automatic PS uploader 2013-09-16 [merge] Releasing 0.1.46+13.10.20130916- 0ubuntu1 (revision 748 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-09-16 Releasing 0.1.46+13.10.20130916- 0ubuntu1, based on r748
Zsombor Egri 2013-09-11 [merge] Picker component, a tumbler style value selector.
Zsombor Egri 2013-09-11 space between component name and declaration block added
Zsombor Egri 2013-09-11 review comments applied
Zsombor Egri 2013-09-09 link to API documentation fixed in gallery
Zsombor Egri 2013-09-09 API file updated
Zsombor Egri 2013-09-09 Picker moved under its own module; License date updated
Zsombor Egri 2013-09-09 [merge] trunk merge
Zsombor Egri 2013-09-09 i18n test case change reverted
Zsombor Egri 2013-09-09 API file updated
Zsombor Egri 2013-09-06 Picker component
tpeeters 2013-09-11 [merge] Add Panel.open() and Panel.close() functions so that applications can be adapted to use those instead of setting Panel....
tpeeters 2013-09-10 re-trigger jenkins
tpeeters 2013-09-09 remove assignment to function
tpeeters 2013-09-09 update panel test
tpeeters 2013-09-09 [merge] merge trunk
tpeeters 2013-09-04 add open() and close() functions to Panel.
Nicolas d'Offay 2013-09-10 [merge] Fixed bug in the selectors that happened with the "nudging" behaviour which occurred when the selector was scrol...
Nicolas d'Offay 2013-09-04 Added fix for themes.
Nicolas d'Offay 2013-09-04 Fixed scrolling nudge issues.
Lars Uebernickel 2013-09-09 [merge] giconprovider: warn about image://gicon being deprecated.
Lars Uebernickel 2013-09-05 giconprovider: warn about image://gicon being deprecated
Launchpad Translations on behalf of ... 2013-09-08 Launchpad automatic translations update.
Leo Arias 2013-09-05 [merge] Do not duplicate the pointer instantiation on the autopilot emulators. Fixes: https://bugs.launchpad .net/bugs/ 1220346.
Leo Arias 2013-09-03 Remove the model mock and skip the test if we are on the wrong device, as suggested by thomi.
Leo Arias 2013-09-03 Put the return value on the decorator, as suggested by thomi.
Leo Arias 2013-09-03 Fixed pep8 error.
Leo Arias 2013-09-03 Do not duplicate the pointer instantiation.
Automatic PS uploader 2013-09-03 [merge] Releasing 0.1.46+13.10.20130903. 4-0ubuntu1 (revision 741 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-09-03 Releasing 0.1.46+13.10.20130903. 4-0ubuntu1, based on r741
Nicolas d'Offay 2013-09-03 [merge] Hide header label if no label is input.
Nicolas d'Offay 2013-09-03 Fixed up documentation issue.
Nicolas d'Offay 2013-09-03 Fixed selector bug which meant the height was always set to passed in containerHeight even if the content was less.
Nicolas d'Offay 2013-09-03 Fix for OptionSelector.qml:205: ReferenceError: UbuntuAnimation is not defined.
Nicolas d'Offay 2013-09-03 Backed out of fix.
Nicolas d'Offay 2013-09-03 Fixed up some loose ends regarding the text visibility and the import name for Components.
Automatic PS uploader 2013-09-03 [merge] Releasing 0.1.46+13.10.20130903. 3-0ubuntu1 (revision 738 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-09-03 Releasing 0.1.46+13.10.20130903. 3-0ubuntu1, based on r738
Guenter Schwann 2013-09-03 [merge] Fixes tab switching with open toolbar fixes https://bugs.launchpad .net/ubuntu- ui-toolkit/ +bug/1220064. Fixes: ht...
Guenter Schwann 2013-09-03 Fix for the tab switching issue
Guenter Schwann 2013-09-03 Adapt test to show the autopilot tab switching issue
Zoltán Balogh 2013-09-03 [merge] Reverse cherrypicking rev734.
Zoltán Balogh 2013-09-03 Reverse cherrypicking rev734
Zsombor Egri 2013-09-03 [merge] Branch 734 removed, causing Unity test failures.
Zsombor Egri 2013-09-03 735 and 736 branches merged in
<email address hidden> 2013-09-03 [merge] This MP contains some fixes to autopilot test cases. Two test cases are commented for now as they w...
<email address hidden> 2013-09-03 [merge] catch up with trunk
<email address hidden> 2013-09-03 removing the commented out code
<email address hidden> 2013-09-02 [merge] catchup with trunk
<email address hidden> 2013-09-02 reverting the ubuntu-ui-toolkit- gallery. qml changes
Nicolas d'Offay 2013-09-02 [merge] Added ItemSelector.
Nicolas d'Offay 2013-09-02 Added nudging functionality for scrolling.
Nicolas d'Offay 2013-09-02 Changed bool to alias.
Nicolas d'Offay 2013-09-02 Set previousIndex on Selectors back to -1.
Nicolas d'Offay 2013-09-02 Fixed up documentation.
Nicolas d'Offay 2013-09-02 Changed import name of Components.
Nicolas d'Offay 2013-09-02 [merge] Merged trunk.
Nicolas d'Offay 2013-09-02 Reverted SwitchStyle.
Nicolas d'Offay 2013-09-02 Removed some id's.
Nicolas d'Offay 2013-09-02 Fixed typo.
Nicolas d'Offay 2013-08-30 [merge] Merged trunk.
Nicolas d'Offay 2013-08-30 Removed hightFollowsCurrentItem setting.
Nicolas d'Offay 2013-08-30 Added wait for batch tests seems to fix the fail.
Nicolas d'Offay 2013-08-30 Moved mouse a bit in the tests.
Nicolas d'Offay 2013-08-30 renamed test.
Nicolas d'Offay 2013-08-30 Tests pass individually now.
Nicolas d'Offay 2013-08-30 Removed unused test.
Nicolas d'Offay 2013-08-30 Finalised test.
Nicolas d'Offay 2013-08-30 Cleaned up test further.
Nicolas d'Offay 2013-08-30 Updated components.api
Nicolas d'Offay 2013-08-30 Redid test.
Nicolas d'Offay 2013-08-30 Added constrainImage height.
Nicolas d'Offay 2013-08-30 Added tests.
Nicolas d'Offay 2013-08-30 Removed print.
Nicolas d'Offay 2013-08-30 Updated signal.
Nicolas d'Offay 2013-08-30 Added broken tests.
Nicolas d'Offay 2013-08-29 Renamed test.
Nicolas d'Offay 2013-08-29 Added deprecated commentary to ValueSelector documentary.
Nicolas d'Offay 2013-08-29 Fixed up examples in gallery for ListItems now that ItemSelector exists.
Nicolas d'Offay 2013-08-29 Renamed ListItem/OptionSelector to ItemSelector to fix documentation generation and fixed documentation mix up.
Nicolas d'Offay 2013-08-29 Removed Components prefix from OptionSelectors.
Nicolas d'Offay 2013-08-29 [merge] Merged trunk.
Nicolas d'Offay 2013-08-29 Added to CHANGES.
Nicolas d'Offay 2013-08-29 Made some properties readonly.
Nicolas d'Offay 2013-08-29 Added click signal to OptionSelectors.
Nicolas d'Offay 2013-08-29 Added documentation to OptionSelectorDelegate.
Nicolas d'Offay 2013-08-29 Backed out fix in SwitchStyle, it's already landed.
Nicolas d'Offay 2013-08-28 Fixed up ListItem OptionSelector and made some minor modifications to accomodate Component OptionSelector.
Nicolas d'Offay 2013-08-28 [merge] Fixed SwitchStyle to find correct tick asset.
Nicolas d'Offay 2013-08-28 Updated documentation for ListItem OptionSelector.
Nicolas d'Offay 2013-08-27 Update ListItem class.
Nicolas d'Offay 2013-08-06 Added signal emitted when list view delegate is selected, fixed up states for chevron/tick changes and added art assets.
Nicolas d'Offay 2013-07-30 Added list item option selector test.
Nicolas d'Offay 2013-07-24 Added extra documentation to var value.
Nicolas d'Offay 2013-07-24 Changed container call to emit signal on scroll instead.
Nicolas d'Offay 2013-07-23 [merge] Merged trunk.
Nicolas d'Offay 2013-07-23 Added scrolling container functionality.
Nicolas d'Offay 2013-07-18 Added style for ListItem option selector.
tpeeters 2013-09-02 [merge] New toolbar reveal/hide behavior, as specified by design. Fixes: https://bugs.launchpad .net/bugs/ 1207369.
tpeeters 2013-09-02 lock and close toolbar when there are no tools
tpeeters 2013-09-02 update tests
tpeeters 2013-09-02 add toolbar hide timer
tpeeters 2013-09-02 open toolbar when changing tools
tpeeters 2013-09-02 [merge] merge trunk
tpeeters 2013-09-02 re-enable commented-out code
tpeeters 2013-09-02 clean; remove debugging code
tpeeters 2013-09-02 fix CHANGES
tpeeters 2013-09-02 update panel test
tpeeters 2013-09-02 update tests
tpeeters 2013-09-02 fix hide behavior for empty toolbar
tpeeters 2013-09-02 fix style for toolbar in panels example
tpeeters 2013-08-30 TODO: continue with ensuring correct behavior when changing pages/tools
tpeeters 2013-08-30 fix issues with previousState. NEXT: toolbar doesn't hide automatically
tpeeters 2013-08-30 better fix. don't open/close when interacting with the toolbar
tpeeters 2013-08-30 fix <Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.
tpeeters 2013-08-30 IN PROGRESS: making Panel.opened read-only and add open() and close() functions.
tpeeters 2013-08-29 [merge] merge toolbar-clean
Launchpad Translations on behalf of ... 2013-08-31 Launchpad automatic translations update.
Automatic PS uploader 2013-08-30 [merge] Releasing 0.1.46+13.10.20130830. 1-0ubuntu1 (revision 731 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-30 Releasing 0.1.46+13.10.20130830. 1-0ubuntu1, based on r731
tpeeters 2013-08-30 [merge] Clean toolbar code by removing deprecated properties and updating tests.
tpeeters 2013-08-29 [merge] merge trunk
tpeeters 2013-08-28 add \default for qdoc
tpeeters 2013-08-28 [merge] merge trunk
tpeeters 2013-08-23 update CHANGES
tpeeters 2013-08-23 update components.api
tpeeters 2013-08-23 update toolbar test
tpeeters 2013-08-22 remove clickable item detection in Panel
tpeeters 2013-08-22 remove ToolbarActions and deprecated properties in PageStack and Tabs
tpeeters 2013-08-22 remove deprecated toolbar-related properties
tpeeters 2013-08-22 update tools doc
<email address hidden> 2013-08-30 [merge] ajusted the buttons laytout to make it fit to phone screen size. https://bugs.launchpad .net/ubuntu-...
<email address hidden> 2013-08-30 bug attached
<email address hidden> 2013-08-30 adjust the buttons layout so that it fits the phone screen size. Bug#1218749
tpeeters 2013-08-30 [merge] Quick fix, completely untested. Might mess up apps with list items that do not use popovers. Have a look to see if you ...
tpeeters 2013-08-29 detect for LabelVisual inside a list item whether it is inside an overlay (Popover) to use the correct text color
Automatic PS uploader 2013-08-29 [merge] Releasing 0.1.46+13.10.20130829. 2-0ubuntu1 (revision 727 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-29 Releasing 0.1.46+13.10.20130829. 2-0ubuntu1, based on r727
Automatic PS uploader 2013-08-29 [merge] Releasing 0.1.46+13.10.20130829. 1-0ubuntu1 (revision 725 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-29 Releasing 0.1.46+13.10.20130829. 1-0ubuntu1, based on r725
Olivier Tilloy 2013-08-29 [merge] Fix a typo in Panel.qml. Fixes: https://bugs.launchpad .net/bugs/ 1218331.
Olivier Tilloy 2013-08-29 Fix a typo in Panel.qml.
Antti Kaijanmäki 2013-08-29 [merge] Add UnityThemeIconProvider - A QQuickImageProvider that loads icons from the current icon theme, following the ...
Antti Kaijanmäki 2013-08-28 remove test case
Antti Kaijanmäki 2013-08-28 remove notifyosd icons from gallery.
Antti Kaijanmäki 2013-08-28 [merge] merge from upstream
Antti Kaijanmäki 2013-08-28 Test for unity-theme-icon-provider
Michal Hruby 2013-08-23 Remove forced search paths update
Michal Hruby 2013-08-23 [merge] Merge trunk
Nick Dedekind 2013-08-19 Added theme icon provider size fix.
Antti Kaijanmäki 2013-08-19 Add /usr/share/pixmaps to theme search path.
Antti Kaijanmäki 2013-08-19 add notify-osd icons to gallery Icon section.
Antti Kaijanmäki 2013-08-19 Add /usr/share/notify- osd/icons to theme search paths.
Antti Kaijanmäki 2013-08-19 Use theme icon provider instead of gicon
Antti Kaijanmäki 2013-08-19 [merge] Merge from trunk.
Lars Uebernickel 2013-08-07 Add UnityThemeIconProvider
Zsombor Egri 2013-08-29 [merge] Tick artwork reverted into Ambiance theme breaking Switch and CheckBox components. .
Zsombor Egri 2013-08-29 recovering tick artwork to Ambiance theme
Automatic PS uploader 2013-08-29 [merge] Releasing 0.1.46+13.10.20130829- 0ubuntu1 (revision 722 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-29 Releasing 0.1.46+13.10.20130829- 0ubuntu1, based on r722
Nicolas d'Offay 2013-08-28 [merge] Themed UbuntuShape OptionSelector. Fixes: https://bugs.launchpad .net/bugs/ 1202170.
Nicolas d'Offay 2013-08-28 Changed documentation again, OptionSelector is a component, not a ListItem.
Nicolas d'Offay 2013-08-28 Removed some text from the OptionSelectorDelegate.
Nicolas d'Offay 2013-08-28 Updated docs.
Nicolas d'Offay 2013-08-28 [merge] Merged trunk.
Nicolas d'Offay 2013-08-28 Bazaar seemed to be confused, redid changes.
Nicolas d'Offay 2013-08-28 Comitted revert
Automatic PS uploader 2013-08-28 [merge] Releasing 0.1.46+13.10.20130828. 1-0ubuntu1 (revision 719 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-28 Releasing 0.1.46+13.10.20130828. 1-0ubuntu1, based on r719
Nicolas d'Offay 2013-08-28 [merge] Fixed output issue: CrossFadeImage.qml:39: Unable to assign QSize to QSizeF. Fixes: https:/ /bugs.launchpad .net/b...
Nicolas d'Offay 2013-08-23 Fixed output issue with binding size.
Michael Zanetti 2013-08-28 [merge] add a test for PopoverForegroundStyle.
Michael Zanetti 2013-08-28 add unit test for PopoverForegroundStyle
Automatic PS uploader 2013-08-28 [merge] Releasing 0.1.46+13.10.20130828- 0ubuntu1 (revision 717 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-28 Releasing 0.1.46+13.10.20130828- 0ubuntu1, based on r717
Timo Jyrinki 2013-08-28 Sync changelog.
Zsombor Egri 2013-08-28 [merge] Fixing Unity8 crash with the latest SDK release. (LP: #1217650)
Zsombor Egri 2013-08-28 attaching bug
Zsombor Egri 2013-08-28 Themed UbuntuShape OptionSelector removed as crashes launcher
Automatic PS uploader 2013-08-27 [merge] Releasing 0.1.46+13.10.20130827- 0ubuntu1 (revision 714 from lp:ubuntu-ui-toolkit).
Automatic PS uploader 2013-08-27 Releasing 0.1.46+13.10.20130827- 0ubuntu1, based on r714
Nicolas d'Offay 2013-08-27 [merge] Themed UbuntuShape OptionSelector. Fixes: https://bugs.launchpad .net/bugs/ 1202170.
Nicolas d'Offay 2013-08-27 Updated components.api
Nicolas d'Offay 2013-08-27 Used colour fragment shader for OptionSelector.
Nicolas d'Offay 2013-08-27 Reverted Icon.qml.
Nicolas d'Offay 2013-08-23 Split shader and image in Icon to ColouriseImage. Removed shader in Option Selector and used this new component instead.
Nicolas d'Offay 2013-08-23 Changed preview to expanded.
Nicolas d'Offay 2013-08-23 Fixed bug with collapsed list and scrolling. Added preview with icon.
Nicolas d'Offay 2013-08-23 [merge] Merged om26er's autopilot fix.
Omer Akram 2013-08-23 fix failing autopilot test
Nicolas d'Offay 2013-08-23 Update components.api
Nicolas d'Offay 2013-08-23 Added functionatlity to set maximum container height with scrolling within the option selector.
Nicolas d'Offay 2013-08-23 Changed CHANGES and tests.
Nicolas d'Offay 2013-08-23 Added variable icon to option selector.
Nicolas d'Offay 2013-08-23 Fixed up tests, added to option selector test.
Nicolas d'Offay 2013-08-23 Added subtext property to selector delegate.
Nicolas d'Offay 2013-08-23 Fixed gallery and changed label.
Nicolas d'Offay 2013-08-22 Replace components to pass tests.
Nicolas d'Offay 2013-08-22 Got rid of deselected index.
Nicolas d'Offay 2013-08-22 Fixed tests.
Nicolas d'Offay 2013-08-22 Added custom model test to option selector.
Nicolas d'Offay 2013-08-22 [merge] Resolved conflcits.
Nicolas d'Offay 2013-08-21 Minor tweaks to OptionSelector.qml
Nicolas d'Offay 2013-08-21 Added to CHANGES.
Nicolas d'Offay 2013-08-20 Created OptionSelectorDelegate.
Nicolas d'Offay 2013-08-16 Changed scrolling signal.
Nicolas d'Offay 2013-08-15 Added option seletor to test items.
Nicolas d'Offay 2013-08-15 Fixed documentation, renamed Components import.
Nicolas d'Offay 2013-08-14 Moved fragement shader down.
Nicolas d'Offay 2013-08-14 Added more comments.
Nicolas d'Offay 2013-08-14 Fixed first option flicker.
Nicolas d'Offay 2013-08-14 Fixed fade in/out tick for expanding selector.
Nicolas d'Offay 2013-08-14 Replaced components.api.
Nicolas d'Offay 2013-08-14 [merge] Reverted some changes and fixed more animations bugs.
Nicolas d'Offay 2013-08-14 Removed previous index clause from fade out.
Nicolas d'Offay 2013-08-14 Attempted fix for image change opacity bug.
Nicolas d'Offay 2013-08-14 Reverted some changes and fixed more animations bugs.
Nicolas d'Offay 2013-08-13 Added pause after collapse to change back to chevron.
Nicolas d'Offay 2013-08-13 Quickened expanded fade in/out speed again.
Nicolas d'Offay 2013-08-13 Matched animations to timeline.
Nicolas d'Offay 2013-08-13 Fixed up collapsing animation and extended expanded selection change fade in/out.
Nicolas d'Offay 2013-08-13 Added extra commentary and fixed a bad copy and paste.
Nicolas d'Offay 2013-08-13 Added alias in Empty to changes.
Nicolas d'Offay 2013-08-13 Added fade in/out for the divider line of the currently selected index.
Nicolas d'Offay 2013-08-13 Fade out first before starting the rest of the animations.
Nicolas d'Offay 2013-08-13 Fixed tick flicker bug.
Nicolas d'Offay 2013-08-13 Fixed spacing in example.
Nicolas d'Offay 2013-08-13 Sped up animations more.
Nicolas d'Offay 2013-08-13 Fixed multiple selection bug.
Nicolas d'Offay 2013-08-13 Fixed up collapsing image change bug.
Nicolas d'Offay 2013-08-13 Sped up animation speeds.
Nicolas d'Offay 2013-08-12 Made OptionSelector use one image instead of two.
Nicolas d'Offay 2013-08-12 Changed animations to stand alones.
Nicolas d'Offay 2013-08-12 Fixed up OptionSelector according to comments.
Nicolas d'Offay 2013-08-12 Reverted back to using two images to preserve opacity transitions.
Nicolas d'Offay 2013-08-12 [merge] Condensed fade in/out into single image.
Michael Zanetti 2013-08-12 simplify
Michael Zanetti 2013-08-12 fix chevron/tick animation sequence
Nicolas d'Offay 2013-08-12 Removed unused animation.
Nicolas d'Offay 2013-08-09 Fixed bad merge.
Nicolas d'Offay 2013-08-09 [merge] Fixed diverged branches.
Nicolas d'Offay 2013-08-09 Fixed bug issue with tick and chevron display/hide.
Nicolas d'Offay 2013-08-09 Fixed backwards logic.
Nicolas d'Offay 2013-08-09 Corrected name of signal in CHANGES and moved signal to after state change.
Nicolas d'Offay 2013-08-09 Fixed bug with divider line moving text when invisible. Removed opacity alias for bottom divider in Empty. Updated CHANGES.
Nicolas d'Offay 2013-08-09 Reverted cross fade image, and redid image fade in/out by using states and transitions in OptionSelector.
Nicolas d'Offay 2013-08-08 Fixed up some more bugs with the option selector image.
Nicolas d'Offay 2013-08-08 Delayed the chevron to tick animation change.
Nicolas d'Offay 2013-08-08 Changed state triggers again.
Nicolas d'Offay 2013-08-08 Changed animations.
Nicolas d'Offay 2013-08-08 Added delay between fading images.
Nicolas d'Offay 2013-08-07 Fixed opacity delegate bug.
Nicolas d'Offay 2013-08-07 Changed name in WidgetsModel.
Nicolas d'Offay 2013-08-07 Modified OptionSelector animation. Added ShaderEffect colouring to CrossFadeImage.
Nicolas d'Offay 2013-08-06 Added tick fade.
Nicolas d'Offay 2013-08-06 Added opacity state change to list view delegate.
Nicolas d'Offay 2013-08-06 Added space in example label.
Nicolas d'Offay 2013-08-06 Added delay between tick and chevron change.
Nicolas d'Offay 2013-08-05 Removed showDivider from the ListView delegate. It's now all handled by the opacity.
Nicolas d'Offay 2013-08-05 Added signal which is emitted when ListView delegate is selected.
Nicolas d'Offay 2013-08-05 Fixed text height issue and removed a FIXME from Empty list item.
Nicolas d'Offay 2013-08-05 Disabled hightlight in branch.
Nicolas d'Offay 2013-07-26 Modified signal test to correctly reflect how it's triggered.
Nicolas d'Offay 2013-07-26 Added signal test.
Nicolas d'Offay 2013-07-26 Fixed up option selector test.
Nicolas d'Offay 2013-07-26 Added OptionSelector test.
Nicolas d'Offay 2013-07-26 [merge] Merged trunk.
Nicolas d'Offay 2013-07-25 Renamed another asset!
Nicolas d'Offay 2013-07-25 Renamed asset.
Nicolas d'Offay 2013-07-25 [merge] Merged trunk.
Nicolas d'Offay 2013-07-25 [merge] Merged trunk.
Nicolas d'Offay 2013-07-24 Fixed up tests.
Nicolas d'Offay 2013-07-24 Added extra documentation to var value.
Nicolas d'Offay 2013-07-24 Changed container call to emit signal on scroll instead.
Nicolas d'Offay 2013-07-23 [merge] Merged trunk.
Nicolas d'Offay 2013-07-23 Added container check for scroll functionality.
Nicolas d'Offay 2013-07-18 [merge] Merged trunk.
Nicolas d'Offay 2013-07-17 Changed spacing for the label.
Nicolas d'Offay 2013-07-17 Fixed up positioning with Standard ListItem.
Nicolas d'Offay 2013-07-17 Added SuruDark and SuruGradient themes for the OptionSelector.
Nicolas d'Offay 2013-07-15 Sorted out the assets.
Nicolas d'Offay 2013-07-15 Created Ubuntu Shape.
Nicolas d'Offay 2013-07-15 First test of themes with UbuntuShape background.
Nicolas d'Offay 2013-07-15 Added option selector to gallery example.=== modified file 'CHANGES'
--- a/CHANGES 2013-08-01 13:39:05 +0000
+++ b/CHANGES 2013-09-23 08:28:34 +0000
@@ -9,7 +9,15 @@API Changes
***********
-
+* ADDED IN: OptionSelectorDelegate: property bool constrainImage
+* ADDED IN: Empty: property alias divider
+* ADDED IN: ListItems/OptionSelector: signal delegateSelected()
+* REMOVED IN: OptionSelector: signal scroll()
+* ADDED IN: OptionSelector: signal delegateSelected()
+* ADDED: ListItem OptionSelector to Components/ListItems
+* ADDED: ListItemOptionSelectorStyle to Components/ Ambiance/ ListItems
+* ADDED: ListItemOptionSelectorStyle to Components/ SuruDark/ ListItems
+* ADDED: ListItemOptionSelectorStyle to Components/ SuruGradient/ ListItems
* REMOVED IN ALL: attached property ItemStyle
* ADDED IN OrientationHelper: property alias rotating
* ADDED IN OrientationHelper: property alias __orientationHelper
@@ -20,10 +28,10 @@
* CHANGED IN Toolbar: property bool lock TO property bool locked
* CHANGED IN ToolbarActions: property bool active TO property bool opened
* CHANGED IN ToolbarActions: property bool lock TO property bool locked
-* DEPRECATED IN Toolbar: property bool active
-* DEPRECATED IN Toolbar: property bool lock
-* DEPRECATED IN ToolbarActions: property bool active
-* DEPRECATED IN ToolbarActions: property bool lock
+* REMOVED IN Toolbar: property bool active
+* REMOVED IN Toolbar: property bool lock
+* REMOVED IN ToolbarActions: property bool active
+* REMOVED IN ToolbarActions: property bool lock
* CHANGED IN Page: property Header header TO property Header __propagated.header
* CHANGED IN Page: property Toolbar toolbar TO property Toolbar __propagated.toolbar
* CHANGED IN MainView: property Header header TO property Header __propagated.header
@@ -38,10 +46,13 @@
* CHANGED IN Toolbar: property ToolbarActions tools TO property Item tools
* DEPRECATED IN Action: property bool visible
* DEPRECATED IN Action: property Item itemHint
-* DEPRECATED: ToolbarActions component (use ToolbarItems instead)
+* REMOVED ToolbarActions (use ToolbarItems instead)
* ADDED IN MainView: property bool anchorToKeyboard
* CHANGED IN Tabs: property Component __headerContents TO property TabBar tabBar
* CHANGED IN Header: property Component contents TO property Item contents
+* ADDED IN Panel: function open()
+* ADDED IN Panel: function closed()
+* DEPRECATED IN Panel: writable property opened. Will be made read-only.Compatibility Breaks
************* ******* === modified file 'components.api'
--- a/components.api 2013-09-16 15:53:53 +0000
+++ b/components.api 2013-09-23 08:29:23 +0000
@@ -87,8 +87,6 @@
default property internal contentsItem
property list<Action> actions
property UnityActions.ActionManager actionManager
- property ToolbarActions tools
- onToolsChanged
modules/Ubuntu/ Components/ ModelSectionCou nter.qml
Object
property var view
@@ -99,6 +97,24 @@
modules/Ubuntu/ Components/ Object. qml
QtObject
default property internal children
+modules/Ubuntu/ Components/ OptionSelector. qml
+ListItem.Empty
+ property var model
+ property bool expanded
+ property bool colourImage
+ property real containerHeight
+ property int selectedIndex
+ signal delegateClicked(int index)
+modules/Ubuntu/ Components/ OptionSelectorD elegate. qml
+ListItem.Standard
+ property string text
+ property string subText
+ property url icon
+ property bool constrainImage
+ property bool colourImage
+ property color assetColour
+ readonly property ListView listView
+ readonly property string fragColourShader
modules/Ubuntu/ Components/ OrientationHelp er.qml
Item
property bool automaticOrientation
@@ -114,8 +130,6 @@
modules/Ubuntu/ Components/ PageStack. qml
PageTreeNode
property bool __showHeader
- property ToolbarActions tools
- onToolsChanged
property int depth
property Item currentPage
function push(page, properties)
@@ -144,6 +158,8 @@
default property list<Object> contents
property int align
property bool opened
+ function open()
+ function close()
property bool locked
property real hintSize
property real triggerSize
@@ -193,8 +209,6 @@
readonly property Tab selectedTab
readonly property Item currentPage
property TabBar tabBar
- property ToolbarActions tools
- onToolsChanged
property internal __tabs
default property list<Item> tabChildren
signal modelChanged()
@@ -336,20 +350,7 @@
ActionSelectionPopover
modules/Ubuntu/ Components/ Toolbar. qml
Panel
- property bool active
- property bool lock
property Item tools
-modules/Ubuntu/ Components/ ToolbarActions. qml
-Item
- default property list<Action> children
- property list<Action> actions
- property Action back
- property Item __pageStack
- property bool opened
- property bool active
- property bool lock
- property bool locked
- function __hasVisibleActions()
modules/Ubuntu/ Components/ ToolbarButton. qml
ActionItem
modules/Ubuntu/ Components/ ToolbarItems. qml === modified file 'debian/changelog'
--- a/debian/changelog 2013-08-26 18:34:53 +0000
+++ b/debian/changelog 2013-09-23 08:28:34 +0000
@@ -1,3 +1,180 @@
+ubuntu-ui-toolkit (0.1.46+13.10.20130916- 0ubuntu1) saucy; urgency=low
+
+ [ Zsombor Egri ]
+ * Picker component, a tumbler style value selector.
+
+ [ Leo Arias ]
+ * Do not duplicate the pointer instantiation on the autopilot
+ emulators. (LP: #1220346)
+
+ [ Nicolas d'Offay ]
+ * Fixed bug in the selectors that happened with the "nudging"
+ behaviour which occurred when the selector was scrolled. It used to
+ nudge past boundaries and if the same index was selected. This has
+ been fixed. Fixed SuruDark and SuruGradient ListItemSelector themes.
+
+ [ tpeeters ]
+ * Add Panel.open() and Panel.close() functions so that applications
+ can be adapted to use those instead of setting Panel.opened. The
+ behavior of the panel was not changed, this will be done in a
+ following MR. Also note that applications with a Toolbar do not need
+ to use Panel.open()/close( )/opened directly, they can use the opened
+ property of the Page.tools, so they should not be affected by the
+ upcoming changes.
+
+ [ Lars Uebernickel ]
+ * giconprovider: warn about image://gicon being deprecated.
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 748
+
+ -- Ubuntu daily release <email address hidden> Mon, 16 Sep 2013 11:35:05 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130903. 4-0ubuntu1) saucy; urgency=low
+
+ [ Nicolas d'Offay ]
+ * Hide header label if no label is input. Fix for:
+ OptionSelector.qml:205: ReferenceError: UbuntuAnimation is not
+ defined Fixed containerHeight affecting the entire Selector's height
+ even if the contentHeight was less. (LP: #1220130)
+
+ [ Guenter Schwann ]
+ * Fixes tab switching with open toolbar fixes
+ https://bugs.launchpad .net/ubuntu- ui-toolkit/ +bug/1220064. (LP:
+ #1220064)
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 741
+
+ -- Ubuntu daily release <email address hidden> Tue, 03 Sep 2013 15:16:50 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130903. 3-0ubuntu1) saucy; urgency=low
+
+ [ Zoltán Balogh ]
+ * Reverse cherrypicking rev734.
+
+ [ Zsombor Egri ]
+ * Branch 734 removed, causing Unity test failures.
+
+ [ Nicolas d'Offay ]
+ * Added ItemSelector. Extend OptionSelector and fixed various bugs.
+ Added tests for both OptionSelector and ItemSelector. (LP: #1169258,
+ #1218250, #1218247)
+
+ [ tpeeters ]
+ * New toolbar reveal/hide behavior, as specified by design. (LP:
+ #1207369)
+
+ [ <email address hidden> ]
+ * This MP contains some fixes to autopilot test cases. Two test cases
+ are commented for now as they were giving inconsistent results on
+ phone. .
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 738
+
+ -- Ubuntu daily release <email address hidden> Tue, 03 Sep 2013 11:46:19 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130830. 1-0ubuntu1) saucy; urgency=low
+
+ [ tpeeters ]
+ * Quick fix, completely untested. Might mess up apps with list items
+ that do not use popovers. Have a look to see if you can use this
+ code and it doesn't break anything. (LP: #1205094)
+ * Clean toolbar code by removing deprecated properties and updating
+ tests.
+
+ [ <email address hidden> ]
+ * ajusted the buttons laytout to make it fit to phone screen size.
+ https://bugs.launchpad .net/ubuntu- ui-toolkit/ +bug/1218749 . (LP:
+ #1218749)
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 731
+
+ -- Ubuntu daily release <email address hidden> Fri, 30 Aug 2013 12:44:49 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130829. 2-0ubuntu1) saucy; urgency=low
+
+ [ Olivier Tilloy ]
+ * Fix a typo in Panel.qml. (LP: #1218331)
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 727
+
+ -- Ubuntu daily release <email address hidden> Thu, 29 Aug 2013 15:22:45 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130829. 1-0ubuntu1) saucy; urgency=low
+
+ [ Michal Hruby ]
+ * Add UnityThemeIconProvider - A QQuickImageProvider that loads icons
+ from the current icon theme, following the xdg icon spec.
+
+ [ Zsombor Egri ]
+ * Tick artwork reverted into Ambiance theme breaking Switch and
+ CheckBox components. .
+
+ [ Antti Kaijanmäki ]
+ * Add UnityThemeIconProvider - A QQuickImageProvider that loads icons
+ from the current icon theme, following the xdg icon spec.
+
+ [ Nick Dedekind ]
+ * Add UnityThemeIconProvider - A QQuickImageProvider that loads icons
+ from the current icon theme, following the xdg icon spec.
+
+ [ Lars Uebernickel ]
+ * Add UnityThemeIconProvider - A QQuickImageProvider that loads icons
+ from the current icon theme, following the xdg icon spec.
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 725
+
+ -- Ubuntu daily release <email address hidden> Thu, 29 Aug 2013 11:09:48 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130829- 0ubuntu1) saucy; urgency=low
+
+ [ Nicolas d'Offay ]
+ * Fixed output issue: CrossFadeImage.qml:39: Unable to assign QSize to
+ QSizeF. (LP: #1217848)
+ * Themed UbuntuShape OptionSelector. (LP: #1202170)
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 722
+
+ -- Ubuntu daily release <email address hidden> Thu, 29 Aug 2013 02:45:45 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130828. 1-0ubuntu1) saucy; urgency=low
+
+ [ Michael Zanetti ]
+ * add a test for PopoverForegroundStyle.
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 719
+
+ -- Ubuntu daily release <email address hidden> Wed, 28 Aug 2013 11:16:47 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130828- 0ubuntu1) saucy; urgency=low
+
+ * Automatic snapshot from revision 717
+
+ -- Ubuntu daily release <email address hidden> Wed, 28 Aug 2013 08:19:49 +0000
+
+ubuntu-ui-toolkit (0.1.46+13.10.20130827- 0ubuntu1) saucy; urgency=low
+
+ [ Michael Zanetti ]
+ * Themed UbuntuShape OptionSelector. (LP: #1202170)
+
+ [ Omer Akram ]
+ * Themed UbuntuShape OptionSelector. (LP: #1202170)
+
+ [ Nicolas d'Offay ]
+ * Themed UbuntuShape OptionSelector. (LP: #1202170)
+
+ [ Ubuntu daily release ]
+ * Automatic snapshot from revision 714
+
+ -- Ubuntu daily release <email address hidden> Tue, 27 Aug 2013 19:11:59 +0000
+
ubuntu-ui-toolkit (0.1.46+13.10.20130826. 1-0ubuntu1) saucy; urgency=low [ Zsombor Egri ]
=== modified file 'examples/
ubuntu- ui-toolkit- gallery/ Buttons. qml'
--- a/examples/ubuntu- ui-toolkit- gallery/ Buttons. qml 2013-07-03 18:38:13 +0000
+++ b/examples/ubuntu- ui-toolkit- gallery/ Buttons. qml 2013-09-23 08:28:34 +0000
@@ -47,10 +47,14 @@
objectName: "button_iconsource"
iconSource: "call.png"
}
+ }
+
+ TemplateRow {
+ title: i18n.tr("Icon+Text" ) Button {
objectName: "button_ iconsource_ right_text"
- width: units.gu(15)
+ width: units.gu(10)
text: i18n.tr("Call")
iconSource: "call.png"
iconPosition : "right"
@@ -58,7 +62,7 @@Button {
objectName: "button_ iconsource_ left_text"
- width: units.gu(15)
+ width: units.gu(10)
text: i18n.tr("Call")
iconSource: "call.png"
}=== modified file 'examples/
ubuntu- ui-toolkit- gallery/ ListItems. qml'
--- a/examples/ubuntu- ui-toolkit- gallery/ ListItems. qml 2013-07-04 21:36:23 +0000
+++ b/examples/ubuntu- ui-toolkit- gallery/ ListItems. qml 2013-09-23 08:28:34 +0000
@@ -15,7 +15,7 @@
*/import QtQuick 2.0
-import Ubuntu.Components 0.1
+import Ubuntu.Components 0.1 as Toolkit
import Ubuntu.Components. ListItems 0.1 as ListItem Template {
@@ -77,14 +77,51 @@
}ListItemsS
ection {
- title: i18n.tr("Value selector")
- className: "ValueSelector"
- delegate: ListItem.ValueSelector {
- text: i18n.tr("Label")
- values: [i18n.tr("Value 1"),
- i18n.tr("Value 2"),
- i18n.tr("Value 3"),
- i18n.tr("Value 4")]
+ title: i18n.tr("Option selector")
+ className: "OptionSelector"
+
+ Column {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ spacing: units.gu(3)
+
+ ListItem.ItemSelector {
+ text: i18n.tr("Label")
+ model: [i18n.tr("Value 1"),
+ i18n.tr("Value 2"),
+ i18n.tr("Value 3"),
+ i18n.tr("Value 4")]
+ }
+
+ ListItem.ItemSelector {
+ text: i18n.tr("Label")
+ expanded: true
+ model: [i18n.tr("Value 1"),
+ i18n.tr("Value 2"),
+ i18n.tr("Value 3"),
+ i18n.tr("Value 4")]
+ }
+
+ ListItem.ItemSelector {
+ text: i18n.tr("Label")
+ model: customModel
+ expanded: true
+ colourImage: true
+ delegate: selectorDelegate
+ }
+
+ Component {
+ id: selectorDelegate
+ Toolkit.OptionSelectorD elegate { text: name; subText: description; icon: image }
+ }
+
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
+ }
}
}@@ -93,7 +130,7 @@
className: "Standard"
delegate: ListItem.Standard {
text: i18n.tr("Label")
- control: Switch {
+ control: Toolkit.Switch {
anchors. verticalCenter: parent. verticalCenter
}
}=== added file 'examples/
ubuntu- ui-toolkit- gallery/ OptionSelectors .qml'
--- a/examples/ubuntu- ui-toolkit- gallery/ OptionSelectors .qml 1970-01-01 00:00:00 +0000
+++ b/examples/ubuntu- ui-toolkit- gallery/ OptionSelectors .qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Template {
+ TemplateSection {
+ title: i18n.tr("Option Selector")
+ className: "Option Selector"
+
+ Column {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ spacing: units.gu(3)
+
+ OptionSelector {
+ text: i18n.tr("Label")
+ model: [i18n.tr("Value 1"),
+ i18n.tr("Value 2"),
+ i18n.tr("Value 3"),
+ i18n.tr("Value 4")]
+ }
+
+ OptionSelector {
+ text: i18n.tr("Label")
+ expanded: true
+ model: [i18n.tr("Value 1"),
+ i18n.tr("Value 2"),
+ i18n.tr("Value 3"),
+ i18n.tr("Value 4")]
+ }
+
+ OptionSelector {
+ text: i18n.tr("Label")
+ model: customModel
+ expanded: true
+ colourImage: true
+ delegate: selectorDelegate
+ }
+
+ Component {
+ id: selectorDelegate
+ OptionSelectorDelegate { text: name; subText: description; icon: image }
+ }
+
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
+ }
+ }
+ }
+}=== added file 'examples/
ubuntu- ui-toolkit- gallery/ Pickers. qml'
--- a/examples/ubuntu- ui-toolkit- gallery/ Pickers. qml 1970-01-01 00:00:00 +0000
+++ b/examples/ubuntu- ui-toolkit- gallery/ Pickers. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+import Ubuntu.Components. Pickers 0.1
+
+Template {
+ TemplateSection {
+ className: "Picker"
+ documentation: "qml-ubuntu-components- pickers0- picker. html"
+
+ TemplateRow {
+ title: i18n.tr("Linear")
+ Picker {
+ circular: false
+ model: ["Line1", "Line2", "Line3", "Line4", "Line5", "Line6", "Line7", "Line8", "Line9", "Line10"]
+
+ delegate: PickerDelegate {
+ Label {
+ text: modelData
+ anchors.verticalCenter: parent. verticalCenter
+ }
+ }
+
+ onSelectedIndexChanged: print("index=" + selectedIndex)
+ }
+ }
+
+ TemplateRow {
+ title: i18n.tr("Circular")
+ Picker {
+ delegate: PickerDelegate {
+ Label {
+ text: modelData
+ anchors.verticalCenter: parent. verticalCenter
+ }
+ }
+
+ onSelectedIndexChanged: print("index=" + selectedIndex)
+
+ Component.onCompleted: {
+ var stack = [];
+ for (var i = 0; i < 100; i++) {
+ stack.push("Line " + i);
+ }
+ model = stack;
+ selectedIndex = 3;
+ }
+ }
+ }
+
+ TemplateRow {
+ title: i18n.tr("Infinite")
+ Picker {
+ id: picker
+ model: ListModel {}
+ circular: false
+
+ delegate: PickerDelegate {
+ Label {
+ text: modelData
+ anchors.verticalCenter: parent. verticalCenter
+ }
+ Component.onCompleted: {
+ if (index === (picker.model.count - 1))
+ picker.expandModel( )
+ }
+ }
+
+ function expandModel() {
+ for (var i = 0; i < 50; i++) {
+ picker.model.append( {"blob" : "Line " + picker. model.count} );
+ }
+ }
+ Component.onCompleted: {
+ for (var i = 0; i < 100; i++)
+ model.append({"blob" : "Line " + i})
+ }
+ }
+ }
+ }
+}=== modified file 'examples/
ubuntu- ui-toolkit- gallery/ WidgetsModel. qml'
--- a/examples/ubuntu- ui-toolkit- gallery/ WidgetsModel. qml 2013-05-09 19:04:28 +0000
+++ b/examples/ubuntu- ui-toolkit- gallery/ WidgetsModel. qml 2013-09-23 08:28:34 +0000
@@ -40,8 +40,17 @@
source: "TextInputs.qml"
}+ ListElement {
+ label: "Option Selector"
+ source: "OptionSelectors.qml"
+ }
+
// Not in design guidelines yet
ListElement {
+ label: "Pickers"
+ source: "Pickers.qml"
+ }
+ ListElement {
label: "Progress and activity"
source: "ProgressBars.qml"
}=== added file 'examples/
ubuntu- ui-toolkit- gallery/ images. png'
Binary files a/examples/ubuntu- ui-toolkit- gallery/ images. png 1970-01-01 00:00:00 +0000 and b/examples/ ubuntu- ui-toolkit- gallery/ images. png 2013-09-23 08:28:34 +0000 differ
=== modified file 'examples/ubuntu- ui-toolkit- gallery/ ubuntu- ui-toolkit- gallery. desktop'
--- a/examples/ubuntu- ui-toolkit- gallery/ ubuntu- ui-toolkit- gallery. desktop 2013-05-08 01:55:45 +0000
+++ b/examples/ubuntu- ui-toolkit- gallery/ ubuntu- ui-toolkit- gallery. desktop 2013-09-23 08:28:34 +0000
@@ -4,3 +4,7 @@
Terminal=false
Type=Application
X-Ubuntu-Touch=true
+# Added Icon and Path as a workaround for http://pad.lv/ 1227359.
+# TODO remove them once that bug is fixed. --elopio - 2013-09-18
+Icon=Not important
+Path=Not important=== modified file 'modules/
Ubuntu/ Components/ ActionList. qml'
--- a/modules/Ubuntu/ Components/ ActionList. qml 2013-05-14 13:07:21 +0000
+++ b/modules/Ubuntu/ Components/ ActionList. qml 2013-09-23 08:28:34 +0000
@@ -28,37 +28,9 @@
// internal objects using nested elements,
// which isn't allowed by QtObject; this fix makes this possible
/*!
- Default property to allow adding of children. For example, the tools of a \l Page
- can be defined as follows:
- \qml
- import QtQuick 2.0
- import Ubuntu.Components 0.1
-
- MainView {
- width: units.gu(50)
- height: units.gu(80)
-
- Page {
- title: "test page"
-
- Label {
- anchors.centerIn: parent
- text: "Hello, world"
- }
-
- tools: ToolbarActions {
- Action {
- text: "action 1"
- }
- Action {
- text: "action 2"
- }
- }
- }
- }
- \endqml
- where \l ToolbarActions is derived from ActionList.
+ Default property to allow adding of children.
\qmlproperty list<Action> children
+ \default
*/
default property alias children: list.actions@@ -66,40 +38,8 @@
List of already defined actions when not defining them as children of the ActionList.
Note that when you set this property, the children of the ActionList will be ignored,
so do not set the list and define children.
- \qml
- import QtQuick 2.0
- import Ubuntu.Components 0.1
-
- MainView {
- width: units.gu(50)
- height: units.gu(80)
-
- Action {
- id: action1
- text: "action 1"
- onTriggered: print("one!")
- }
- Action {
- id: action2
- text: "action 2"
- onTriggered: print("two!")
- }
-
- Page {
- title: "test page"
-
- Label {
- anchors.centerIn: parent
- text: "Hello, world"
- }
-
- tools: ToolbarActions {
- actions: [action1, action2]
- }
- }
- }
- \endqml
- the advantage of setting actions over using the children is that the same
+
+ The advantage of setting actions over using the children is that the same
\l Action items can be used in several sets of actions.
*/
property list<Action> actions=== modified file 'modules/
Ubuntu/ Components/ CrossFadeImage. qml'
--- a/modules/Ubuntu/ Components/ CrossFadeImage. qml 2013-07-08 19:34:55 +0000
+++ b/modules/Ubuntu/ Components/ CrossFadeImage. qml 2013-09-23 08:28:34 +0000
@@ -82,7 +82,7 @@
/*!
The actual width and height of the loaded image
*/
- readonly property size sourceSize: internals.loadingImage. sourceSize
+ readonly property size sourceSize: Qt.size(internals. loadingImage. sourceSize. width, internals. loadingImage. sourceSize. height) /*!
\qmlproperty enumeration status=== modified file 'modules/
Ubuntu/ Components/ Icon.qml'
--- a/modules/Ubuntu/ Components/ Icon.qml 2013-07-01 05:54:33 +0000
+++ b/modules/Ubuntu/ Components/ Icon.qml 2013-09-23 08:28:34 +0000
@@ -82,7 +82,7 @@
Component. onCompleted: ready = true anchors. fill: parent
- source: ready && width > 0 && height > 0 && icon.name ? "image://gicon/ %1".arg( icon.name) : ""
+ source: ready && width > 0 && height > 0 && icon.name ? "image://theme/ %1".arg( icon.name) : ""
sourceSize {
width: width
height: height === modified file 'modules/
Ubuntu/ Components/ ListItems/ Empty.qml'
--- a/modules/Ubuntu/ Components/ ListItems/ Empty.qml 2013-07-04 21:36:23 +0000
+++ b/modules/Ubuntu/ Components/ ListItems/ Empty.qml 2013-09-23 08:28:34 +0000
@@ -120,34 +120,7 @@
Set to show or hide the thin bottom divider line (drawn by the \l ThinDivider component).
This line is shown by default except in cases where this item is the delegate of a ListView.
*/
- property bool showDivider: __showDivider()
-
- /*!
- \internal
- Method to automatically determine if the bottom divider line should be drawn.
- This always returns true, unless item is a delegate in a ListView. If in a ListView
- it will return false only when:
- + if there is a section.delegate below this item (as thin divider line and section
- delegate should not both appear)
- + if this is the final item in the list, and ListView.footer is set (again as thin
- divider line won't look well with footer below it)
- */
- // FIXME: The new design shows dividers everywhere, so if it does not change anymore,
- // the __showDivider() function may be removed.
- function __showDivider() {
- // if we're not in ListView, always show a thin dividing line at the bottom
- //if (ListView.view !== null) {
-
- // if we're last item in ListView, show divider if no footer is defined
- // and hide it if footer defined
- //if (index === ListView.view.model. count - 1) return !ListView.footer;
-
- // if section.delegate is positioned between this item and the next
- //else if (ListView.section !== ListView.nextSection) return true;
- //else return false;
- //}
- return true;
- }
+ property bool showDivider: true/*!
\internal
@@ -169,6 +142,13 @@
*/
property alias backgroundIndicator: backgroundIndic ator.children + /*!
+ \preliminary
+ \qmlproperty ThinDivider bottomDividerLine
+ Exposes our the bottom line divider.
+ */
+ property alias divider: bottomDividerLine
+
/*! \internal
The spacing inside the list item.
*/
@@ -272,21 +252,6 @@
}
}- Rectangle {
- id: highlight
-
- z: -1
- visible: !priv.removed && emptyListItem.swipingState === "" ? emptyListItem. selected || (emptyListItem. highlightWhenPr essed && emptyListItem. pressed) : false
- anchors {
- left: parent.left
- right: parent.right
- top: parent.top
- }
- height: emptyListItem.height - bottomDividerLi ne.height
- color: Theme.palette.selected. background
- }
-
-
ThinDivider {
id: bottomDividerLine
anchors. bottom: parent.bottom
@@ -302,7 +267,7 @@
left: parent.left
right: parent.right
top: parent.top
- bottom: bottomDividerLine.top
+ bottom: parent.bottom
}Item {
=== added file 'modules/
Ubuntu/ Components/ ListItems/ ItemSelector. qml'
--- a/modules/Ubuntu/ Components/ ListItems/ ItemSelector. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ ListItems/ ItemSelector. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,218 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import "." as ListItem
+import Ubuntu.Components 0.1
+
+/*!
+ \qmltype ItemSelector
+ \inqmlmodule Components.Components. ListItems 0.1
+ \ingroup ubuntu-listitems
+ \brief ListItem displaying a single selected value with and optional image and subtext when not expanded, where expanding
+ it opens a listing of all the possible values for selection with an additional option of always being expanded.
+
+ \b{This component is under heavy development.}
+
+ Examples:
+ \qml
+ import Components.Components. ListItems 0.1 as ListItem
+ Column {
+ width: 250
+ ListItem.ItemSelector {
+ text: "Standard"
+ model: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ }
+ ListItem.ItemSelector {
+ text: "Disabled"
+ model: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ enabled: false
+ }
+ ListItem.ItemSelector {
+ text: "Expanded"
+ model: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ expanded: true
+ }
+ ListItem.ItemSelector {
+ text: "Icon"
+ icon: Qt.resolvedUrl("icon.png" )
+ values: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ selectedIndex: 2
+ }
+ ListItem.ItemSelector {
+ text: i18n.tr("Label")
+ model: customModel
+ expanded: true
+ colourImage: true
+ delegate: OptionSelectorDelegate { text: name; subText: description; icon: image }
+ }
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
+ }
+ }
+ \endqml
+*/
+
+ListItem.Empty {
+ id: itemSelector
+ __height: column.height
+
+ /*!
+ \preliminary
+ The list of values that will be shown under the label text. This is a model.
+ */
+ property var model
+
+ /*!
+ \preliminary
+ Specifies whether the list is always expanded.
+ */
+ property bool expanded: false
+
+ /*!
+ \preliminary
+ Colours image according to the fieldText colour of the theme, otherwise source colour is maintained.
+ */
+ property bool colourImage: false
+
+ /*!
+ \preliminary
+ ListView delegate.
+ */
+ property Component delegate: OptionSelectorDelegate { id: selectorDelegate }
+
+ /*!
+ \preliminary
+ Custom height for list container which allows scrolling inside the selector.
+ */
+ property real containerHeight: list.contentHeight
+
+ /*!
+ \qmlproperty int selectedIndex
+ The index of the currently selected element in our list.
+ */
+ property alias selectedIndex: list.currentIndex
+
+ /*!
+ Called when delegate is clicked.
+ */
+ signal delegateClicked(int index)
+
+ showDivider: false
+
+ Column {
+ id: column
+
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+
+ ListItem.Standard {
+ text: itemSelector.text
+ visible: itemSelector.text !== "" ? true : false
+ }
+
+ ListItem.Standard {
+ id: listContainer
+ objectName: "listContainer"
+
+ readonly property url chevron: __styleInstance.chevron
+ readonly property url tick: __styleInstance.tick
+ readonly property color themeColour: Theme.palette.selected. fieldText
+ readonly property alias colourImage: itemSelector.colourImage
+ property bool isExpanded: expanded
+
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ state: itemSelector.expanded ? state = "expanded" : state = "collapsed"
+ style: Theme.createStyleComponent( "ListItemOption SelectorStyle. qml", listContainer)
+
+ states: [ State {
+ name: "expanded"
+ when: listContainer.isExpanded
+ PropertyChanges {
+ target: listContainer
+ height: list.contentHeight < containerHeight ? list.contentHeight : containerHeight
+ }
+ }, State {
+ name: "collapsed"
+ when: !listContainer.isExpanded
+ PropertyChanges {
+ target: listContainer
+ height: list.itemHeight
+ }
+ }
+ ]
+
+ transitions: [ Transition {
+ SequentialAnimation {
+ UbuntuNumberAnimation {
+ properties: "height"
+ duration: UbuntuAnimation.BriskDuration
+ }
+ ScriptAction {
+ script: {
+ //Nudge the list up if we're able to scroll.
+ if (listContainer.isExpanded && !list.atYBeginning && !list.atYBeginning && !list.atYEnd) {
+ list.contentY += list.itemHeight / 2
+ }
+ //On collapse if we've selected the same index nudge it back down again.
+ else if (!listContainer.isExpanded && list.previousIndex === list.currentIndex && !list.atYBeginning && !list.atYEnd) {
+ list.contentY -= list.itemHeight / 2
+ }
+ }
+ }
+ }
+ }
+ ]
+
+ ListView {
+ id: list
+ objectName: "listView"
+
+ property int previousIndex: list.currentIndex
+ readonly property alias expanded: itemSelector.expanded
+ readonly property alias container: listContainer
+ property real itemHeight
+ signal delegateClicked(int index)
+
+ onDelegateClicked: itemSelector.delegateClicked (index) ;
+ boundsBehavior: Flickable.StopAtBounds
+ interactive: listContainer.height !== list.contentHeight && listContainer. isExpanded ? true : false
+ clip: true
+ currentIndex: 0
+ model: itemSelector.model
+ anchors.fill: parent
+
+ delegate: itemSelector.delegate
+
+ Behavior on contentY {
+ UbuntuNumberAnimation {
+ properties: "contentY"
+ duration: UbuntuAnimation.BriskDuration
+ }
+ }
+ }
+ }
+ }
+}=== modified file 'modules/
Ubuntu/ Components/ ListItems/ LabelVisual. qml'
--- a/modules/Ubuntu/ Components/ ListItems/ LabelVisual. qml 2013-07-04 21:36:23 +0000
+++ b/modules/Ubuntu/ Components/ ListItems/ LabelVisual. qml 2013-09-23 08:28:34 +0000
@@ -23,8 +23,16 @@
property bool selected: false
property bool secondary: false+ // FIXME: very ugly hack to detect whether the list item is inside a Popover
+ property bool overlay: isInsideOverlay(label)
+ function isInsideOverlay(item) {
+ if (!item.parent) return false;
+ return item.parent.hasOwnProperty( "pointerTarget" ) || label.isInsideO verlay( item.parent)
+ }
+
fontSize: "medium"
elide: Text.ElideRight
- color: selected ? UbuntuColors.orange : secondary ? Theme.palette.normal. backgroundText : Theme.palette. selected. backgroundText
+ color: selected ? UbuntuColors.orange : secondary ? overlay ? Theme.palette.normal. overlayText : Theme.palette. normal. backgroundText
+ : overlay ? Theme.palette.selected. overlayText : Theme.palette. selected. backgroundText
opacity: label.enabled ? 1.0 : 0.5
}=== modified file 'modules/
Ubuntu/ Components/ ListItems/ MultiValue. qml'
--- a/modules/Ubuntu/ Components/ ListItems/ MultiValue. qml 2013-07-01 06:33:24 +0000
+++ b/modules/Ubuntu/ Components/ ListItems/ MultiValue. qml 2013-09-23 08:28:34 +0000
@@ -47,12 +47,6 @@/*!
\preliminary
- The text that is shown in the list item as a label.
- \qmlproperty string text
- */
-
- /*!
- \preliminary
The list of values that will be shown under the label text
*/
property variant values=== modified file 'modules/
Ubuntu/ Components/ ListItems/ ValueSelector. qml'
--- a/modules/Ubuntu/ Components/ ListItems/ ValueSelector. qml 2013-07-04 21:36:23 +0000
+++ b/modules/Ubuntu/ Components/ ListItems/ ValueSelector. qml 2013-09-23 08:28:34 +0000
@@ -18,6 +18,8 @@
import Ubuntu.Components 0.1/*!
+ ****DEPRECATED! PLEASE USE ITEM SELECTOR OR FOR THE UBUNTU SHAPE VERSION THE OPTION SELECTOR.****
+
\qmltype ValueSelector
\inqmlmodule Ubuntu.Components. ListItems 0.1
\ingroup ubuntu-listitems=== modified file 'modules/
Ubuntu/ Components/ ListItems/ qmldir'
--- a/modules/Ubuntu/ Components/ ListItems/ qmldir 2012-09-27 18:03:25 +0000
+++ b/modules/Ubuntu/ Components/ ListItems/ qmldir 2013-09-23 08:28:34 +0000
@@ -7,6 +7,7 @@
ItemSeparator 0.1 ItemSeparator.qml
internal LabelVisual LabelVisual.qml
MultiValue 0.1 MultiValue.qml
+ItemSelector 0.1 ItemSelector.qml
internal ProgressionVisual ProgressionVisual.qml
ValueSelector 0.1 ValueSelector.qml
SingleValue 0.1 SingleValue.qml=== modified file 'modules/
Ubuntu/ Components/ MainView. qml'
--- a/modules/Ubuntu/ Components/ MainView. qml 2013-09-16 15:52:16 +0000
+++ b/modules/Ubuntu/ Components/ MainView. qml 2013-09-23 08:28:34 +0000
@@ -124,7 +124,7 @@
hidden when the user swipes it out, or when the active \l Page inside the MainView is changed.
The examples above show how to include a single \l Page inside a MainView, but more advanced application
structures are possible using \l PageStack and \l Tabs.
- See \l ToolbarActions for details on how to to control the behavior and contents of the toolbar.
+ See \l ToolbarItems for details on how to to control the behavior and contents of the toolbar.
*/
PageTreeNode {
id: mainView
@@ -334,20 +334,6 @@
property var actionManager: unityActionManager
}- /*!
- \deprecated
- This property is DEPRECATED. Pages will now automatically update the toolbar when activated.
- See \l ToolbarItems for more information on how to set the tools of a \l Page.
- */
- property ToolbarActions tools: null
- /*!
- \internal
- \deprecated
- */
- onToolsChanged: print("MainView. tools property was DEPRECATED. "+
- "Pages will automatically update the toolbar when activated. "+
- "See CHANGES file, and use toolbar.tools instead when needed.");
-
/*! \internal */
onApplicationNameChanged: {
if (applicationName !== "") {=== added file 'modules/
Ubuntu/ Components/ OptionSelector. qml'
--- a/modules/Ubuntu/ Components/ OptionSelector. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ OptionSelector. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import "ListItems" as ListItem
+import Ubuntu.Components 0.1 as Toolkit
+
+/*!
+ \qmltype OptionSelector
+ \inqmlmodule Components.Components 0.1
+ \ingroup ubuntu-components
+ \brief Component displaying a single selected value with and optional image and subtext when not expanded, where expanding
+ it opens a listing of all the possible values for selection with an additional option of always being expanded.
+
+ \b{This component is under heavy development.}
+
+ Examples:
+ \qml
+ import Components.Components 0.1
+ Column {
+ width: 250
+ OptionSelector {
+ text: "Standard"
+ model: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ }
+ OptionSelector {
+ text: "Disabled"
+ model: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ enabled: false
+ }
+ OptionSelector {
+ text: "Expanded"
+ model: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ expanded: true
+ }
+ OptionSelector {
+ text: "Icon"
+ icon: Qt.resolvedUrl("icon.png" )
+ values: ["Value 1", "Value 2", "Value 3", "Value 4"]
+ selectedIndex: 2
+ }
+ OptionSelector {
+ text: i18n.tr("Label")
+ model: customModel
+ expanded: true
+ colourImage: true
+ delegate: OptionSelectorDelegate { text: name; subText: description; icon: image }
+ }
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
+ }
+ }
+ \endqml
+*/
+
+ListItem.Empty {
+ id: optionSelector
+ __height: column.height
+
+ /*!
+ \preliminary
+ The list of values that will be shown under the label text. This is a model.
+ */
+ property var model
+
+ /*!
+ \preliminary
+ Specifies whether the list is always expanded.
+ */
+ property bool expanded: false
+
+ /*!
+ \preliminary
+ Colours image according to the fieldText colour of the theme, otherwise source colour is maintained.
+ */
+ property bool colourImage: false
+
+ /*!
+ \preliminary
+ ListView delegate.
+ */
+ property Component delegate: Toolkit.OptionSelectorD elegate {}
+
+ /*!
+ \preliminary
+ Custom height for list container which allows scrolling inside the selector.
+ */
+ property real containerHeight: list.contentHeight
+
+ /*!
+ \qmlproperty int selectedIndex
+ The index of the currently selected element in our list.
+ */
+ property alias selectedIndex: list.currentIndex
+
+ /*!
+ Called when delegate is clicked.
+ */
+ signal delegateClicked(int index)
+
+ showDivider: false
+
+ Column {
+ id: column
+
+ spacing: units.gu(2)
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+
+ Label {
+ text: optionSelector.text
+ visible: optionSelector.text !== "" ? true : false
+ }
+
+ StyledItem {
+ id: listContainer
+ objectName: "listContainer"
+
+ readonly property url chevron: __styleInstance.chevron
+ readonly property url tick: __styleInstance.tick
+ readonly property color themeColour: Theme.palette.selected. fieldText
+ readonly property alias colourImage: optionSelector.colourImage
+ property bool isExpanded: expanded
+
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ state: optionSelector.expanded ? state = "expanded" : state = "collapsed"
+ style: Theme.createStyleComponent( "OptionSelector Style.qml" , listContainer)
+ states: [ State {
+ name: "expanded"
+ when: listContainer.isExpanded
+ PropertyChanges {
+ target: listContainer
+ height: list.contentHeight < containerHeight ? list.contentHeight : containerHeight
+ }
+ }, State {
+ name: "collapsed"
+ when: !listContainer.isExpanded
+ PropertyChanges {
+ target: listContainer
+ height: list.itemHeight
+ }
+ }
+ ]
+
+ transitions: [ Transition {
+ SequentialAnimation {
+ Toolkit.UbuntuNumberAni mation {
+ properties: "height"
+ duration: Toolkit.UbuntuAnimation .BriskDuration
+ }
+ ScriptAction {
+ script: {
+ //Nudge the list up if we're able to scroll.
+ if (listContainer.isExpanded && !list.atYBeginning && !list.atYBeginning && !list.atYEnd) {
+ list.contentY += list.itemHeight / 2
+ }
+ //On collapse if we've selected the same index nudge it back down again.
+ else if (!listContainer.isExpanded && list.previousIndex === list.currentIndex && !list.atYBeginning && !list.atYEnd) {
+ list.contentY -= list.itemHeight / 2
+ }
+ }
+ }
+ }
+ }
+ ]
+
+ ListView {
+ id: list
+
+ property int previousIndex: -1
+ readonly property alias expanded: optionSelector.expanded
+ readonly property alias container: listContainer
+ property real itemHeight
+ signal delegateClicked(int index)
+
+ onDelegateClicked: optionSelector.delegateClicked (index) ;
+ boundsBehavior: Flickable.StopAtBounds
+ interactive: listContainer.height !== list.contentHeight && listContainer. isExpanded ? true : false
+ clip: true
+ currentIndex: 0
+ model: optionSelector.model
+ anchors.fill: parent
+
+ delegate: optionSelector.delegate
+
+ Behavior on contentY {
+ Toolkit.UbuntuNumberAni mation {
+ properties: "contentY"
+ duration: Toolkit.UbuntuAnimation .BriskDuration
+ }
+ }
+ }
+ }
+ }
+}=== added file 'modules/
Ubuntu/ Components/ OptionSelectorD elegate. qml'
--- a/modules/Ubuntu/ Components/ OptionSelectorD elegate. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ OptionSelectorD elegate. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,369 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+/*!
+ \qmltype OptionSelectorDelegate
+ \inqmlmodule Toolkit.Toolkit 0.1
+ \ingroup ubuntu-Toolkit
+ \brief OptionSelector delegate which can display text, subtext and an image from a custom model.
+
+ \b{This component is under heavy development.}
+
+ Examples:
+ \qml
+ import Ubuntu.Components 0.1
+ Column {
+ width: 250
+ OptionSelector {
+ text: i18n.tr("Label")
+ model: customModel
+ delegate: OptionSelectorDelegate { text: name; subText: description; icon: image }
+ }
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
+ }
+ }
+ \endqml
+*/
+
+import QtQuick 2.0
+import "ListItems" as ListItem
+import Ubuntu.Components 0.1 as Toolkit
+
+ListItem.Standard {
+ id: option
+
+ /*!
+ \preliminary
+ Main text.
+ */
+ property string text
+
+ /*!
+ \preliminary
+ Subtext which appears below the main text.
+ */
+ property string subText
+
+ /*!
+ \preliminary
+ Left icon url.
+ */
+ property url icon
+
+ /*!
+ \preliminary
+ Constrains the size of the image to nothing greater than that of the delegate. Changes fillMode to Image.PreserveAspectFit.
+ */
+ property bool constrainImage: false
+
+ /*!
+ \preliminary
+ Whether or not left image is coloured by our theme.
+ */
+ property bool colourImage: listView.container. colourImage
+
+ /*!
+ \preliminary
+ Colour of left image.
+ */
+ property color assetColour: listView.container. themeColour
+
+ /*!
+ \preliminary
+ OptionSelector's ListView.
+ */
+ readonly property ListView listView: ListView.view
+
+ /*!
+ \preliminary
+ Colourising fragment shader.
+ */
+ readonly property string fragColourShader:
+ "varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform lowp vec4 colour;
+ uniform lowp float qt_Opacity;
+
+ void main() {
+ lowp vec4 sourceColour = texture2D(source, qt_TexCoord0);
+ gl_FragColor = colour * sourceColour.a * qt_Opacity;
+ }"
+
+ width: parent.width + units.gu(2)
+ showDivider: index !== listView.count - 1 ? 1 : 0
+ highlightWhenPressed: false
+ selected: ListView.isCurrentItem
+ anchors {
+ left: parent.left
+ leftMargin: units.gu(-1)
+ }
+ onClicked: {
+ if (listView.container. isExpanded) {
+ listView.delegateClicked (index) ;
+
+ listView.previousIndex = listView. currentIndex;
+ listView.currentIndex = index;
+ }
+
+ if (!listView.expanded) {
+ listView.container. isExpanded = !listView. container. isExpanded;
+ }
+ }
+
+ Component.onCompleted: {
+ height = listView.itemHeight = childrenRect.height;
+ }
+
+ //Since we don't want to add states to our divider, we use the exposed alias provided in Empty to access it and alter it's opacity from here.
+ states: [ State {
+ name: "dividerExpanded"
+ when: listView.container. state === "expanded" && index === listView. currentIndex
+ PropertyChanges {
+ target: option.divider
+ opacity: 1
+ }
+ }, State {
+ name: "dividerCollapsed"
+ when: listView.container. state === "collapsed" && index === listView. currentIndex
+ PropertyChanges {
+ target: option.divider
+ opacity: 0
+ }
+ }
+ ]
+
+ //As with our states, we apply the transition with our divider as the target.
+ transitions: [ Transition {
+ from: "dividerExpanded"
+ to: "dividerCollapsed"
+ Toolkit.UbuntuNumberAni mation {
+ target: option.divider
+ properties: "opacity"
+ duration: Toolkit.UbuntuAnimation .SlowDuration
+ }
+ }
+ ]
+
+ resources: [
+ Connections {
+ target: listView.container
+ onIsExpandedChanged: {
+ optionExpansion.stop() ;
+ imageExpansion.stop();
+ optionCollapse.stop();
+ selectedImageCollapse. stop();
+ deselectedImageCollapse. stop();
+
+ if (listView.container. isExpanded === true) {
+ if (!option.selected) {
+ optionExpansion.start( );
+
+ //Ensure a source change. This solves a bug which happens occasionaly when source is switched correctly. Probably related to the image.source binding.
+ image.source = listView.container. tick
+ } else {
+ imageExpansion.start() ;
+ }
+ } else {
+ if (!option.selected) {
+ optionCollapse.start() ;
+ } else {
+ if (listView.previousIndex !== listView. currentIndex)
+ selectedImageCollapse. start() ;
+ else {
+ deselectedImageCollapse. start() ;
+ }
+ }
+ }
+ }
+ }, SequentialAnimation {
+ id: imageExpansion
+
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 1.0
+ to: 0.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ PauseAnimation { duration: Toolkit.UbuntuAnimation .BriskDuration - Toolkit. UbuntuAnimation .FastDuration }
+ PropertyAction {
+ target: image
+ property: "source"
+ value: listView.container. tick
+ }
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 0.0
+ to: 1.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ }, PropertyAnimation {
+ id: optionExpansion
+
+ target: option
+ properties: "opacity"
+ from : 0.0
+ to: 1.0
+ duration: Toolkit.UbuntuAnimation .SlowDuration
+ }, SequentialAnimation {
+ id: deselectedImageCollapse
+
+ PauseAnimation { duration: Toolkit.UbuntuAnimation .BriskDuration }
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 1.0
+ to: 0.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ PauseAnimation { duration: Toolkit.UbuntuAnimation .FastDuration }
+ PropertyAction {
+ target: image
+ property: "source"
+ value: listView.container. chevron
+ }
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 0.0
+ to: 1.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ }, SequentialAnimation {
+ id: selectedImageCollapse
+
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 0.0
+ to: 1.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ PauseAnimation { duration: Toolkit.UbuntuAnimation .BriskDuration - Toolkit. UbuntuAnimation .FastDuration }
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 1.0
+ to: 0.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ PauseAnimation { duration: Toolkit.UbuntuAnimation .FastDuration }
+ PropertyAction {
+ target: image
+ property: "source"
+ value: listView.container. chevron
+ }
+ PropertyAnimation {
+ target: image
+ properties: "opacity"
+ from : 0.0
+ to: 1.0
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ }, PropertyAnimation {
+ id: optionCollapse
+ target: option
+ properties: "opacity"
+ from : 1.0
+ to: 0.0
+ duration: Toolkit.UbuntuAnimation .SlowDuration
+ }
+ ]
+
+ Row {
+ spacing: units.gu(1)
+
+ anchors {
+ left: parent.left
+ leftMargin: units.gu(3)
+ verticalCenter: parent.verticalCenter
+ }
+
+ Image {
+ id: leftIcon
+ objectName: "icon"
+
+ height: constrainImage ? option.height : sourceSize.height
+ source: icon
+ fillMode: constrainImage ? Image.PreserveAspectFit : Image.Stretch
+
+ ShaderEffect {
+ property color colour: assetColour
+ property Image source: parent
+
+ width: source.width
+ height: source.height
+ visible: colourImage
+
+ fragmentShader: fragColourShader
+ }
+ }
+
+ Column {
+ anchors {
+ verticalCenter: parent.verticalCenter
+ }
+ Label {
+ text: option.text === "" ? modelData : option.text
+ }
+ Label {
+ text: option.subText
+ visible: option.subText !== "" ? true : false
+ fontSize: "small"
+ }
+ }
+ }
+
+ Image {
+ id: image
+
+ width: units.gu(2)
+ height: units.gu(2)
+ source: listView.expanded ? listView.container. tick : listView. container. chevron
+ opacity: option.selected ? 1.0 : 0.0
+ anchors {
+ right: parent.right
+ rightMargin: units.gu(3)
+ verticalCenter: parent.verticalCenter
+ }
+
+ //Our behaviour is only enabled for our expanded list due to flickering bugs in relation to all this other animations running on the expanding version.
+ Behavior on opacity {
+ enabled: listView.expanded
+
+ Toolkit.UbuntuNumberAni mation {
+ properties: "opacity"
+ duration: Toolkit.UbuntuAnimation .FastDuration
+ }
+ }
+
+ ShaderEffect {
+ property color colour: assetColour
+ property Image source: parent
+
+ width: source.width
+ height: source.height
+
+ fragmentShader: fragColourShader
+ }
+ }
+}=== modified file 'modules/
Ubuntu/ Components/ Page.qml'
--- a/modules/Ubuntu/ Components/ Page.qml 2013-07-22 10:39:03 +0000
+++ b/modules/Ubuntu/ Components/ Page.qml 2013-09-23 08:28:34 +0000
@@ -174,8 +174,6 @@
internal. header. flickable = page.flickable;
}
if (tools) {
- // TODO: remove __pageStack when ToolbarActions becomes deprecated
- if (tools.hasOwnProperty( "__pageStack" )) tools.__pageStack = page.pageStack;
if (tools. hasOwnProperty( "pageStack" )) tools.pageStack = page.pageStack;
}
if (internal.toolbar) {=== modified file 'modules/
Ubuntu/ Components/ PageStack. qml'
--- a/modules/Ubuntu/ Components/ PageStack. qml 2013-07-01 05:54:33 +0000
+++ b/modules/Ubuntu/ Components/ PageStack. qml 2013-09-23 08:28:34 +0000
@@ -105,19 +105,6 @@
}/*!
- \deprecated
- This property is deprecated. Pages will now automatically update the toolbar when activated.
- */
- property ToolbarActions tools: null
- /*!
- \deprecated
- \internal
- */
- onToolsChanged: print("MainView. tools property was deprecated. "+
- "Pages will automatically update the toolbar when activated. "+
- "See CHANGES file, and use toolbar.tools instead when needed.");
-
- /*!
\preliminary
The current size of the stack
*/=== modified file 'modules/
Ubuntu/ Components/ Panel.qml'
--- a/modules/Ubuntu/ Components/ Panel.qml 2013-08-21 17:06:42 +0000
+++ b/modules/Ubuntu/ Components/ Panel.qml 2013-09-23 08:28:34 +0000
@@ -178,8 +178,36 @@
property bool opened: false
/*! \internal */
onOpenedChanged: {
- if (opened) state = "spread";
- else state = "";
+ if (internal.openedChangedWa rning) {
+ console.log("DEPRECATED use of Panel.opened property. This property will be made read-only,
+ please use the opened property of the Page tools or use Panel.open() and Panel.close().");
+ }
+
+ if (opened) {
+ panel.open();
+ } else {
+ panel.close();
+ }
+
+ internal.openedChangedWa rning = true;
+ }
+
+ /*!
+ Open the panel
+ */
+ function open() {
+ internal.openedChangedWa rning = false;
+ panel.state = "spread";
+ opened = true;
+ }
+
+ /*!
+ Close the panel
+ */
+ function close() {
+ internal.openedChangedWa rning = false;
+ panel.state = "";
+ opened = false;
}/*!
@@ -288,6 +316,9 @@
QtObject {
id: internal+ // FIXME: Remove when opened property is made readonly
+ property bool openedChangedWarning: true
+
/*!
The duration in milliseconds of sliding in or out transitions when opening, closing, and showing the hint.
Default value: 250
@@ -299,7 +330,7 @@// Used for recovering the state from before
// bottomBarVisibilityCommunicato r forced the toolbar to hide.
- property bool savedlocked: panel.locked
+ property bool savedLocked: panel.locked
property bool savedOpened: panel.opened// Convert from Qt.AlignLeading to Qt.AlignTrailing to Qt.AlignLeft and Qt.AlignRight
@@ -332,11 +363,18 @@
if (bottomBarVisibilityCommunicat or.forceHidden) {
internal. savedLocked = panel.locked;
internal. savedOpened = panel.opened;
- panel.opened = false;
+ panel.close();
panel. locked = true;
} else { // don't force hidden
- panel.locked = internal.savedlocked;
- if (internal.savedlocked) panel.opened = internal. savedOpened;
+ panel.locked = internal.savedLocked;
+
+ if (internal.savedLocked) {
+ if (internal.savedOpened) {
+ panel.open();
+ } else {
+ panel.close();
+ }
+ }
// if the panel was locked, do not slide it back in
// until the user performs an edge swipe.
}
@@ -350,9 +388,9 @@
} else if (state == "moving" && internal.previousState == "spread") {
internal. movingDelta = draggingArea. initialPosition ;
} else if (state == "spread") {
- panel.opened = true;
+ panel.open();
} else if (state == "") {
- panel.opened = false;
+ panel.close();
}
internal. previousState = state;
}
@@ -363,7 +401,7 @@
mouse. accepted = false;
// the mouse click may cause an update
// of locked by the clicked Item behind
- if (!panel.locked) panel.opened = false;
+ if (!panel.locked) panel.close();
}
propagateComp osedEvents: true
visible: panel.locked == false && panel.state == "spread"
@@ -400,19 +438,6 @@
// set in onPressed, reset when entering "moving" state
property Item pressedItem: null- // find the first child with a clicked property:
- // TODO Remove this function when ToolbarActions is removed.
- function getClickableItem(mouse) {
- var item = bar; // contains the children
- while (item && !item.hasOwnProperty(" clicked" )) {
- var coords = mapToItem(item, mouse.x, mouse.y);
- // FIXME: When using a ListView the highlight may be
- // returned instead of the Item that you are looking for
- item = item.childAt(coords. x, coords.y);
- }
- return item; // will be null if no item has clicked() signal.
- }
-
// find the first child with a triggered property:
function getTriggerableItem(mouse) {
var item = bar; // contains the children
@@ -425,17 +450,11 @@
return item; // will be null if no item has trigger() function.
}- // forward clicked() and trigger() events to any child Item with a
- // clicked() or trigger() function, not
- // just MouseAreas since MouseAreas would block swiping of the panel.
+ // forward trigger() events to any child Item with trigger() function.
// This must also happen when the panel is locked, so the DraggingArea is
// never disabled, and other signal handlers will return when panel.locked is true.
- // TODO: Remove clicked() call when ToolbarActions is removed.
onClicked: {
- if (pressedItem && pressedItem === getClickableItem(mouse) ) {
- // Click event positioned at the Item where the user first pressed
- pressedItem.clicked( );
- } else if (pressedItem && pressedItem === getTriggerableItem(mouse) ) {
+ if (pressedItem && pressedItem === getTriggerableItem(mouse) ) {
// Click event positioned at the Item where the user first pressed
pressedItem. trigger( );
}
@@ -443,8 +462,7 @@property int initialPosition
onPressed: {
- pressedItem = getClickableItem(mouse) ;
- if (null === pressedItem) pressedItem = getTriggerableItem(mouse) ;
+ pressedItem = getTriggerableItem(mouse) ;
if (panel.locked) return;
initialPo sition = getMousePosition();
if (panel.state == "") panel.state = "hint";=== added directory 'modules/
Ubuntu/ Components/ Pickers'
=== added file 'modules/Ubuntu/ Components/ Pickers/ Picker. qml'
--- a/modules/Ubuntu/ Components/ Pickers/ Picker. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Pickers/ Picker. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import "../" 0.1
+
+/*!
+ \qmltype Picker
+ \inqmlmodule Ubuntu.Components. Pickers 0.1
+ \ingroup ubuntu-pickers
+ \brief Picker is a slot-machine style value selection component.
+
+ The Picker lists the elements specified by the \l model using the \l delegate
+ vertically using a slot-machine tumbler-like list. The selected item is
+ always the one in the center of the component, and it is represented by the
+ \l selectedIndex property.
+
+ The elements can be either in a circular list or in a normal list.
+
+ Delegates must be composed using PickerDelegate.
+
+ Example:
+ \qml
+ import QtQuick 2.0
+ import Ubuntu.Components 0.1
+ import Ubuntu.Components. Pickers 0.1
+
+ Picker {
+ model: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"]
+ delegate: PickerDelegate {
+ Label {
+ text: modelData
+ }
+ }
+ selectedIndex: 5
+ onSelectedIndexChanged: {
+ print("selected month: " + selectedIndex);
+ }
+ }
+ \endqml
+
+ \b Note: the \l selectedIndex must be set explicitly to the desired index if
+ the model is set, filled or changed after the component is complete. In the
+ following example the selected item must be set after the model is set.
+
+ \qml
+ Picker {
+ selectedIndex: 5 // this will be set to 0 at the model completion
+ delegate: PickerDelegate {
+ Label {
+ text: modelData
+ }
+ }
+ Component.onCompleted: {
+ var stack = [];
+ for (var i = 0; i < 10; i++) {
+ stack.push("Line " + i);
+ }
+ model = stack;
+ // selectedIndex must be set explicitly
+ selectedIndex = 3;
+ }
+ }
+ \endqml
+ */
+
+StyledItem {
+ id: picker
+
+ /*!
+ Property specifying whether the tumbler list is wrap-around (\a true), or
+ normal (\a false). Default value is true.
+ */
+ property bool circular: true
+
+ /*!
+ Specifies the model listing the content of the picker.
+ */
+ property var model
+
+ /*!
+ The delegate visualizing the model elements.
+ */
+ property Component delegate
+
+ /*!
+ The property holds the index of the selected item
+ */
+ property int selectedIndex
+
+ /*!
+ Defines whether the \l selectedIndex should be updated while the tumbler
+ changes the selected item during draggingm or only when the tumbler's motion
+ ends. The default behavior is non-live update.
+ */
+ property bool live: false
+
+ implicitWidth: units.gu(8)
+ implicitHeight: units.gu(20)
+
+ style: Theme.createStyleComponent( "PickerStyle. qml", picker)
+
+ /*! \internal */
+ property int __clickedIndex: -1
+}=== added file 'modules/
Ubuntu/ Components/ Pickers/ PickerDelegate. qml'
--- a/modules/Ubuntu/ Components/ Pickers/ PickerDelegate. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Pickers/ PickerDelegate. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import "../" 0.1
+
+/*!
+ \qmltype PickerDelegate
+ \inqmlmodule Ubuntu.Components. Pickers 0.1
+ \ingroup ubuntu-pickers
+ \brief PickerDelegate component serves as base for Picker delegates.
+
+ PickerDelegate is a holder component for delegates used in a Picker element.
+ Each picker delegate must be derived from this type.
+ */
+
+AbstractButton {
+ id: pickerDelegate
+
+ implicitHeight: units.gu(4)
+ implicitWidth: parent.width
+
+ /*! \internal */
+ onClicked: {
+ if (internal.tumblerItem. currentIndex === index) return;
+ internal.tumbler. __clickedIndex = index;
+ internal.tumblerItem. currentIndex = index;
+ }
+
+ style: Theme.createStyleComponent( "PickerDelegate Style.qml" , pickerDelegate)
+
+ QtObject {
+ id: internal
+ property bool inListView: QuickUtils.className( pickerDelegate. parent) !== "QQuickPathView"
+ property Item tumblerItem: !inListView ? pickerDelegate.parent : pickerDelegate. parent. parent
+ property Item tumbler: tumblerItem ? tumblerItem.tumbler : null
+ }
+}=== added file 'modules/
Ubuntu/ Components/ Pickers/ qmldir'
--- a/modules/Ubuntu/ Components/ Pickers/ qmldir 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Pickers/ qmldir 2013-09-23 08:28:34 +0000
@@ -0,0 +1,3 @@
+module Ubuntu.Components. Pickers
+Picker 0.1 Picker.qml
+PickerDelegate 0.1 PickerDelegate.qml=== added file 'modules/
Ubuntu/ Components/ Pickers/ ubuntu- components- pickers. qdoc'
--- a/modules/Ubuntu/ Components/ Pickers/ ubuntu- components- pickers. qdoc 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Pickers/ ubuntu- components- pickers. qdoc 2013-09-23 08:28:34 +0000
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+/*!
+ \qmlmodule Ubuntu.Components. Pickers 0.1
+ \title Pickers
+*/=== modified file 'modules/
Ubuntu/ Components/ Tabs.qml'
--- a/modules/Ubuntu/ Components/ Tabs.qml 2013-08-14 21:28:43 +0000
+++ b/modules/Ubuntu/ Components/ Tabs.qml 2013-09-23 08:28:34 +0000
@@ -50,8 +50,8 @@
anchors. centerIn: parent
text: "A centered label"
}
- tools: ToolbarActions {
- Action {
+ tools: ToolbarItems {
+ ToolbarButton {
text: "action"
onTriggere d: print("action triggered")
}
@@ -179,19 +179,6 @@
}/*!
- \deprecated
- This property is deprecated. Pages will now automatically update the toolbar when activated.
- */
- property ToolbarActions tools: null
- /*!
- \deprecated
- \internal
- */
- onToolsChanged: print("Tabs.tools property was deprecated. "+
- "Pages will automatically update the toolbar when activated. "+
- "See CHANGES file, and use toolbar.tools instead when needed.");
-
- /*!
\internal
Used by the style to create the tabs header.
*/=== added file 'modules/
Ubuntu/ Components/ Themes/ Ambiance/ ListItemOptionS electorStyle. qml'
--- a/modules/Ubuntu/ Components/ Themes/ Ambiance/ ListItemOptionS electorStyle. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ Ambiance/ ListItemOptionS electorStyle. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Item {
+ id: ambianceStyle
+
+ property url chevron: "../../artwork/ chevron_ down@30. png"
+ property url tick: "../../artwork/ tick@30. png"
+ property bool colourComponent: true
+}=== added file 'modules/
Ubuntu/ Components/ Themes/ Ambiance/ OptionSelectorS tyle.qml'
--- a/modules/Ubuntu/ Components/ Themes/ Ambiance/ OptionSelectorS tyle.qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ Ambiance/ OptionSelectorS tyle.qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Item {
+ id: ambianceStyle
+
+ property url chevron: "../../artwork/ chevron_ down@30. png"
+ property url tick: "../../artwork/ tick@30. png"
+ property bool colourComponent: true
+
+ UbuntuShape {
+ id: background
+
+ width: styledItem.width
+ height: styledItem.height
+ radius: "medium"
+ }
+}=== added file 'modules/
Ubuntu/ Components/ Themes/ Ambiance/ PickerDelegateS tyle.qml'
--- a/modules/Ubuntu/ Components/ Themes/ Ambiance/ PickerDelegateS tyle.qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ Ambiance/ PickerDelegateS tyle.qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Item {
+ property real minFade: 0.25
+ property real maxFade: 0.95
+
+ property bool inListView: QuickUtils.className( styledItem. parent) !== "QQuickPathView"
+ property Item tumblerItem: !inListView ? styledItem.parent : styledItem.parent. parent
+ property Item tumbler: tumblerItem ? tumblerItem.tumbler : null
+ property Item highlightItem: tumblerItem.highlightItem
+
+ Binding {
+ target: styledItem
+ property: "opacity"
+ value: opacityCalc()
+ }
+
+ function opacityCalc() {
+ if (!tumbler || !highlightItem || (index === tumblerItem.currentIndex) ) return 1.0;
+ var highlightY = highlightItem.y;
+ var delegateY = styledItem.y;
+ if (inListView) {
+ highlightY -= tumblerItem.contentY;
+ delegateY -= tumblerItem.contentY;
+ }
+ var midY = (delegateY + styledItem.height) / 2
+ if (delegateY < highlightY) {
+ return MathUtils.clamp(MathUtils .projectValue( midY, 0, highlightY, minFade, maxFade), minFade, maxFade);
+ }
+ var highlightH = highlightY + highlightItem.height;
+ if (delegateY >= highlightH) {
+ delegateY -= highlightH;
+ midY = (delegateY + styledItem.height) / 2;
+ return MathUtils.clamp(1.0 - MathUtils.projectValue( midY, 0, highlightY, minFade, maxFade), minFade, maxFade);
+ }
+ return 1.0;
+ }
+}=== added file 'modules/
Ubuntu/ Components/ Themes/ Ambiance/ PickerStyle. qml'
--- a/modules/Ubuntu/ Components/ Themes/ Ambiance/ PickerStyle. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ Ambiance/ PickerStyle. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Rectangle {
+ id: control
+ // style properties
+ property color frameColor: UbuntuColors.warmGrey
+ property real frameWidth: 1
+ property color backgroundColor: "#00000000"
+ property bool overlay: true
+ property color overlayColor: UbuntuColors.warmGrey
+
+ // private properties
+ property bool completed: false
+
+ border {
+ width: frameWidth
+ color: frameColor
+ }
+ color: backgroundColor
+ anchors.fill: parent
+
+ function modelSize() {
+ return loader.item.model. hasOwnProperty( "count" ) ? loader. item.model. count : loader. item.model. length;
+ }
+
+ function moveToIndex(toIndex) {
+ var count = (loader.item && loader.item.model) ? modelSize() : -1;
+ if (completed && count > 0) {
+ if (QuickUtils.className( loader. item) === "QQuickListView") {
+ loader.item.currentInd ex = toIndex;
+ return;
+ } else {
+ loader.item.positionVi ewAtIndex( count - 1, PathView.Center);
+ loader.item.positionVi ewAtIndex( toIndex, PathView.Center);
+ }
+ }
+ }
+
+ Component {
+ id: highlightComponent
+ Item {
+ width: parent ? parent.width : 0
+ height: (parent && parent.currentItem) ? parent.currentItem. height : units.gu(4);
+ }
+ }
+
+ // circular list
+ Component {
+ id: wrapAround
+ PathView {
+ id: pView
+ property Item tumbler: styledItem
+ anchors.fill: parent
+ clip: true
+
+ model: styledItem.model
+ delegate: styledItem.delegate
+ highlight: highlightComponent
+ // put the currentItem to the center of the view
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+
+ pathItemCount: pView.height / highlightItem.height + 1
+ snapMode: PathView.SnapToItem
+ flickDeceleration: 100
+
+ property int contentHeight: pathItemCount * highlightItem.height
+ path: Path {
+ startX: pView.width / 2
+ startY: -(pView.contentHeight - pView.height) / 2
+ PathLine {
+ x: pView.width / 2
+ y: pView.height + (pView.contentHeight - pView.height) / 2
+ }
+ }
+ }
+ }
+
+ // linear list
+ Component {
+ id: linear
+ ListView {
+ id: lView
+ property Item tumbler: styledItem
+
+ anchors.fill: parent
+ clip: true
+
+ model: styledItem.model
+ delegate: styledItem.delegate
+
+ highlight: highlightComponent
+ preferredHighlightBegin: highlightItem ? (height - highlightItem. height) / 2 : 0
+ preferredHighlightEnd: highlightItem ? (preferredHighl ightBegin + highlightItem. height) : 0
+ highlightRangeMode: ListView.StrictlyEnforce Range
+ highlightMoveDuration: 300
+ flickDeceleration: 100
+ }
+ }
+
+ Loader {
+ id: loader
+ asynchronous: false
+ anchors {
+ fill: parent
+ margins: units.gu(0.2)
+ }
+ sourceComponent: (styledItem.circular) ? wrapAround : linear
+
+ // to avoid binding loop
+ Connections {
+ target: styledItem
+ onSelectedIndexChanged: loader. item.currentInd ex = styledItem. selectedIndex
+ }
+
+ // live selectedIndex updater
+ Binding {
+ target: styledItem
+ property: "selectedIndex"
+ value: loader.item.currentInd ex
+ when: completed && (styledItem.model !== undefined) && styledItem.live
+ }
+ // non-live selectedIndex updater
+ Connections {
+ target: loader.item
+ ignoreUnknownSignals: true
+ onMovementEnded: {
+ if (!styledItem.live) styledItem.selectedIndex = loader. item.currentInd ex;
+ }
+ onCurrentIndexChanged: {
+ if (!styledItem.live && styledItem.__clickedIndex === loader. item.currentInd ex) {
+ styledItem.selectedIndex = loader. item.currentInd ex;
+ styledItem.__clickedIndex = -1;
+ }
+ }
+ onModelChanged: {
+ moveToIndex((completed) ? 0 : styledItem. selectedIndex) ;
+ if (completed && !styledItem.live) styledItem.selectedIndex = 0;
+ }
+ }
+
+ Component.onCompleted: {
+ completed = true;
+ if (item) {
+ loader.item.currentInd ex = styledItem. selectedIndex;
+ moveToIndex(styledItem. selectedIndex) ;
+ }
+ }
+
+ // overlay
+ Rectangle {
+ visible: control.overlay
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: control.overlayColor
+ }
+
+ GradientStop {
+ position: 0.40
+ color: "#ffffff"
+ }
+
+ GradientStop {
+ position: 0.63
+ color: "#ffffff"
+ }
+
+ GradientStop {
+ position: 1
+ color: control.overlayColor
+ }
+ }
+ anchors.fill: parent
+ }
+ }
+
+}=== modified file 'modules/
Ubuntu/ Components/ Themes/ Ambiance/ qmldir'
--- a/modules/Ubuntu/ Components/ Themes/ Ambiance/ qmldir 2013-08-20 15:26:47 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ Ambiance/ qmldir 2013-09-23 08:28:34 +0000
@@ -5,6 +5,8 @@
internal DialogForegroundStyle DialogForegroun dStyle. qml
internal HeaderStyle HeaderStyle.qml
MainViewStyle 0.1 MainViewStyle.qml
+ListItemOptionSelector 0.1 ListItemOptionS elector. qml
+OptionSelectorStyle 0.1 OptionSelectorS tyle.qml
PopoverForegroundStyle 0.1 PopoverForegrou ndStyle. qml
internal ScrollbarStyle ScrollbarStyle.qml
internal SelectionCursorStyle SelectionCursor Style.qml
@@ -18,4 +20,5 @@
internal ToolbarButtonStyle ToolbarButtonStyle.qml
internal ToolbarStyle ToolbarStyle.qml
internal BubbleShape BubbleShape.qml
-
+PickerStyle 0.1 PickerStyle.qml
+PickerDelegateStyle 0.1 PickerDelegateS tyle.qml === added file 'modules/
Ubuntu/ Components/ Themes/ SuruDark/ ListItemOptionS electorStyle. qml'
--- a/modules/Ubuntu/ Components/ Themes/ SuruDark/ ListItemOptionS electorStyle. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ SuruDark/ ListItemOptionS electorStyle. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components. Themes. Ambiance 0.1
+
+OptionSelectorStyle {
+ id: suruDarkStyle
+}=== added file 'modules/
Ubuntu/ Components/ Themes/ SuruDark/ OptionSelectorS tyle.qml'
--- a/modules/Ubuntu/ Components/ Themes/ SuruDark/ OptionSelectorS tyle.qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ SuruDark/ OptionSelectorS tyle.qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components. Themes. Ambiance 0.1
+
+OptionSelectorStyle {
+ id: suruDarkStyle
+}=== added file 'modules/
Ubuntu/ Components/ Themes/ SuruGradient/ ListItemOptionS electorStyle. qml'
--- a/modules/Ubuntu/ Components/ Themes/ SuruGradient/ ListItemOptionS electorStyle. qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ SuruGradient/ ListItemOptionS electorStyle. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components. Themes. Ambiance 0.1
+
+OptionSelectorStyle {
+ id: suruGradientStyle
+
+ chevron: "artwork/chevron_ down@30. png"
+ tick: "artwork/tick@30. png"
+ colourComponent: false
+}=== added file 'modules/
Ubuntu/ Components/ Themes/ SuruGradient/ OptionSelectorS tyle.qml'
--- a/modules/Ubuntu/ Components/ Themes/ SuruGradient/ OptionSelectorS tyle.qml 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ Themes/ SuruGradient/ OptionSelectorS tyle.qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components. Themes. Ambiance 0.1
+
+OptionSelectorStyle {
+ id: suruGradientStyle
+
+ chevron: "artwork/chevron_ down@30. png"
+ tick: "artwork/tick@30. png"
+ colourComponent: false
+}=== added directory 'modules/
Ubuntu/ Components/ Themes/ SuruGradient/ artwork'
=== added file 'modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ chevron_ down@30. png'
Binary files a/modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ chevron_ down@30. png 1970-01-01 00:00:00 +0000 and b/modules/ Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ chevron_ down@30. png 2013-09-23 08:28:34 +0000 differ
=== added file 'modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ tick@30. png'
Binary files a/modules/Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ tick@30. png 1970-01-01 00:00:00 +0000 and b/modules/ Ubuntu/ Components/ Themes/ SuruGradient/ artwork/ tick@30. png 2013-09-23 08:28:34 +0000 differ
=== modified file 'modules/Ubuntu/ Components/ Toolbar. qml'
--- a/modules/Ubuntu/ Components/ Toolbar. qml 2013-07-16 18:44:50 +0000
+++ b/modules/Ubuntu/ Components/ Toolbar. qml 2013-09-23 08:28:34 +0000
@@ -34,27 +34,6 @@
height: background.height/*!
- \deprecated
- Use property bool opened instead.
- */
- property bool active
- onActiveChanged: {
- print("Toolbar. active property is DEPRECATED. Use opened instead.");
- toolbar.opened = active;
- }
-
- /*
- \deprecated
- Use property locked instead.
- */
- property bool lock
- /*! \internal */
- onLockChanged: {
- print("Toolbar.lock property is DEPRECATED. Use locked instead.");
- toolbar.locked = lock;
- }
-
- /*!
\preliminary
The list of \l Actions to be shown on the toolbar
*/
@@ -67,12 +46,12 @@
&& tools.opened && tools.locked) {
// toolbar is locked in visible state.
internal. updateVisibleTo ols();
- opened = true;
+ toolbar.open();
} else if (!opened && !animating) {
// toolbar is closed
internal. updateVisibleTo ols();
} else {
- opened = false;
+ toolbar.close()
// internal.visibleTools will be updated
// when the hide animation is finished
}
@@ -93,7 +72,13 @@
Connections {
target: tools
ignoreUnknown Signals: true
- onOpenedChanged: toolbar.opened = tools.opened;
+ onOpenedChanged: {
+ if (tools.opened) {
+ toolbar.open();
+ } else {
+ toolbar.close();
+ }
+ }
onLockedChang ed: toolbar.locked = tools.locked;
}=== removed file 'modules/
Ubuntu/ Components/ ToolbarActions. qml'
--- a/modules/Ubuntu/ Components/ ToolbarActions. qml 2013-06-27 15:20:12 +0000
+++ b/modules/Ubuntu/ Components/ ToolbarActions. qml 1970-01-01 00:00:00 +0000
@@ -1,298 +0,0 @@
-/*
- * Copyright 2012 Canonical Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu. org/licenses/>.
- */
-
-import QtQuick 2.0
-// FIXME: When a module contains QML, C++ and JavaScript elements exported,
-// we need to use named imports otherwise namespace collision is reported
-// by the QML engine. As workaround, we use Theming named import.
-// Bug to watch: https://bugreports. qt-project. org/browse/ QTBUG-27645
-import Ubuntu.Components 0.1 as Theming
-
-/*!
- \qmltype ToolbarActions
- \deprecated
- \inqmlmodule Ubuntu.Components 0.1
- \ingroup ubuntu
- \brief List of \l Action items with additional properties to control a toolbar.
-
- \b {ToolbarActions is DEPRECATED. Please use \l ToolbarItems instead.}
-
- Each \l Page has a tools property that can be set to change the tools of toolbar supplied
- by \l MainView when the \l Page is active. Each ToolbarActions consists of a set of
- \l Action items and several properties that specify the behavior of the toolbar when the \l Page
- is active.
-
- When a \l Page is used inside a \l Tabs or \l PageStack, the toolbar will automatically show
- the tools of the active \l Page. When the active \l Page inside the \l Tabs or \l PageStack
- is updated by changing the selected \l Tab or by pushing/popping a \l Page on the \l PageStack,
- the toolbar will automatically hide, except if the new active \l Page has the \l locked property set.
-
- \l {http://design. ubuntu. com/apps/ building- blocks/ toolbar}{See also the Design Guidelines on Toolbars}.
-
- \qml
- import QtQuick 2.0
- import Ubuntu.Components 0.1
-
- MainView {
- width: units.gu(50)
- height: units.gu(50)
-
- Page {
- title: "Tools example"
- Label {
- anchors.centerIn: parent
- text: "Custom back button\nToolbar locked"
- }
- tools: ToolbarActions {
- Action {
- text: "action 1"
- iconSource: Qt.resolvedUrl("call_icon. png")
- }
- Action {
- text: "action 2"
- iconSource: Qt.resolvedUrl("call_icon. png")
- }
- back {
- itemHint: Button {
- id: cancelButton
- text: "cancel"
- }
- }
- locked: true
- opened: true
- }
- }
- }
- \endqml
-*/
-Item {
- id: toolbarActions
- anchors.fill: parent
-
- // internal objects using nested elements,
- // which isn't allowed by QtObject; this fix makes this possible
- /*!
- Default property to allow adding of children. For example, the tools of a \l Page
- can be defined as follows:
- \qml
- import QtQuick 2.0
- import Ubuntu.Components 0.1
-
- MainView {
- width: units.gu(50)
- height: units.gu(80)
-
- Page {
- title: "test page"
-
- Label {
- anchors.centerIn: parent
- text: "Hello, world"
- }
-
- tools: ToolbarActions {
- Action {
- text: "action 1"
- }
- Action {
- text: "action 2"
- }
- }
- }
- }
- \endqml
- ToolbarActions will automatically create a visual representation of the actions.
- \qmlproperty list<Action> children
- */
- default property alias children: toolbarActions.actions
-
- /*!
- List of already defined actions when not defining them as children of the ToolbarActions.
- Note that when you set this property, the children of ToolbarActions will be ignored,
- so do not set the list and define children.
- \qml
- import QtQuick 2.0
- import Ubuntu.Components 0.1
-
- MainView {
- width: units.gu(50)
- height: units.gu(80)
-
- Action {
- id: action1
- text: "action 1"
- onTriggered: print("one!")
- }
- Action {
- id: action2
- text: "action 2"
- onTriggered: print("two!")
- }
-
- Page {
- title: "test page"
-
- Label {
- anchors.centerIn: parent
- text: "Hello, world"
- }
-
- tools: ToolbarActions {
- actions: [action1, action2]
- }
- }
- }
- \endqml
- the advantage of setting actions over using the children is that the same
- \l Action items can be used in several sets of actions.
- */
- property list<Action> actions
-
- /*!
- The back \l Action. If the action is visible, the back button will be shown
- on the left-side of the toolbar.
- If there is a \l PageStack with depth greater than 1, the back action will be
- visible and triggering it will pop the page on top of the stack. If there is no
- \l PageStack with depth greater than 1, the back action is hidden by default
- (but the default setting can be changed by setting its visible property).
- */
- property Action back: Action {
- iconSource: Qt.resolvedUrl("artwork/ back.png" )
- text: i18n.tr("Back")
- visible: toolbarActions.__pageStack && toolbarActions. __pageStack. depth > 1
- /*!
- \internal
- FIXME: If this is not marked as internal, qdoc thinks it needs to be documented.
- */
- onTriggered: if (toolbarActions.__pageStack && toolbarActions. __pageStack. depth > 1) toolbarActions. __pageStack. pop()
- }
-
- /*!
- \internal
- PageStack for the back button
- */
- // Cannot use PageStack here that will cause a loop in parsing the qml files
- property Item __pageStack: null
-
- /*!
- The toolbar is opened
- */
- property bool opened: false
-
- /*!
- \deprecated
- Use property opened instead.
- */
- property bool active
- /*!
- \deprecated
- \internal
- */
- onActiveChanged: {
- print("ToolbarActions. active property is DEPRECATED. Use opened instead.");
- toolbarActions.opened = active;
- }
-
- /*!
- \deprecated
- Use property locked instead.
- */
- property bool lock
- /*!
- \deprecated
- \internal
- */
- onLockChanged: {
- print("ToolbarActions. lock property is DEPRECATED. Use locked instead.");
- toolbarActions.locked = lock;
- }
-
- /*!
- The toolbar cannot be opened/closed by bottom-edge swipes.
- If the ToolbarActions contains no visible actions, it is automatically
- locked (in closed state).
- */
- property bool locked: !toolbarActions.__hasVisibleAc tions()
-
- /*!
- \internal
- Determine whether this ToolbarActions has any visible actions
- */
- function __hasVisibleActions() {
- if (back && back.visible) return true;
- for (var i=0; i < toolbarActions.actions. length; i++) {
- if (toolbarActions.actions[ i].visible) return true;
- }
- return false;
- }
-
- Component {
- id: toolButtonComponent
- Button {
- id: toolButton
- // Disable the mouse area so swipes on the button will not be blocked
- // from going to the toolbar. The panel will take care calling the button's clicked().
- __mouseArea.visible: false
- style: Theme.createStyleComponent( "ToolbarButtonS tyle.qml" , toolButton)
- width: visible ? units.gu(5) : 0
- height: toolbarActions.height
- }
- }
-
- Loader {
- id: backButton
- property Action backAction: toolbarActions.back
- sourceComponent: backAction ? backAction.itemHint ? backAction.itemHint : toolButtonComponent : null
- anchors {
- left: parent.left
- leftMargin: units.gu(2)
- verticalCenter: parent.verticalCenter
- }
- onStatusChanged: {
- if (item && status == Loader.Ready) {
- if (item.hasOwnProperty(" action" )) item.action = backAction;
- }
- }
- // ensure the item's action is up-to-date (which is not the case without this line):
- onBackActionChanged: if (item && item.hasOwnProp erty("action" )) item.action = backAction;
- }
-
- Row {
- id: toolButtonsContainer
- anchors {
- right: parent.right
- bottom: parent.bottom
- top: parent.top
- rightMargin: units.gu(2)
- }
- spacing: units.gu(1)
-
- Repeater {
- model: toolbarActions.actions
- Loader {
- sourceComponent: modelData.itemHint ? modelData.itemHint : toolButtonComponent
- anchors.verticalCenter: toolButtonsCont ainer.verticalC enter
- onStatusChanged: {
- if (item && status == Loader.Ready) {
- if (item.hasOwnProperty(" action" )) item.action = modelData
- }
- }
- }
- }
- }
-
- Component.onCompleted: print(" ToolbarActions is DEPRECATED. Use ToolbarItems instead.")
-}=== added file 'modules/
Ubuntu/ Components/ artwork/ chevron_ down@30. png'
Binary files a/modules/Ubuntu/ Components/ artwork/ chevron_ down@30. png 1970-01-01 00:00:00 +0000 and b/modules/ Ubuntu/ Components/ artwork/ chevron_ down@30. png 2013-09-23 08:28:34 +0000 differ
=== added file 'modules/Ubuntu/ Components/ artwork/ tick@30. png'
Binary files a/modules/Ubuntu/ Components/ artwork/ tick@30. png 1970-01-01 00:00:00 +0000 and b/modules/ Ubuntu/ Components/ artwork/ tick@30. png 2013-09-23 08:28:34 +0000 differ
=== modified file 'modules/Ubuntu/ Components/ deployment. pri'
--- a/modules/Ubuntu/ Components/ deployment. pri 2013-02-05 07:26:29 +0000
+++ b/modules/Ubuntu/ Components/ deployment. pri 2013-09-23 08:28:34 +0000
@@ -15,6 +15,9 @@
# Components/Popups
POPUPS_FILES = $$system(find Popups -maxdepth 1 -type f)+#Components/
Pickers
+PICKER_FILES = $$system(find Pickers -maxdepth 1 -type f)
+
# qmldir
QMLDIR_FILE = qmldir@@ -36,9 +39,11 @@
listitems_artwork_ files.files = $$LISTITEMS_ ARTWORK_ FILES
popups_files.path = $$installPath/Popups
popups_files.files = $$POPUPS_FILES
+pickers_files.path = $$installPath/Pickers
+picker_files.files = $$PICKER_FILESplugins_
qmltypes. path = $$installPath
plugins_qmltypes. files = plugins.qmltypes
plugins_qmltypes. extra = $$[QT_INSTALL_ BINS]/qmlplugin dump -notrelocatable Ubuntu.Components 0.1 ../../ > $(INSTALL_ ROOT)/$ $installPath/ plugins. qmltypes -INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_
artwork_ files popups_files plugins_qmltypes
+INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_ files popups_files picker_files plugins_qmltypes === modified file 'modules/
Ubuntu/ Components/ overview. qdoc'
--- a/modules/Ubuntu/ Components/ overview. qdoc 2013-08-13 09:16:32 +0000
+++ b/modules/Ubuntu/ Components/ overview. qdoc 2013-09-23 08:28:34 +0000
@@ -41,6 +41,13 @@
\endcode
\annotatedlist ubuntu-listitems + \part Pickers
+ Available through:
+ \code
+ import Ubuntu.Components. Pickers 0.1
+ \endcode
+ \annotatedlist ubuntu-pickers
+
\part Popovers, Sheets and Dialogs
Available through:
\code=== modified file 'modules/
Ubuntu/ Components/ plugin/ giconprovider. cpp'
--- a/modules/Ubuntu/ Components/ plugin/ giconprovider. cpp 2013-07-10 12:29:39 +0000
+++ b/modules/Ubuntu/ Components/ plugin/ giconprovider. cpp 2013-09-23 08:28:34 +0000
@@ -61,6 +61,15 @@QImage GIconProvider:
:requestImage( const QString &id, QSize *size, const QSize &requestedSize)
{
+ static bool warned = false;
+
+ if (!warned) {
+ qWarning("WARNING: The 'gicon' image provider is deprecated and will be removed soon. "
+ "Please use file:// urls for file icons, and the 'theme' image provider for "
+ "themed icons (image://theme/ iconname, fallback1, fallback2) .");
+ warned = true;
+ }
+
QImage result;
QByteArray utf8Name = QUrl::fromPercentEncoding( id.toUtf8( )).toUtf8( );
GError *error = NULL;=== modified file 'modules/
Ubuntu/ Components/ plugin/ plugin. cpp'
--- a/modules/Ubuntu/ Components/ plugin/ plugin. cpp 2013-09-16 15:53:53 +0000
+++ b/modules/Ubuntu/ Components/ plugin/ plugin. cpp 2013-09-23 08:28:34 +0000
@@ -45,6 +45,7 @@
#include "ucapplication.h"
#include "ucalarm.h"
#include "ucalarmmodel.h"
+#include "unitythemeiconprovider. h" #include <sys/types.h>
#include <unistd.h>
@@ -191,8 +192,9 @@engine-
>addImageProvid er(QLatin1Strin g("scaling" ), new UCScalingImageP rovider) ; - // register gicon provider
+ // register icon providers
engine->addImageProvid er(QLatin1Strin g("gicon" ), new GIconProvider);
+ engine->addImageProvid er(QLatin1Strin g("theme" ), new UnityThemeIconP rovider) ; // Necessary for Screen.orientation (from import QtQuick.Window 2.0) to work
QGuiApplication:: primaryScreen( )->setOrientati onUpdateMask( === modified file 'modules/
Ubuntu/ Components/ plugin/ plugin. pro'
--- a/modules/Ubuntu/ Components/ plugin/ plugin. pro 2013-08-27 11:52:35 +0000
+++ b/modules/Ubuntu/ Components/ plugin/ plugin. pro 2013-09-23 08:28:34 +0000
@@ -48,6 +48,7 @@
alarmmanager_p_p. h \
alarmmanager_p.h \
ucalarmmodel.h \
+ unitythemeiconprovider. h \
alarmrequest_p.h \
alarmrequest_p_p. h @@ -74,6 +75,7 @@
ucalarm.cpp \
alarmmanager_p.cpp \
ucalarmmodel.cpp \
+ unitythemeiconprovider. cpp \
alarmrequest_p.cpp # adapters
=== added file 'modules/
Ubuntu/ Components/ plugin/ unitythemeiconp rovider. cpp'
--- a/modules/Ubuntu/ Components/ plugin/ unitythemeiconp rovider. cpp 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ plugin/ unitythemeiconp rovider. cpp 2013-09-23 08:28:34 +0000
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ * Authors: Lars Uebernickel <email address hidden>
+ */
+
+#include "unitythemeiconprovider. h"
+
+#include <QIcon>
+
+UnityThemeIconProvider: :UnityThemeIcon Provider( ):
+ QQuickImageProvider(QQuickImag eProvider: :Pixmap)
+{
+}
+
+QPixmap UnityThemeIconProvider: :requestPixmap( const QString &id, QSize *realSize, const QSize &requestedSize)
+{
+ QIcon icon;
+
+ Q_FOREACH (QString name, id.split(",", QString::SkipEmptyParts )) {
+ icon = QIcon::fromTheme( name);
+ if (!icon.isNull()) {
+ if (requestedSize.isValid( )) {
+ *realSize =requestedSize;
+ return icon.pixmap(requestedSize) ;
+ } else {
+ QList<QSize> sizes = icon.availableSizes();
+ if (sizes.count() > 0 && sizes.last().isValid( )) {
+ *realSize = sizes.last();
+ } else {
+ *realSize = QSize(32,32);
+ }
+ return icon.pixmap(*realSize) ;
+ }
+ break;
+ }
+ }
+ return QPixmap();
+}=== added file 'modules/
Ubuntu/ Components/ plugin/ unitythemeiconp rovider. h'
--- a/modules/Ubuntu/ Components/ plugin/ unitythemeiconp rovider. h 1970-01-01 00:00:00 +0000
+++ b/modules/Ubuntu/ Components/ plugin/ unitythemeiconp rovider. h 2013-09-23 08:28:34 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ * Authors: Lars Uebernickel <email address hidden>
+ */
+
+#ifndef UNITY_THEME_ICON_PROVIDER_ H
+#define UNITY_THEME_ICON_PROVIDER_ H
+
+#include <QQuickImageProvider>
+
+class UnityThemeIconProvider: public QQuickImageProvider
+{
+public:
+ UnityThemeIconProvider( );
+ QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize);
+};
+
+#endif=== modified file 'modules/
Ubuntu/ Components/ qmldir'
--- a/modules/Ubuntu/ Components/ qmldir 2013-07-25 12:18:21 +0000
+++ b/modules/Ubuntu/ Components/ qmldir 2013-09-23 08:28:34 +0000
@@ -3,7 +3,6 @@
Action 0.1 Action.qml
ActionItem 0.1 ActionItem.qml
ActionList 0.1 ActionList.qml
-ToolbarActions 0.1 ToolbarActions.qml
ToolbarItems 0.1 ToolbarItems.qml
ToolbarButton 0.1 ToolbarButton.qml
MainView 0.1 MainView.qml
@@ -25,6 +24,8 @@
Scrollbar 0.1 Scrollbar.qml
internal ModelSectionCounter ModelSectionCounter.qml
Object 0.1 Object.qml
+OptionSelector 0.1 OptionSelector.qml
+OptionSelectorDelegate 0.1 OptionSelectorD elegate. qml
Page 0.1 Page.qml
internal PageTreeNode PageTreeNode.qml
PageStack 0.1 PageStack.qml=== modified file 'po/ca.po'
--- a/po/ca.po 2013-08-15 05:51:35 +0000
+++ b/po/ca.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/de.po'
--- a/po/de.po 2013-08-15 05:51:35 +0000
+++ b/po/de.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/es.po'
--- a/po/es.po 2013-08-15 05:51:35 +0000
+++ b/po/es.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/fr.po'
--- a/po/fr.po 2013-08-15 05:51:35 +0000
+++ b/po/fr.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/gl.po'
--- a/po/gl.po 2013-08-15 05:51:35 +0000
+++ b/po/gl.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/he.po'
--- a/po/he.po 2013-08-15 05:51:35 +0000
+++ b/po/he.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/ko.po'
--- a/po/ko.po 2013-08-15 05:51:35 +0000
+++ b/po/ko.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/my.po'
--- a/po/my.po 2013-08-23 05:52:49 +0000
+++ b/po/my.po 2013-09-23 08:28:34 +0000
@@ -8,14 +8,14 @@
"Project-Id-Version: ubuntu- ui-toolkit\ n"
"Report-Msgid-Bugs- To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-05-30 14:06+0200\n"
-"PO-Revision-Date: 2013-08-22 11:28+0000\n"
+"PO-Revision-Date: 2013-09-07 10:58+0000\n"
"Last-Translator: Pyae Sone <Unknown>\n"
"Language-Team: Burmese <email address hidden>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-23 05:52+0000\n"
-"X-Generator: Launchpad (build 16737)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"
@@ -102,7 +102,7 @@
#: examples/ubuntu- ui-toolkit- gallery/ ListItems. qml:83
#: examples/ubuntu- ui-toolkit- gallery/ ListItems. qml:95
msgid "Label"
-msgstr ""
+msgstr "အဆင့်"#: examples/
ubuntu- ui-toolkit- gallery/ ListItems. qml:31
msgid "Subtitled"
@@ -110,7 +110,7 @@#: examples/
ubuntu- ui-toolkit- gallery/ ListItems. qml:35
msgid "Secondary label"
-msgstr ""
+msgstr "ဒုတိယအဆင့်"#: examples/
ubuntu- ui-toolkit- gallery/ ListItems. qml:50
msgid "Progression"
@@ -162,7 +162,7 @@#: examples/
ubuntu- ui-toolkit- gallery/ ListItems. qml:106
msgid "Slide to remove"
-msgstr ""
+msgstr "ဖြုတ်ရန် ဘေးသို့ဆွဲပါ"#: examples/
ubuntu- ui-toolkit- gallery/ ListItems. qml:116
msgid "Grouped list"
@@ -339,12 +339,12 @@#: modules/
Ubuntu/ Components/ ToolbarActions. qml:86
msgid "Back"
-msgstr ""
+msgstr "နောက်သို့"#: tests/resources
/pagestack/ MyCustomPage. qml:21
#: tests/resources/tabs/MyCustomP age.qml: 21
msgid "My custom page"
-msgstr ""
+msgstr "ကျွန်ုပ်စိတ်ကြ ိုက်စာမျ က်နှာ" #: tests/resources
/pagestack/ MyCustomPage. qml:33
#: tests/resources/tabs/MyCustomP age.qml: 33
@@ -359,15 +359,15 @@#: tests/resources
/pagestack/ PageStack. qml:44
msgid "Page one"
-msgstr ""
+msgstr "စာမျက်နှာ တစ်"#: tests/resources
/pagestack/ PageStack. qml:49
msgid "External page"
-msgstr ""
+msgstr "နောက်အပိုစာမျက် နှာ" #: tests/resources
/pagestack/ PageStack. qml:58
msgid "First page"
-msgstr ""
+msgstr "ပထမစာမျက်နှာ"#: tests/resources
/pagestack/ PageStack. qml:64
msgid "Root page (again)"
@@ -375,11 +375,11 @@#: tests/resources
/pagestack/ PageStack. qml:69
msgid "Red rectangle"
-msgstr ""
+msgstr "အနီရောင်လေးထောင့်"#: tests/resources
/tabs/Tabs. qml:32
msgid "Simple page"
-msgstr ""
+msgstr "ရိုးရိုးစာမျက်နှာ"#: tests/resources
/tabs/Tabs. qml:77
msgid "External"=== modified file 'po/nl.po'
--- a/po/nl.po 2013-08-15 05:51:35 +0000
+++ b/po/nl.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== modified file 'po/sv.po'
--- a/po/sv.po 2013-08-15 05:51:35 +0000
+++ b/po/sv.po 2013-09-23 08:28:34 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer- Encoding: 8bit\n"
-"X-Launchpad-Export- Date: 2013-08-15 05:51+0000\n"
-"X-Generator: Launchpad (build 16723)\n"
+"X-Launchpad-Export- Date: 2013-09-17 05:19+0000\n"
+"X-Generator: Launchpad (build 16765)\n"#: examples/
ubuntu- ui-toolkit- gallery/ Animations. qml:22
msgid "NumberAnimation"=== added file 'tests/
autopilot/ ubuntuuitoolkit /base.py'
--- a/tests/autopilot/ ubuntuuitoolkit /base.py 1970-01-01 00:00:00 +0000
+++ b/tests/autopilot/ ubuntuuitoolkit /base.py 2013-09-23 08:28:34 +0000
@@ -0,0 +1,37 @@
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+# Copyright (C) 2013 Canonical Ltd.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu. org/licenses/>.
+
+"""Base classes for Autopilot tests using the Ubuntu UI Toolkit."""
+
+from autopilot import (
+ input,
+ platform,
+ testcase
+)
+
+
+class UbuntuUIToolkitAppTestCase( testcase. AutopilotTestCa se):
+ """Autopilot test case for applications using the Ubuntu UI Toolkit."""
+
+ def setUp(self):
+ super(UbuntuUIToolkitAppTestCa se, self).setUp()
+ self.input_device_ class = self._get_ input_device_ class()
+
+ def _get_input_device_ class(self) :
+ if platform.model() == 'Desktop':
+ return input.Mouse
+ else:
+ return input.Touch=== modified file 'tests/
autopilot/ ubuntuuitoolkit /emulators. py'
--- a/tests/autopilot/ ubuntuuitoolkit /emulators. py 2013-08-21 13:51:07 +0000
+++ b/tests/autopilot/ ubuntuuitoolkit /emulators. py 2013-09-23 08:28:34 +0000
@@ -35,20 +35,22 @@
input_ device_ class = input.Mouse
else:
input_ device_ class = input.Touch
- return input.Pointer(input_device_ class.create( ))
+ return input.Pointer(device= input_device_ class.create( )) class UbuntuUIToolkit
EmulatorBase( dbus.CustomEmul atorBase) :
"""A base class for all the Ubuntu UI Toolkit emulators."""+ def __init__(self, *args):
+ super(UbuntuUIToolkitEmulatorB ase, self)._ _init__ (*args)
+ self.pointing_device = get_pointing_ device( )
+ # TODO it would be nice to have access to the screen keyboard if we are
+ # on the touch UI -- elopio - 2013-09-04
+class MainView(
UbuntuUIToolkit EmulatorBase) :
"""MainView Autopilot emulator."""- def __init__(self, *args):
- super(MainView, self).__init__ (*args)
- self.pointing_device = get_pointing_ device( )
-
def get_header(self):
"""Return the Header emulator of the MainView."""
return self.select_single( 'Header' , objectName= 'MainView_ Header' )
@@ -198,10 +200,6 @@
class Toolbar(UbuntuUIToolkit EmulatorBase) :
"""Toolbar Autopilot emulator."""- def __init__(self, *args):
- super(Toolbar, self).__init__ (*args)
- self.pointing_device = get_pointing_ device( )
-
def click_button(self, object_name):
"""Click a button of the toolbar.@@ -233,14 +231,13 @@
class TabBar(UbuntuUIToolkit EmulatorBase) :
"""TabBar Autopilot emulator."""- def __init__(self, *args):
- super(TabBar, self).__init__ (*args)
- self.pointing_device = get_pointing_ device( )
-
def switch_to_next_ tab(self) :
"""Open the next tab."""
# Click the tab bar to switch to selection mode.
self. pointing_ device. click_object( self)
+ if not self.selectionMode:
+ # in case someone stole the click, like the open toolbar
+ self.pointing_device. click_object( self)
self. pointing_ device. click_object( self._get_ next_tab_ button( )) def _get_next_
tab_button( self):
@@ -261,10 +258,6 @@
class ActionSelectionPopover( UbuntuUIToolkit EmulatorBase) :
"""ActionSelectio nPopover Autopilot emulator.""" - def __init__(self, *args):
- super(ActionSelectionPopover, self)._ _init__ (*args)
- self.pointing_device = get_pointing_ device( )
-
def click_button_by_text( self, text):
"""Click a button on the popover.=== modified file 'tests/
autopilot/ ubuntuuitoolkit /tests/ __init_ _.py'
--- a/tests/autopilot/ ubuntuuitoolkit /tests/ __init_ _.py 2013-08-21 13:11:00 +0000
+++ b/tests/autopilot/ ubuntuuitoolkit /tests/ __init_ _.py 2013-09-23 08:28:34 +0000
@@ -16,81 +16,126 @@"""Ubuntu UI Toolkit autopilot tests."""
-from os import remove
-import os.path
-from tempfile import mktemp
-import subprocess
+import os
+import tempfile-from autopilot.input import Mouse, Touch, Pointer
+from autopilot.input import Pointer
from autopilot.matchers import Eventually
-from autopilot.platform import model
from testtools.matchers import Is, Not, Equals
-from autopilot.testcase import AutopilotTestCase
-
-from ubuntuuitoolkit import emulators
-
-
-def get_module_include_ path():
+
+from ubuntuuitoolkit import base, emulators
+
+
+_DESKTOP_FILE_CONTENTS = ("""[Desktop Entry]
+Type=Application
+Exec=Not important
+Path=Not important
+Name=Test app
+Icon=Not important
+""")
+
+
+def _write_test_desktop_ file():
+ desktop_file_dir = get_local_desktop_ file_directory( )
+ if not os.path.exists( desktop_ file_dir) :
+ os.makedirs(desktop_ file_dir)
+ desktop_file = tempfile.NamedTemporaryF ile(
+ suffix='.desktop', dir=desktop_file_dir, delete=False)
+ desktop_file.write( _DESKTOP_ FILE_CONTENTS)
+ desktop_file.close( )
+ return desktop_file.name
+
+
+def get_local_desktop_ file_directory( ):
+ return os.path.join(os. environ[ 'HOME'] , '.local', 'share', 'applications')
+
+
+def _get_module_include_ path():
+ return os.path.join(get_ path_to_ source_ root(), 'modules')
+
+
+def get_path_to_source_ root():
return os.path.abspath(
os.path. join(
- os.path.dirname( __file_ _),
- '..',
- '..',
- '..',
- '..',
- 'modules')
- )
-
-
-def get_input_device_ scenarios( ):
- """Return the scenarios with the right input device for the platform."""
- if model() == 'Desktop':
- scenarios = [('with mouse', dict(input_device_ class=Mouse) )]
- else:
- scenarios = [('with touch', dict(input_device_ class=Touch) )]
- return scenarios
-
-
-class UbuntuUiToolkitTestCase( AutopilotTestCa se):
- """Common test case class for SDK tests."""
-
- scenarios = get_input_device_ scenarios( )
-
- def setUp(self):
- self.pointing_device = Pointer( self.input_ device_ class.create( ))
- super(UbuntuUiToolkitTestCase, self).setUp()
- self.launch_test_qml( )
-
- def launch_test_qml( self):
- # If the test class has defined a 'test_qml' class attribute then we
- # write it to disk and launch it inside the Qml Viewer. If not, then we
- # silently do nothing (presumably the test has something else planned).
- arch = subprocess.check_output(
- ["dpkg-architecture" , "-qDEB_ HOST_MULTIARCH" ]).strip( )
- if hasattr(self, 'test_qml') and isinstance(self.test_ qml, basestring):
- qml_path = mktemp(suffix= '.qml')
- open(qml_path, 'w').write(self.test_ qml)
- self.addCleanup(remove, qml_path)
-
- self.app = self.launch_test_applicatio n(
- "/usr/lib/" + arch + "/qt5/bin/qmlscene" ,
- "-I", get_module_include_ path(),
- qml_path,
- emulator_base=emulators. UbuntuUIToolkit EmulatorBase,
- app_type='qt')
-
- if (hasattr(self, 'test_qml_file') and
- isinstance(self.test_ qml_file, basestring)):
- qml_path = self.test_qml_file
- self.app = self.launch_test_applicatio n(
- "/usr/lib/" + arch + "/qt5/bin/qmlscene" ,
- "-I", get_module_include_ path(),
- qml_path,
- emulator_base=emulators. UbuntuUIToolkit EmulatorBase,
- app_type='qt')
-
- self.assertThat(
- self.main_view.visible, Eventually( Equals( True)))
+ os.path.dirname( __file_ _), '..', '..', '..', '..'))
+
+
+class QMLStringAppTestCase(base. UbuntuUIToolkit AppTestCase) :
+ """Base test case for self tests that define the QML on an string."""
+
+ test_qml = ("""
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+MainView {
+ width: units.gu(48)
+ height: units.gu(60)
+}
+""")
+
+ def setUp(self):
+ super(QMLStringAppTestCase, self).setUp()
+ self.pointing_device = Pointer( self.input_ device_ class.create( ))
+ self.launch_application( )
+
+ def launch_application( self):
+ qml_file_path = self._write_test_qml_ file()
+ self.addCleanup(os.remove, qml_file_path)
+ desktop_file_path = _write_test_desktop_ file()
+ self.addCleanup(os.remove, desktop_file_path)
+ self.app = self.launch_test_applicatio n(
+ 'qmlscene',
+ '-I' + _get_module_include_ path(),
+ qml_file_path,
+ '--desktop_file_hint= {0}'.format( desktop_ file_path) ,
+ emulator_base=emulators. UbuntuUIToolkit EmulatorBase,
+ app_type='qt')
+
+ self.assertThat(
+ self.main_view.visible, Eventually( Equals( True)))
+
+ def _write_test_qml_ file(self) :
+ qml_file = tempfile.NamedTemporaryF ile(suffix= '.qml', delete=False)
+ qml_file.write(self. test_qml)
+ qml_file.close()
+ return qml_file.name
+
+ @property
+ def main_view(self):
+ return self.app.select_ single( emulators. MainView)
+
+
+class QMLFileAppTestCase(base. UbuntuUIToolkit AppTestCase) :
+ """Base test case for self tests that launch a QML file."""
+
+ test_qml_file_path = '/path/to/file.qml'
+ desktop_file_path = None
+
+ def setUp(self):
+ super(QMLFileAppTestCase, self).setUp()
+ self.pointing_device = Pointer( self.input_ device_ class.create( ))
+ self.launch_application( )
+
+ def launch_application( self):
+ desktop_file_path = self._get_desktop_ file_path( )
+ self.app = self.launch_test_applicatio n(
+ 'qmlscene',
+ "-I" + _get_module_include_ path(),
+ self.test_qml_file_ path,
+ '--desktop_file_hint= {0}'.format( desktop_ file_path) ,
+ emulator_base=emulators. UbuntuUIToolkit EmulatorBase,
+ app_type='qt')
+
+ self.assertThat(
+ self.main_view.visible, Eventually( Equals( True)))
+
+ def _get_desktop_file_path( self):
+ if self.desktop_file_path is None:
+ desktop_file_path = _write_test_desktop_ file()
+ self.addCleanup(os.remove, desktop_file_path)
+ return desktop_file_path
+ else:
+ self.desktop_file_path @property
def main_view(self):
@@ -116,13 +161,17 @@
return (contentLoader, listView)def loadItem(self, item):
- contentLoader = self.main_view.select_ single(
- "QQuickLoader", objectName="contentLoader" )
self. selectItem( item)
+ contentLoader = self.main_view.select_ single(
+ "QQuickLoader", objectName="contentLoader" )
self. assertThat( contentLoader. progress, Eventually( Equals( 1.0)))
loadedPage = self.getListItem(item)
self. assertThat( loadedPage, Not(Is(None)))
- self.assertThat(loadedPage. visible, Eventually( Equals( True)))
+ #loadedPage is not a page, it is the list item which goes in
+ #background when the item is selected, which changes the visible
+ #property of item in list itself to False. So followin check
+ #fails on Nexus 4. Commenting it for now.
+ #self.assertThat(loadedPage. visible, Eventually( Equals( True))) def drag(self, itemText, itemTextTo):
item = self.getListItem(itemText)
@@ -135,6 +184,15 @@def selectItem(self, itemText):
item = self.getListItem(itemText)
+ x1, y1, w1, h1 = item.globalRect
+ x2, y2, w2, h2 = self.main_view.globalRect
+
+ orientationHelper = self.getOrientationHelper( )
+ rot = orientationHelper.rotation
+ scrollTo = h2 / 2 - (y1 - h2 - h1)
+ if rot == 0.0 and y1 > h2:
+ self.pointing_device. drag(w2 / 2, h2 / 2, w2 / 2, scrollTo)
+
self. assertThat( item.selected, Eventually( Equals( False)) ) self. pointing_ device. move_to_ object( item) === modified file 'tests/
autopilot/ ubuntuuitoolkit /tests/ gallery/ test_gallery. py'
--- a/tests/autopilot/ ubuntuuitoolkit /tests/ gallery/ test_gallery. py 2013-07-25 01:42:26 +0000
+++ b/tests/autopilot/ ubuntuuitoolkit /tests/ gallery/ test_gallery. py 2013-09-23 08:28:34 +0000
@@ -17,9 +17,7 @@
"""Tests for the Ubuntu UI Toolkit Gallery"""import os
-import time
-
-import testscenarios
+import shutilfrom autopilot.matchers import Eventually
from testtools.matchers import Is, Not, Equals
@@ -27,23 +25,64 @@
from ubuntuuitoolkit import tests-class GalleryTestCase
(tests. UbuntuUiToolkit TestCase) :
+class GalleryTestCase(tests. QMLFileAppTestC ase):
"""Base class for gallery test cases."""- # Support both running from system and in the source directory
- runPath = os.path.dirname( os.path. realpath( __file_ _))
- localSourceFile = (
- runPath +
- "/../../../../ ../examples/ ubuntu- ui-toolkit- gallery/ "
- "ubuntu-ui-toolkit- gallery. qml")
- if (os.path.isfile( localSourceFile )):
- print "Using local source directory"
- test_qml_file = localSourceFile
- else:
- print "Using system QML file"
- test_qml_file = (
- "/usr/lib/ubuntu- ui-toolkit/ examples/ ubuntu- ui-toolkit- gallery/ "
- "ubuntu-ui-toolkit- gallery. qml")
+ local_desktop_file_path = None
+
+ def setUp(self):
+ self.app_qml_source_ path = os.path.join(
+ self._get_path_to_ gallery_ source( ),
+ 'ubuntu-ui-toolkit- gallery. qml')
+ self.test_qml_file_ path = self._get_ test_qml_ file_path( )
+ self.desktop_file_path = self._get_ desktop_ file_path( )
+ super(GalleryTestCase, self).setUp()
+
+ def _get_path_to_gallery_ source( self):
+ return os.path.join(
+ tests.get_path_to_ source_ root(), 'examples',
+ 'ubuntu-ui-toolkit- gallery' )
+
+ def _application_source_ exists( self):
+ return os.path.exists( self.app_ qml_source_ path)
+
+ def _get_test_qml_file_ path(self) :
+ if self._application_source_ exists( ):
+ return self.app_qml_source_ path
+ else:
+ return os.path.join(
+ self._get_path_to_ installed_ gallery( ),
+ 'ubuntu-ui-toolkit- gallery. qml')
+
+ def _get_path_to_installed_ gallery( self):
+ return '/usr/lib/ubuntu- ui-toolkit/ examples/ ubuntu- ui-toolkit- gallery'
+
+ def _get_desktop_file_path( self):
+ if self._application_source_ exists( ):
+ local_desktop_file_dir = tests.get_ local_desktop_ file_directory( )
+ if not os.path.exists( local_desktop_ file_dir) :
+ os.makedirs(local_desktop_ file_dir)
+ source_desktop_ file_path = os.path.join(
+ self._get_path_to_ gallery_ source( ),
+ 'ubuntu-ui-toolkit- gallery. desktop' )
+ local_desktop_file_path = os.path.join(
+ local_desktop_file_dir, 'ubuntu- ui-toolkit- gallery. desktop' )
+ shutil.copy(source_ desktop_ file_path, local_desktop_ file_path)
+ # We can't delete the desktop file before we close the application,
+ # so we save it on an attribute to be deleted on tear down.
+ self.local_desktop_ file_path = local_desktop_ file_path
+ return local_desktop_file_path
+ else:
+ return os.path.join(
+ self._get_path_to_ installed_ gallery( ),
+ 'ubuntu-ui-toolkit- gallery. desktop' )
+
+ def tearDown(self):
+ super(GalleryTestCase, self).tearDown()
+ # We can't delete the desktop file before we close the application,
+ # so we save it on an attribute to be deleted on tear down.
+ if self.local_desktop_ file_path is not None:
+ os.remove(self.local_ desktop_ file_path) class GenericTests(
GalleryTestCase ):
@@ -56,52 +95,6 @@
self. assertThat( rootItem, Not(Is(None)))
self. assertThat( rootItem. visible, Eventually( Equals( True))) - def test_can_
select_ listview( self):
- """Must be able to select the listview from main"""
-
- contentLoader, listView = self.getWidgetLoaderAndListVie w()
-
- # Don't have the first, already selected item as the first item to
- # check.
- items = [
- "Navigation",
- "Toggles",
- "Buttons",
- "Slider",
- "Text Field",
- "Progress and activity",
- "Ubuntu Shape",
- "Icons",
- "Label",
- "List Items",
- ]
-
- for item in items:
- self.checkListItem(item)
- self.loadItem(item)
- self.checkPageHeader(item)
-
- # scroll view to expose more items
- self.drag("Icons", "Text Field")
-
- # Wait for the scrolling to finish, the next click fails on the
- # slower Intel machine but succeeds on AMD and NVIDIA.
- # (LP: #1180226)
- time.sleep(1)
-
- # now that we have more items, lets continue
- items = [
- "Dialog",
- "Popover",
- "Sheet",
- "Animations"
- ]
-
- for item in items:
- self.checkListItem(item)
- self.loadItem(item)
- self.checkPageHeader(item)
-
def test_navigation(self):
item = "Navigation"
self. loadItem( item)
@@ -198,58 +191,6 @@# self.assertThat
(obj.text, Equals( "Hello World!")) - def test_textfield(
self):
- item = "Text Field"
- self.loadItem(item)
- self.checkPageHeader(item)
-
- self.getObject("textinputs" )
-
- item_data = [
- ["textfield_standard" , True, 0, "", None],
- ["textfield_password" , True, 2, "password", None],
- ["textfield_numbers" , True, 0, "123", True],
- ["textfield_disabled" , False, 0, "", None],
- ]
-
- for data in item_data:
- objName = data[0]
- objEnabled = data[1]
- objEchoMode = data[2]
- objText = data[3]
- objNumbersOnly = data[4]
-
- obj = self.getObject(objName)
- self.tap(objName)
-
- self.assertThat(obj.enabled, Equals(objEnabled))
- self.assertThat(obj.focus, Equals( obj.enabled) )
- self.assertThat(obj.highlighte d, Equals(obj.focus))
- self.assertThat(obj.errorHighl ight, Equals(False))
- self.assertThat(obj.acceptable Input, Equals(True))
- self.assertThat(obj.hasClearBu tton, Equals(True))
- self.assertThat(obj.text, Equals(objText))
-
- if (objEchoMode != -1):
- self.assertThat(obj.echoMode, Equals( objEchoMode) )
-
- if (objNumbersOnly):
- self.type_string( "abc")
- self.assertThat(obj.text, Equals(objText))
- self.assertThat(obj.errorHighl ight, Equals(False))
- self.assertThat(obj.acceptable Input, Equals(True))
- else:
- self.type_string( "Hello World!")
- if (objEnabled):
- self.assertThat(
- obj.text, Equals("%sHello World!" % (objText)))
- self.assertThat(obj.errorHighl ight, Equals(False))
- self.assertThat(obj.acceptable Input, Equals(True))
- else:
- self.assertThat(obj.text, Equals(objText))
-
- self.tap_clearButton( objName)
-
def test_progress_and_activity( self):
item = "Progress and activity"
self. loadItem( item)
@@ -291,27 +232,26 @@class ButtonsTestCase
(GalleryTestCas e): - scenarios = testscenarios.
multiply_ scenarios(
- tests.get_input_device_ scenarios( ),
- [('standard button', dict(
+ scenarios = [
+ ('standard button', dict(
button_ name="button_ text", is_enabled=True, color=None, icon=None,
text= "Call") ),
- ('button with color', dict(
- button_name="button_ color", is_enabled=True,
- color=[0, 0, 0, 255], icon=None, text="Call")),
- ('button with icon', dict(
- button_name="button_ iconsource" , is_enabled=True, color=None,
- icon="call.png", text=None)),
- ('button with icon on the right', dict(
- button_name="button_ iconsource_ right_text" , is_enabled=True,
- color=None, icon="call.png", text="Call")),
- ('button with icon on the left', dict(
- button_name="button_ iconsource_ left_text" , is_enabled=True,
- color=None, icon="call.png", text="Call")),
- ('disabled button', dict(
- button_name="button_ text_disabled" , is_enabled=False, color=None,
- icon=None, text="Call"))]
- )
+ ('button with color', dict(
+ button_name="button_ color", is_enabled=True,
+ color=[0, 0, 0, 255], icon=None, text="Call")),
+ ('button with icon', dict(
+ button_name="button_ iconsource" , is_enabled=True, color=None,
+ icon="call.png", text=None)),
+ ('button with icon on the right', dict(
+ button_name="button_ iconsource_ right_text" , is_enabled=True,
+ color=None, icon="call.png", text="Call")),
+ ('button with icon on the left', dict(
+ button_name="button_ iconsource_ left_text" , is_enabled=True,
+ color=None, icon="call.png", text="Call")),
+ ('disabled button', dict(
+ button_name="button_ text_disabled" , is_enabled=False, color=None,
+ icon=None, text="Call"))
+ ]def test_buttons(self):
item = "Buttons"=== added file 'tests/
autopilot/ ubuntuuitoolkit /tests/ test_base. py'
--- a/tests/autopilot/ ubuntuuitoolkit /tests/ test_base. py 1970-01-01 00:00:00 +0000
+++ b/tests/autopilot/ ubuntuuitoolkit /tests/ test_base. py 2013-09-23 08:28:34 +0000
@@ -0,0 +1,42 @@
+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+# Copyright (C) 2013 Canonical Ltd.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu. org/licenses/>.
+
+import testtools
+from autopilot import input, platform
+
+from ubuntuuitoolkit import base
+
+
+class AppTestCase(base.UbuntuUITo olkitAppTestCas e):
+ """Empty test case to be used by other tests."""
+
+ def _runTest(self):
+ pass
+
+
+class TestUbuntuUIToolkitAppTestCase (testtools. TestCase) :
+
+ @testtools.skipIf( platform. model() != 'Desktop', 'Desktop only')
+ def test_desktop_input_device_ class(self) :
+ test = AppTestCase('_runTest' )
+ test.setUp()
+ self.assertIs(test.input_ device_ class, input.Mouse)
+
+ @testtools.skipIf( platform. model() == 'Desktop', 'Phablet only')
+ def test_phablet_input_device_ class(self) :
+ test = AppTestCase('_runTest' )
+ test.setUp()
+ self.assertIs(test.input_ device_ class, input.Touch) === modified file 'tests/
autopilot/ ubuntuuitoolkit /tests/ test_emulators. py'
--- a/tests/autopilot/ ubuntuuitoolkit /tests/ test_emulators. py 2013-08-09 00:48:33 +0000
+++ b/tests/autopilot/ ubuntuuitoolkit /tests/ test_emulators. py 2013-09-23 08:28:34 +0000
@@ -14,12 +14,39 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu. org/licenses/>. +import unittest
+
import mock
+import testtools
+from autopilot import input, platformfrom ubuntuuitoolkit import emulators, tests
-class MainViewTestCas
e(tests. UbuntuUiToolkit TestCase) :
+class UbuntuUIToolkitEmulatorBaseTes tCase(testtools .TestCase) :
+
+ def test_pointing_device( self):
+ emulator = emulators.UbuntuUIToolkit EmulatorBase( {}, 'dummy_path')
+ self.assertIsInstance( emulator. pointing_ device, input.Pointer)
+
+ @mock.patch('autopilot. input.Pointer' )
+ @unittest.skipIf( platform. model() != 'Desktop', 'Desktop only')
+ def test_pointing_device_ in_desktop( self, mock_pointer):
+ emulators.UbuntuUIToolkit EmulatorBase( {}, 'dummy_path')
+ mock_pointer.assert_ called_ once_with( device= mock.ANY)
+ _, _, keyword_args = mock_pointer.mock_calls[ 0]
+ self.assertIsInstance( keyword_ args['device' ], input.Mouse)
+
+ @mock.patch('autopilot. input.Pointer' )
+ @unittest.skipIf( platform. model() == 'Desktop', 'Phablet only')
+ def test_pointing_device_ in_phablet( self, mock_pointer):
+ emulators.UbuntuUIToolkit EmulatorBase( {}, 'dummy_path')
+ mock_pointer.assert_ called_ once_with( device= mock.ANY)
+ _, _, keyword_args = mock_pointer.mock_calls[ 0]
+ self.assertIsInstance( keyword_ args['device' ], input.Touch)
+
+
+class MainViewTestCase(tests. QMLStringAppTes tCase): test_qml = ("""
import QtQuick 2.0
@@ -57,7 +84,7 @@
error. message, 'The MainView has no Tabs.') -class PageTestCase(
tests.UbuntuUiT oolkitTestCase) :
+class PageTestCase(tests.QMLString AppTestCase) : test_qml = ("""
import QtQuick 2.0
@@ -80,7 +107,7 @@
self. assertEqual( header. title, "Test title") -class ToolbarTestCase
(tests. UbuntuUiToolkit TestCase) :
+class ToolbarTestCase(tests. QMLStringAppTes tCase): test_qml = ("""
import QtQuick 2.0
@@ -157,7 +184,7 @@
error. message, 'Button with objectName "unexisting" not found.') -class TabsTestCase(
tests.UbuntuUiT oolkitTestCase) :
+class TabsTestCase(tests.QMLString AppTestCase) : test_qml = ("""
import QtQuick 2.0
@@ -173,14 +200,35 @@
Tab {
objectNam e: "tab1"
title: "Tab1"
+ Page {
+ tools: ToolbarItems {
+ ToolbarButton {
+ text: "Test1"
+ }
+ }
+ }
}
Tab {
objectNam e: "tab2"
title: "Tab2"
+ Page {
+ tools: ToolbarItems {
+ ToolbarButton {
+ text: "Test2"
+ }
+ }
+ }
}
Tab {
objectNam e: "tab3"
title: "Tab3"
+ Page {
+ tools: ToolbarItems {
+ ToolbarButton {
+ text: "Test3"
+ }
+ }
+ }
}
}
}
@@ -260,7 +308,7 @@
error. message, 'Tab with objectName "unexisting" not found.') -class ActionSelection
PopoverTestCase (tests. UbuntuUiToolkit TestCase) :
+class ActionSelectionPopoverTestCase (tests. QMLStringAppTes tCase): test_qml = ("""
import QtQuick 2.0=== added directory 'tests/
resources/ optionselector'
=== added file 'tests/resources/ optionselector/ test.png'
Binary files a/tests/resources/ optionselector/ test.png 1970-01-01 00:00:00 +0000 and b/tests/ resources/ optionselector/ test.png 2013-09-23 08:28:34 +0000 differ
=== modified file 'tests/unit/tst_ components/ tst_toolbar. qml'
--- a/tests/unit/tst_ components/ tst_toolbar. qml 2013-07-15 16:03:43 +0000
+++ b/tests/unit/tst_ components/ tst_toolbar. qml 2013-09-23 08:28:34 +0000
@@ -27,9 +27,9 @@
id: mainView
Page {
id: page
- tools: ToolbarActions {
- id: toolbarActions
- Action {
+ tools: ToolbarItems {
+ id: toolbarItems
+ ToolbarButton {
text: "action1"
}
}
@@ -41,7 +41,7 @@
when: windowShownfunction initTestCase() {
- compare(page.tools, toolbarActions, "Page tools are set initially");
+ compare(page.tools, toolbarItems, "Page tools are set initially");
compare( page.__ propagated, mainView. __propagated, "propagated property is propagated from mainView to page")
compare( mainView. __propagated. toolbar. tools, page.tools, "Toolbar tools are set to page tools initially");
compare( mainView. __propagated. toolbar. tools.opened, false, "Toolbar is closed initially");
@@ -73,10 +73,10 @@
}function test_bug1192673() {
- toolbarActions.opened = false;
+ toolbarItems.opened = false;
mainView. __propagated. toolbar. opened = true;
- compare(toolbarActions. opened, true, "opening the toolbar updates toolbarActions. opened" );
- toolbarActions.opened = false;
+ compare(toolbarItems. opened, true, "opening the toolbar updates toolbarItems. opened" );
+ toolbarItems.opened = false;
compare( mainView. __propagated. toolbar. opened, false, "setting toolbarActions. opened to false closes the toolbar");
}
}=== added directory 'tests/
unit/tst_ theme'
=== added file 'tests/unit/tst_ theme/tst_ popoverforegrou ndstyle. qml'
--- a/tests/unit/tst_ theme/tst_ popoverforegrou ndstyle. qml 1970-01-01 00:00:00 +0000
+++ b/tests/unit/tst_ theme/tst_ popoverforegrou ndstyle. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+import QtQuick 2.0
+import QtTest 1.0
+import Ubuntu.Components 0.1
+import Ubuntu.Components. Themes. Ambiance 0.1
+import Ubuntu.Components. Popups 0.1
+
+TestCase {
+ name: "PopupsPopoverAPI"
+
+ function test_show() {
+ popOver.show()
+ }
+
+ Popover {
+ id: popOver
+
+ foregroundStyle: testForegroundStyle
+ Text {
+ text: "Hello Popover!"
+ }
+ }
+
+ Component {
+ id: testForegroundStyle
+ PopoverForegroundStyle {
+ }
+ }
+}=== added file 'tests/
unit/tst_ theme/tst_ theme.cpp'
--- a/tests/unit/tst_ theme/tst_ theme.cpp 1970-01-01 00:00:00 +0000
+++ b/tests/unit/tst_ theme/tst_ theme.cpp 2013-09-23 08:28:34 +0000
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ *
+ */
+#include <QtQuickTest/quicktest. h>
+QUICK_TEST_MAIN( theme) === added file 'tests/
unit/tst_ theme/tst_ theme.pro'
--- a/tests/unit/tst_ theme/tst_ theme.pro 1970-01-01 00:00:00 +0000
+++ b/tests/unit/tst_ theme/tst_ theme.pro 2013-09-23 08:28:34 +0000
@@ -0,0 +1,9 @@
+TESTS += $$system(ls tst_*.qml)
+
+include(../qmltest- include. pri)
+
+TARGET = tst_theme
+
+SOURCES += tst_theme.cpp
+
+OTHER_FILES += $$system(ls *.qml)=== modified file 'tests/
unit/unit. pro'
--- a/tests/unit/unit. pro 2013-08-19 15:24:44 +0000
+++ b/tests/unit/unit. pro 2013-09-23 08:28:34 +0000
@@ -24,4 +24,5 @@
tst_arguments \
tst_argument \
tst_layouts \
- tst_alarms
+ tst_alarms \
+ tst_theme=== added file 'tests/
unit_x11/ tst_components/ tst_listitems_ itemselector. qml'
--- a/tests/unit_x11/ tst_components/ tst_listitems_ itemselector. qml 1970-01-01 00:00:00 +0000
+++ b/tests/unit_x11/ tst_components/ tst_listitems_ itemselector. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import QtTest 1.0
+import Ubuntu.Components 0.1
+import Ubuntu.Components. ListItems 0.1 as ListItem
+import Ubuntu.Test 0.1
+
+Item {
+ width: 400
+ height: 400
+
+ Column {
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ ListItem.ItemSelector {
+ id: selector
+
+ text: "TEST"
+ delegate: selectorDelegate
+ model: customModel
+ expanded: true
+ }
+
+ OptionSelectorDelegate {
+ id: testDelegate
+
+ text: "TEST"
+ subText: "test"
+ icon: "../../resources/ optionselector/ test.png"
+ constrainImage: true
+ }
+ }
+
+ Component {
+ id: selectorDelegate
+
+ OptionSelectorDelegate {
+ text: name
+ subText: description
+ icon: image
+ constrainImage: true
+ }
+ }
+
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "../../resources/ optionselector/ test.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "../../resources/ optionselector/ test.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "../../resources/ optionselector/ test.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "../../resources/ optionselector/ test.png" }
+ }
+
+ SignalSpy {
+ id: clickedSignal
+ target: selector
+ signalName: "delegateClicked"
+ }
+
+ UbuntuTestCase {
+ name: "ItemSelectorAPI"
+ when: windowShown
+
+ function test_expanded() {
+ var listContainer = findChild(selector, "listContainer");
+
+ selector.expanded = false;
+ compare(listContainer. isExpanded, false, "isExpanded should be true if list is an expanded one");
+ compare(listContainer. state, "collapsed", "state should be collapsed");
+
+ selector.expanded = true;
+ compare(listContainer. isExpanded, true, "isExpanded should be false if list is an expanded one");
+ compare(listContainer. state, "expanded", "state should be expanded");
+ }
+
+ function test_text() {
+ var newText = "Hello World!";
+ selector.text = newText;
+ compare(selector. text, newText, "set/get");
+ }
+
+ function test_selectedIndex() {
+ compare(selector. selectedIndex, 0, "selectedIndex is 0 by default");
+ }
+
+ function test_model() {
+ selector.model = undefined;
+ var newValues = ["value0","value1" ,"value2" ,"value3" ];
+ selector.model = newValues;
+ compare(selector. model, newValues, "set/get");
+ }
+
+ function test_custom_model_delegate( ) {
+ compare(selector. model, customModel, "Model wasn't set correctly.");
+ compare(selector. delegate, selectorDelegate, "Delegate hasn't been set correctly");
+ }
+
+ function test_image_constraint( ) {
+ var image = findChild(testDelegate, "icon");
+ compare(image.height, testDelegate. height) ;
+ }
+
+ function test_signal() {
+ mouseMove(selector, 100, 100);
+ mouseClick(selector, 100, 100, Qt.LeftButton);
+ wait(100)
+ compare(clickedSignal. count, 1, "Clicked not emitted.");
+ }
+ }
+}=== added file 'tests/
unit_x11/ tst_components/ tst_optionselec tor.qml'
--- a/tests/unit_x11/ tst_components/ tst_optionselec tor.qml 1970-01-01 00:00:00 +0000
+++ b/tests/unit_x11/ tst_components/ tst_optionselec tor.qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import QtTest 1.0
+import Ubuntu.Components 0.1
+import Ubuntu.Test 0.1
+
+Item {
+ width: 400
+ height: 400
+
+ Column {
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ OptionSelector {
+ id: selector
+
+ text: "TEST"
+ delegate: selectorDelegate
+ model: customModel
+ expanded: true
+ }
+
+ OptionSelectorDelegate {
+ id: testDelegate
+
+ text: "TEST"
+ subText: "test"
+ icon: "../../resources/ optionselector/ test.png"
+ constrainImage: true
+ }
+ }
+
+ Component {
+ id: selectorDelegate
+
+ OptionSelectorDelegate {
+ text: name
+ subText: description
+ icon: image
+ constrainImage: true
+ }
+ }
+
+ ListModel {
+ id: customModel
+ ListElement { name: "Name 1"; description: "Description 1"; image: "../../resources/ optionselector/ test.png" }
+ ListElement { name: "Name 2"; description: "Description 2"; image: "../../resources/ optionselector/ test.png" }
+ ListElement { name: "Name 3"; description: "Description 3"; image: "../../resources/ optionselector/ test.png" }
+ ListElement { name: "Name 4"; description: "Description 4"; image: "../../resources/ optionselector/ test.png" }
+ }
+
+ SignalSpy {
+ id: clickedSignal
+ target: selector
+ signalName: "delegateClicked"
+ }
+
+ UbuntuTestCase {
+ name: "OptionSelectorAPI"
+ when: windowShown
+
+ function test_expanded() {
+ var listContainer = findChild(selector, "listContainer");
+
+ selector.expanded = false;
+ compare(listContainer. isExpanded, false, "isExpanded should be true if list is an expanded one");
+ compare(listContainer. state, "collapsed", "state should be collapsed");
+
+ selector.expanded = true;
+ compare(listContainer. isExpanded, true, "isExpanded should be false if list is an expanded one");
+ compare(listContainer. state, "expanded", "state should be expanded");
+ }
+
+ function test_text() {
+ var newText = "Hello World!";
+ selector.text = newText;
+ compare(selector. text, newText, "set/get");
+ }
+
+ function test_selectedIndex() {
+ compare(selector. selectedIndex, 0, "selectedIndex is 0 by default");
+ }
+
+ function test_model() {
+ selector.model = undefined;
+ var newValues = ["value0","value1" ,"value2" ,"value3" ];
+ selector.model = newValues;
+ compare(selector. model, newValues, "set/get");
+ }
+
+ function test_custom_model_delegate( ) {
+ compare(selector. model, customModel, "Model wasn't set correctly.");
+ compare(selector. delegate, selectorDelegate, "Delegate hasn't been set correctly");
+ }
+
+ function test_image_constraint( ) {
+ var image = findChild(testDelegate, "icon");
+ compare(image.height, testDelegate. height) ;
+ }
+
+ function test_signal() {
+ mouseMove(selector, 100, 100);
+ mouseClick(selector, 100, 100, Qt.LeftButton);
+ wait(100)
+ compare(clickedSignal. count, 1, "Clicked not emitted.");
+ }
+ }
+}=== modified file 'tests/
unit_x11/ tst_components/ tst_panel. qml'
--- a/tests/unit_x11/ tst_components/ tst_panel. qml 2013-05-27 08:43:46 +0000
+++ b/tests/unit_x11/ tst_components/ tst_panel. qml 2013-09-23 08:28:34 +0000
@@ -58,9 +58,9 @@
}function test_opened() {
- panel.opened = true;
+ panel.open();
compare( panel.opened, true, "Can set opened");
- panel.opened = false;
+ panel.close();
compare( panel.opened, false, "Can unset opened");
}@@ -241,7 +241,7 @@
}function test_clickToDea ctivate( ) {
- panel.opened = true;
+ panel.open();
compare( panel.opened && panel.align === Qt.AlignBottom, true, "Panel is opened and bottom-aligned");
mouseClick( root, root.width / 2, 5, Qt.LeftButton);
compare( panel.opened, false, "Panel is deactivated by clicking in the view outside of the panel"); === added file 'tests/
unit_x11/ tst_components/ tst_picker. qml'
--- a/tests/unit_x11/ tst_components/ tst_picker. qml 1970-01-01 00:00:00 +0000
+++ b/tests/unit_x11/ tst_components/ tst_picker. qml 2013-09-23 08:28:34 +0000
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu. org/licenses/>.
+ */
+
+import QtQuick 2.0
+import QtTest 1.0
+import Ubuntu.Test 0.1
+import Ubuntu.Components 0.1
+import Ubuntu.Components. Pickers 0.1
+
+Item {
+ id: testSuite
+ width: units.gu(20)
+ height: units.gu(40)
+
+ Column {
+ Picker {
+ objectName: "linear"
+ id: linearShort
+ circular: false
+ model: objectModel
+ delegate: PickerDelegate {
+ Label {text: modelData}
+ }
+ }
+ Picker {
+ objectName: "linear"
+ id: linearLong
+ circular: false
+ model: longerModel
+ delegate: PickerDelegate {
+ Label {text: modelData}
+ }
+ }
+
+ Picker {
+ objectName: "objectModelled"
+ id: objectModelled
+ model: objectModel
+ selectedIndex: 2
+ }
+ Picker {
+ objectName: "simpleModelled"
+ id: simpleModelled
+ model: emptyModel
+ selectedIndex: 2
+ }
+ Picker {
+ objectName: "picker"
+ id: picker
+ }
+ }
+
+ ListModel {
+ id: emptyModel
+ }
+
+ ListModel {
+ id: objectModel
+ ListElement {
+ label: "line1"
+ }
+ ListElement {
+ label: "line2"
+ }
+ ListElement {
+ label: "line3"
+ }
+ }
+
+ ListModel {
+ id: longerModel
+ ListElement {
+ label: "line1"
+ }
+ ListElement {
+ label: "line2"
+ }
+ ListElement {
+ label: "line3"
+ }
+ ListElement {
+ label: "line4"
+ }
+ ListElement {
+ label: "line5"
+ }
+ ListElement {
+ label: "line6"
+ }
+ }
+
+ SignalSpy {
+ id: spy
+ }
+
+ UbuntuTestCase {
+ id: testCase
+ name: "PickerAPI"
+ when: windowShown
+
+ function test_0_circular() {
+ compare(picker. circular, true, "default circular");
+ }
+ function test_0_model() {
+ compare(picker. model, undefined, "default model");
+ }
+ function test_0_delegate() {
+ compare(picker. delegate, null, "default delegate");
+ }
+ function test_0_selectedIndex( ) {
+ compare(picker. selectedIndex, 0, "default selectedIndex");
+ }
+
+ function test_1_runtimeModel( ) {
+ picker.model = emptyModel;
+ compare(picker. selectedIndex, 0, "selectedIndex gets 0");
+ }
+
+ function test_1_selectedIndexFo rEmptyModel( ) {
+ compare(simpleModelled. selectedIndex, 2, "empty modelled picker selectedIndex is 0");
+ }
+
+ function test_1_selectedIndexFo rObjectModel( ) {
+ compare(objectModelled. selectedIndex, 2, "model containing data, picker. selectedIndex" );
+ }
+
+ function test_2_updateModel( ) {
+ picker.selectedIndex = 1;
+ spy.clear();
+ spy.signalName = "onSelectedIndexChanged" ;
+ spy.target = picker;
+ picker.model = [];
+ tryCompare(spy, "count", 1);
+ }
+
+ function test_2_updateModel2( ) {
+ objectModelled.selectedIndex = 1;
+ spy.clear();
+ spy.signalName = "onSelectedIndexChanged" ;
+ spy.target = objectModelled;
+ objectModelled.model = [];
+ tryCompare(spy, "count", 1);
+ }
+
+ function test_4_clickMovesSelec tion_Long( ) {
+ spy.clear();
+ spy.signalName = "onSelectedIndexChanged" ;
+ spy.target = linearLong;
+ mouseClick(linearLong, units.gu(1), units.gu(1));
+ tryCompare(spy, "count", 0);
+ mouseClick(linearLong, units.gu(1), units.gu(18));
+ tryCompare(spy, "count", 1);
+ }
+
+ function test_3_clickMovesSelec tion_Short( ) {
+ spy.clear();
+ spy.signalName = "onSelectedIndexChanged" ;
+ spy.target = linearShort;
+ mouseClick(linearShort, units.gu(1), units.gu(1));
+ tryCompare(spy, "count", 0);
+ mouseClick(linearShort, units.gu(1), units.gu(18));
+ tryCompare(spy, "count", 1);
+ }
+
+ function test_5_clickMovesSelec tion_Long( ) {
+ spy.clear();
+ spy.signalName = "onSelectedIndexChanged" ;
+ linearLong.circular = true;
+
+ spy.target = linearLong;
+ mouseClick(linearLong, units.gu(1), units.gu(1));
+ tryCompare(spy, "count", 1);
+ mouseClick(linearLong, units.gu(1), units.gu(18));
+ tryCompare(spy, "count", 2);
+ }
+ }
+} - 706. By Cris Dywan
-
Merge lp:ubuntu-ui-toolkit
[ Zsombor Egri ]
* Alarm backend turned to asynchronous implementation. Status enum and
corresponding property added to Alarm element to reflect the pending
operation status.
[ Ubuntu daily release ]
* Automatic snapshot from revision 712
[ Zsombor Egri ]
* AlarmModel got a role named model to solve ambiguous role accessing
situations. Test application added.
[ Ubuntu daily release ]
* Automatic snapshot from revision 710
[ Alexandre Abreu ]
* Add an actionmanager property that let clients be more flexible with
their actions at runtime. (LP: #1207804)
[ tpeeters ]
* Do not trigger a ToolbarButton that is not enabled. (LP: #1202245)
[ Ubuntu daily release ]
* Automatic snapshot from revision 707
[ Michael Zanetti ]
* Make Popover themable and allow inheriting Popover's default style.
[ Omer Akram ]
* make the input device detection logic inside autopilot emulators
actually work.
* first step for autopilot tests to run on touch devices.
[ Ubuntu daily release ]
* Automatic snapshot from revision 703
[ Zsombor Egri ]
* Alarm management QML API.
[ Ubuntu daily release ]
* Automatic snapshot from revision 699
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp://staging/ubuntu-ui-toolkit