Merge lp:~bzoltan/ubuntu-ui-toolkit/OTA13-2016-06-29 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh
Status: Merged
Approved by: Zoltan Balogh
Approved revision: no longer in the source branch.
Merged at revision: 1347
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/OTA13-2016-06-29
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 5506 lines (+2586/-907) (has conflicts)
103 files modified
README (+35/-0)
components.api (+10/-0)
debian/changelog (+70/-0)
documentation/docs.sh (+13/-5)
documentation/ubuntu-ui-toolkit-indexes.qdocconf (+9/-0)
documentation/ubuntu-ui-toolkit-offline-indexes.qdocconf (+2/-11)
documentation/ubuntu-ui-toolkit-online-indexes.qdocconf (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Buttons.qml (+8/-8)
src/Ubuntu/Components/1.3/ComboButton.qml (+13/-0)
src/Ubuntu/Components/1.3/PageHeader.qml (+6/-0)
src/Ubuntu/Components/1.3/Scrollbar.qml (+35/-21)
src/Ubuntu/Components/Popups/1.3/ActionSelectionPopover.qml (+2/-0)
src/Ubuntu/Components/Styles/1.3/ActionBarStyle.qml (+12/-2)
src/Ubuntu/Components/Styles/1.3/ActionItemProperties.qml (+56/-0)
src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml (+7/-0)
src/Ubuntu/Components/Styles/Styles.pro (+1/-0)
src/Ubuntu/Components/Styles/qmldir (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml (+36/-6)
src/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml (+5/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+19/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml (+38/-18)
src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml (+2/-0)
src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro (+4/-2)
src/Ubuntu/UbuntuToolkit/privates/listviewextensions.cpp (+6/-4)
src/Ubuntu/UbuntuToolkit/privates/threelabelsslot_p.cpp (+6/-0)
src/Ubuntu/UbuntuToolkit/privates/ucpagewrapper.cpp (+15/-2)
src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils.cpp (+44/-0)
src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils_p.h (+41/-0)
src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp (+4/-0)
src/Ubuntu/UbuntuToolkit/ucabstractbutton.cpp (+1/-1)
src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp (+1/-1)
src/Ubuntu/UbuntuToolkit/uclistitem.cpp (+1/-1)
src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp (+97/-5)
src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp (+2/-2)
src/Ubuntu/UbuntuToolkit/ucstyleditembase_p.h (+1/-1)
src/Ubuntu/UbuntuToolkit/ucstylehints.cpp (+6/-3)
src/Ubuntu/UbuntuToolkit/ucunits.cpp (+15/-17)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_actionbar.py (+3/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+3/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py (+3/-3)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py (+1/-2)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py (+6/-1)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml (+31/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml (+31/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py (+13/-41)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py (+2/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml (+72/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py (+7/-60)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml (+34/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml (+83/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml (+31/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+18/-109)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml (+35/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml (+62/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml (+30/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py (+18/-90)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml (+79/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py (+6/-68)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml (+48/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml (+48/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml (+24/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml (+24/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py (+25/-67)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml (+60/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml (+42/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py (+18/-82)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ActionSelectionPopoverTestCase.qml (+2/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml (+52/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py (+11/-43)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml (+62/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py (+5/-49)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml (+30/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py (+7/-18)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml (+49/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py (+7/-37)
tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py (+0/-20)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py (+5/-3)
tests/autopilot/ubuntuuitoolkit/tests/test_launcher.py (+12/-0)
tests/autopilot/ubuntuuitoolkit/tests/test_launcher.testcase.qml (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/test_launcher.window.qml (+43/-0)
tests/unit/README (+0/-4)
tests/unit/bottomedge/ExternalContent.qml (+27/-0)
tests/unit/bottomedge/PreloadContentUrl.qml (+35/-0)
tests/unit/bottomedge/bottomedge.pro (+3/-1)
tests/unit/bottomedge/tst_bottomedge.cpp (+10/-0)
tests/unit/subtheming/GroupPropertyValueHints.qml (+33/-0)
tests/unit/subtheming/StyleHintsInvalidGroupedProperty.qml (+30/-0)
tests/unit/subtheming/subtheming.pro (+2/-0)
tests/unit/subtheming/tst_subtheming.cpp (+7/-1)
tests/unit/units/dpr1/tst_units.cpp (+2/-2)
tests/unit/units/dpr2/tst_units_dpr2.cpp (+2/-0)
tests/unit/units/dpr3/tst_units_dpr3.cpp (+2/-0)
tests/unit/visual/tst_actionbar.13.qml (+78/-17)
tests/unit/visual/tst_adaptivepagelayout_param.13.qml (+62/-0)
tests/unit/visual/tst_combobutton.13.qml (+23/-10)
tests/unit/visual/tst_focus.13.qml (+8/-2)
tests/unit/visual/tst_listitem.12.qml (+1/-1)
tests/unit/visual/tst_listitem.13.qml (+1/-1)
tests/unit/visual/tst_listitem_focus.13.qml (+241/-22)
tests/unit/visual/tst_pageheader.13.qml (+31/-1)
tests/unit/visual/tst_scrollbar.13.qml (+135/-12)
ubuntu-ui-toolkit-launcher/launcher.cpp (+83/-25)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/OTA13-2016-06-29
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
Review via email: mp+301493@code.launchpad.net

Commit message

Landing OTA13-2016-06-29

Description of the change

Landing OTA13-2016-06-29

To post a comment you must log in.
Revision history for this message
Zoltan Balogh (bzoltan) :
review: Approve
2045. By Zoltan Balogh

update from staging

2046. By Zoltan Balogh

Update from staging

2047. By Zoltan Balogh

Sync with staging

2048. By Zoltan Balogh

Sync with staging

2049. By Zoltan Balogh

Use safe qstrcmp: typeName() can be 0

2050. By Zoltan Balogh

Update from staging

2051. By Zoltan Balogh

Update from staging

2052. By Zoltan Balogh

Update from staging

2053. By Zoltan Balogh

Update from staging

2054. By Zoltan Balogh

sync with staging

2055. By Zoltan Balogh

sync with staging

2056. By Zoltan Balogh

update from staging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README'
--- README 2016-03-16 14:53:19 +0000
+++ README 2016-08-14 09:05:30 +0000
@@ -44,6 +44,41 @@
44shell.44shell.
4545
4646
47Tests
48-----
49
50tests
51 - autopilot/ubuntuuitoolkit: Autopilot test cases and CPOs
52 ./run_tests.sh list
53 ./run_tests.sh run [TESTCASE]
54 - api: Tests for apicheck (API description generator)
55 Run 'make check' in the folder
56 - license: Script to verify that sources contains copright headers
57 make license
58 - resources: Manual test cases (deprecated, should move to unit/visual)
59 - unit:
60 Unit tests using QTest/UbuntuTestCase
61 Run 'make check[_BASENAME_WITH_UNDERSCORES]' in the respective subfolder
62 eg. 'tst_label_extras.13.qml' becomes 'make check_tst_label_extras_13'
63 This is driven by runtest.sh and checkresults.sh.
64 - visual: All tests in this folder can be run as unit tests as well as
65 interactively. That means 'make check' or via gallery.sh.
66 Optional: prefix with './tests/xvfb.sh' to run inside XVfb.
67 Note for adding new files: The root must be a visual Item-based type
68 with a width and height. TestCase or UbuntuTestCase must be a child.
69
70 Verify the whole Toolkit API:
71 './tests/qmlapicheck.sh' inspects components.api and produces components.api.new
72
73 Verify the tidyness of packaging:
74 ./packaging-sorting.sh
75
76 Verify the coding style of Python source code:
77 pyflakes .
78
79 'source export_qml_dir.sh' can be used in bash to setup the environment.
80
81
47Documentation82Documentation
48-------------83-------------
4984
5085
=== modified file 'components.api'
--- components.api 2016-07-25 14:14:08 +0000
+++ components.api 2016-08-14 09:05:30 +0000
@@ -29,6 +29,8 @@
29 property Component delegate29 property Component delegate
30 property int numberOfSlots30 property int numberOfSlots
31Ubuntu.Components.Styles.ActionBarStyle 1.3: Item31Ubuntu.Components.Styles.ActionBarStyle 1.3: Item
32 property color backgroundColor
33 readonly property ActionItemProperties buttons
32 property Component defaultDelegate34 property Component defaultDelegate
33 property int defaultNumberOfSlots35 property int defaultNumberOfSlots
34 property string overflowIconName36 property string overflowIconName
@@ -47,6 +49,13 @@
47 function trigger(var value)49 function trigger(var value)
48 function trigger()50 function trigger()
49 property string text51 property string text
52Ubuntu.Components.Styles.ActionItemProperties 1.3: QtObject
53 property color backgroundColor
54 property color disabledBackgroundColor
55 property color disabledForegroundColor
56 property color foregroundColor
57 property color pressedBackgroundColor
58 property color pressedForegroundColor
50Ubuntu.Components.ActionList 1.0 0.1: QtObject59Ubuntu.Components.ActionList 1.0 0.1: QtObject
51 property list<Action> actions60 property list<Action> actions
52 default property list<Action> children61 default property list<Action> children
@@ -821,6 +830,7 @@
821 readonly property ActionBar trailingActionBar830 readonly property ActionBar trailingActionBar
822Ubuntu.Components.Styles.PageHeaderStyle 1.3: Item831Ubuntu.Components.Styles.PageHeaderStyle 1.3: Item
823 property color backgroundColor832 property color backgroundColor
833 readonly property ActionItemProperties buttons
824 property double contentHeight834 property double contentHeight
825 property Component defaultActionDelegate835 property Component defaultActionDelegate
826 property color disabledForegroundColor836 property color disabledForegroundColor
827837
=== modified file 'debian/changelog'
--- debian/changelog 2016-08-09 13:05:01 +0000
+++ debian/changelog 2016-08-14 09:05:30 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1ubuntu-ui-toolkit (1.3.2030+16.10.20160726.15) yakkety; urgency=medium2ubuntu-ui-toolkit (1.3.2030+16.10.20160726.15) yakkety; urgency=medium
23
3 * More s390x dependencies workarounding until upstart is really fixed.4 * More s390x dependencies workarounding until upstart is really fixed.
@@ -5,6 +6,75 @@
56
6 -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Mon, 08 Aug 2016 13:26:34 +03007 -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Mon, 08 Aug 2016 13:26:34 +0300
78
9=======
10ubuntu-ui-toolkit (1.3.2060+16.10) UNRELEASED; urgency=medium
11
12 [ Zoltan Balogh ]
13 * Fix OptionSelectorTestCase tests.
14 * Fix more OptionSelector autopilot tests
15
16 [ Timo Jyrinki ]
17 * Disable documentation building for GLES builds. Fixes LP: #1606222.
18 * Replace abs with qFabs due to GCC6 breakage. Fixes LP: #1610943.
19 * Limit s390x dependencies more due to upstart/s390x problems and removed
20 packages in archives. Fixes LP: #1610951
21
22 [ Andrea Bernabei ]
23 * ListItemLayout doc: add elide mode change example and add section about
24 labels default properties values. Fixes LP: #1603450.
25 * ListItemLayout doc: add explicit note about the need to bind ListItem's
26 height to layout's height.
27 * More Scrollbar optimizations: 20% faster creation time. Fixes LP: #1606451
28 * Scrollbar: fix wrong thumb color on tap/mouse release and increase coverage
29 of hover states unit tests. Fixes LP: #1608897
30
31 [ Zsombor Egri ]
32 * Fix null pointer property initializer used with 1.3 PageWrapper.
33 Fixes LP: #1604780.
34 * Fix BottomEdge content URL preloading. Fixes LP: #1604509.
35
36 [Albert Astals Cid ]
37 * UCUnits::resolveResource: Prefer image path if it exists. This saves
38 searching the disk for @gu images, which is a big speedup. According to
39 callgrind loading 100 images from a folder that contains 380 images goes
40 from around 3 million instructions per UCUnits::resolveResource call down
41 to around 10 thousand. This optimization is ok since it is not correct to
42 ship both image.png and image@20.png. You either have to ship gu-enabled
43 files or not, but mixing them is not allowed. Searched for cases in which
44 that may be happening in my phone and found none. Fixes LP: #1604029.
45
46 [ Tim Peeters ]
47 * Configure colors of the buttons in the ActionBar and PageHeader through
48 their Styles. Fixes LP: #1597774.
49 * Fix assigning of constant values to a grouped property in StyleHints.
50 Fixes LP: #1602836.
51 * Fix list view keyboard navigation for RightToLeft and BottomToTop
52 directions. Fixes LP: #1605634
53 * Use external QML files instead of embedded QML strings for autopilot tests.
54 Fixes LP: #1578319
55 * Fix failing autopilot header tests.
56 * Fix ActionSelectionPopover Autopilot CPO tests.
57
58 [Christian Dywan ]
59 * Include indexes in "offline" docs and filter out link errors.
60 Fixes LP: #1603937.
61 * Increase focus ring thickness from 1dp to 2dp. Fixes LP: #1602690.
62 * Add a snippet about tests to the toplevel README
63 * Enter/Return to trigger, Space to expand ComboButton. Fixes LP: #1523817.
64 * Initialize engine variable before using it in the _engine case.
65 * Use Qt.rgba instead of #0000 checking ListItem default color.
66 Fixes LP: #1560004
67 * Don't use a different .desktop file in the gallery tests.
68 Fixes LP: #1578319
69 * Update scaling docs, set QT_SCALE_FACTOR and unset GRID_UNIT_PX.
70 Fixes LP: #1610208
71
72 [ Florian Boucault ]
73 * Sections: load Icons asynchronously.
74
75 -- Zoltán Balogh <zoltan@bakter.hu> Fri, 29 Jul 2016 14:49:16 +0300
76
77>>>>>>> MERGE-SOURCE
8ubuntu-ui-toolkit (1.3.2030+16.10.20160726.2) yakkety; urgency=medium78ubuntu-ui-toolkit (1.3.2030+16.10.20160726.2) yakkety; urgency=medium
9 [ William Hua ]79 [ William Hua ]
10 * Make qml-module-ubuntu-components-gles depend on 80 * Make qml-module-ubuntu-components-gles depend on
1181
=== modified file 'documentation/docs.sh'
--- documentation/docs.sh 2015-05-19 09:16:44 +0000
+++ documentation/docs.sh 2016-08-14 09:05:30 +0000
@@ -28,7 +28,7 @@
28# Offline docs for QtCreator28# Offline docs for QtCreator
29eval "$QDOC $SRC/ubuntu-ui-toolkit-qtcreator.qdocconf 2> $DOC_PATH/qdoc.log"29eval "$QDOC $SRC/ubuntu-ui-toolkit-qtcreator.qdocconf 2> $DOC_PATH/qdoc.log"
30# FIXME: With Qt 5.2 this warning shows up, forcibly omit it from errors30# FIXME: With Qt 5.2 this warning shows up, forcibly omit it from errors
31grep -v "error: HTML file already exists; overwriting" $DOC_PATH/qdoc.log | grep -v "qdoc: warning: No documentation for 'global'" > $DOC_PATH/qdoc.err31grep -v "error: HTML file already exists; overwriting" $DOC_PATH/qdoc.log | grep -v "qdoc: warning: No documentation for 'global'" | grep -v "warning: Can't link to" > $DOC_PATH/qdoc.err
32cat $DOC_PATH/qdoc.err32cat $DOC_PATH/qdoc.err
33test ! -s $DOC_PATH/qdoc.err || exit 133test ! -s $DOC_PATH/qdoc.err || exit 1
34echo docs: Offline done.34echo docs: Offline done.
@@ -36,15 +36,23 @@
36eval "$QHELPGENERATOR -o '$DOC_PATH/ubuntuuserinterfacetoolkit.qch' '$DOC_PATH/offline/ubuntuuserinterfacetoolkit.qhp' | grep -v ' does not exist! Skipping it'"36eval "$QHELPGENERATOR -o '$DOC_PATH/ubuntuuserinterfacetoolkit.qch' '$DOC_PATH/offline/ubuntuuserinterfacetoolkit.qhp' | grep -v ' does not exist! Skipping it'"
37echo docs: qch done: $DOC_PATH37echo docs: qch done: $DOC_PATH
3838
39# Online docs. Run qdoc twice: the second run with indexes for cross-referencing39# Online docs
40# other APIs but discard errors because qdoc inherits all doc bugs otherwise
41eval "$QDOC $SRC/ubuntu-ui-toolkit-online.qdocconf 2> $DOC_PATH/qdoc.log"40eval "$QDOC $SRC/ubuntu-ui-toolkit-online.qdocconf 2> $DOC_PATH/qdoc.log"
42grep -v "error: HTML file already exists; overwriting" $DOC_PATH/qdoc.log | grep -v "qdoc: warning: No documentation for 'global'" > $DOC_PATH/qdoc.err41grep -v "error: HTML file already exists; overwriting" $DOC_PATH/qdoc.log | grep -v "qdoc: warning: No documentation for 'global'" | grep -v "warning: Can't link to" > $DOC_PATH/qdoc.err
43cat $DOC_PATH/qdoc.err42cat $DOC_PATH/qdoc.err
44test ! -s $DOC_PATH/qdoc.err || exit 143test ! -s $DOC_PATH/qdoc.err || exit 1
45echo docs: Online done.44echo docs: Online done.
4645
47eval "$QDOC $SRC/ubuntu-ui-toolkit-online-indexes.qdocconf 2> /dev/null"46# Second qdoc pass, this time with indexes for cross-referencing.
47# If we don't do this, bugs in docs from other modules (Qt, Unity) fail our build
48eval "$QDOC $SRC/ubuntu-ui-toolkit-offline-indexes.qdocconf 2> $DOC_PATH/qdoc.log"
49grep "warning: Can't link to" $DOC_PATH/qdoc.log > $DOC_PATH/qdoc.err
50cat $DOC_PATH/qdoc.err
51test ! -s $DOC_PATH/qdoc.err || exit 1
52eval "$QDOC $SRC/ubuntu-ui-toolkit-online-indexes.qdocconf 2> $DOC_PATH/qdoc.log"
53grep "warning: Can't link to" $DOC_PATH/qdoc.log > $DOC_PATH/qdoc.err
54cat $DOC_PATH/qdoc.err
55test ! -s $DOC_PATH/qdoc.err || exit 1
48echo docs: Cross-referenced done.56echo docs: Cross-referenced done.
4957
50sed -r -i 's@(</p>)<p/>@\1@g' $DOC_PATH/html/*.html58sed -r -i 's@(</p>)<p/>@\1@g' $DOC_PATH/html/*.html
5159
=== added file 'documentation/ubuntu-ui-toolkit-indexes.qdocconf'
--- documentation/ubuntu-ui-toolkit-indexes.qdocconf 1970-01-01 00:00:00 +0000
+++ documentation/ubuntu-ui-toolkit-indexes.qdocconf 2016-08-14 09:05:30 +0000
@@ -0,0 +1,9 @@
1indexes = \
2 /usr/share/qt5/doc/qtqml/qtqml.index \
3 /usr/share/qt5/doc/qtquick/qtquick.index \
4 /usr/share/qt5/doc/qtwebkit/qtwebkit.index \
5 /usr/share/qt5/doc/qtsvg/qtsvg.index \
6 /usr/share/qt5/doc/qtscript/qtscript.index \
7 /usr/share/qt5/doc/qtmultimedia/qtmultimedia.index \
8 /usr/share/doc/unity-action/qml/unity-action-qml-api.index \
9
010
=== renamed file 'documentation/ubuntu-ui-toolkit-online-indexes.qdocconf' => 'documentation/ubuntu-ui-toolkit-offline-indexes.qdocconf'
--- documentation/ubuntu-ui-toolkit-online-indexes.qdocconf 2013-12-09 11:33:51 +0000
+++ documentation/ubuntu-ui-toolkit-offline-indexes.qdocconf 2016-08-14 09:05:30 +0000
@@ -1,11 +1,2 @@
1include(ubuntu-ui-toolkit-online.qdocconf)1include(ubuntu-ui-toolkit-offline.qdocconf)
22include(ubuntu-ui-toolkit-indexes.qdocconf)
3indexes = \
4 /usr/share/qt5/doc/qtqml/qtqml.index \
5 /usr/share/qt5/doc/qtquick/qtquick.index \
6 /usr/share/qt5/doc/qtwebkit/qtwebkit.index \
7 /usr/share/qt5/doc/qtsvg/qtsvg.index \
8 /usr/share/qt5/doc/qtscript/qtscript.index \
9 /usr/share/qt5/doc/qtmultimedia/qtmultimedia.index \
10 /usr/share/doc/unity-action/qml/unity-action-qml-api.index \
11
123
=== added file 'documentation/ubuntu-ui-toolkit-online-indexes.qdocconf'
--- documentation/ubuntu-ui-toolkit-online-indexes.qdocconf 1970-01-01 00:00:00 +0000
+++ documentation/ubuntu-ui-toolkit-online-indexes.qdocconf 2016-08-14 09:05:30 +0000
@@ -0,0 +1,2 @@
1include(ubuntu-ui-toolkit-online.qdocconf)
2include(ubuntu-ui-toolkit-indexes.qdocconf)
03
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Buttons.qml'
--- examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2016-02-12 10:55:51 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2016-08-14 09:05:30 +0000
@@ -110,8 +110,8 @@
110 width: parent.width < units.gu(30)? parent.width : units.gu(30)110 width: parent.width < units.gu(30)? parent.width : units.gu(30)
111 comboList: UbuntuListView {111 comboList: UbuntuListView {
112 model: 10112 model: 10
113 delegate: Standard {113 delegate: ListItemWithLabel {
114 text: "item #" + modelData114 title.text: "item #" + modelData
115 }115 }
116 }116 }
117 }117 }
@@ -125,8 +125,8 @@
125 width: parent.width < units.gu(30)? parent.width : units.gu(30)125 width: parent.width < units.gu(30)? parent.width : units.gu(30)
126 comboList: UbuntuListView {126 comboList: UbuntuListView {
127 model: 10127 model: 10
128 delegate: Standard {128 delegate: ListItemWithLabel {
129 text: "item #" + modelData129 title.text: "item #" + modelData
130 }130 }
131 }131 }
132 }132 }
@@ -141,8 +141,8 @@
141 width: parent.width < units.gu(30)? parent.width : units.gu(30)141 width: parent.width < units.gu(30)? parent.width : units.gu(30)
142 comboList: UbuntuListView {142 comboList: UbuntuListView {
143 model: 10143 model: 10
144 delegate: Standard {144 delegate: ListItemWithLabel {
145 text: "item #" + modelData145 title.text: "item #" + modelData
146 }146 }
147 }147 }
148 }148 }
@@ -157,8 +157,8 @@
157 width: parent.width < units.gu(30)? parent.width : units.gu(30)157 width: parent.width < units.gu(30)? parent.width : units.gu(30)
158 comboList: UbuntuListView {158 comboList: UbuntuListView {
159 model: 10159 model: 10
160 delegate: Standard {160 delegate: ListItemWithLabel {
161 text: "item #" + modelData161 title.text: "item #" + modelData
162 }162 }
163 }163 }
164 }164 }
165165
=== modified file 'src/Ubuntu/Components/1.3/ComboButton.qml'
--- src/Ubuntu/Components/1.3/ComboButton.qml 2016-05-25 12:48:10 +0000
+++ src/Ubuntu/Components/1.3/ComboButton.qml 2016-08-14 09:05:30 +0000
@@ -331,6 +331,19 @@
331 onClicked: {331 onClicked: {
332 // toggle expanded332 // toggle expanded
333 combo.expanded = !combo.expanded;333 combo.expanded = !combo.expanded;
334 combo.forceActiveFocus()
335 }
336 }
337
338 Keys.onReleased: {
339 if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
340 // Enter or Return should trigger, not expand
341 event.accepted = true;
342 combo.trigger();
343 } else if (event.key == Qt.Key_Space) {
344 // Space should expand, not trigger
345 event.accepted = true;
346 combo.expanded = !combo.expanded;
334 }347 }
335 }348 }
336349
337350
=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
--- src/Ubuntu/Components/1.3/PageHeader.qml 2016-06-14 14:37:54 +0000
+++ src/Ubuntu/Components/1.3/PageHeader.qml 2016-08-14 09:05:30 +0000
@@ -181,7 +181,9 @@
181 actions: header.navigationActions181 actions: header.navigationActions
182 visible: leading.width > 0 // at least 1 visible action182 visible: leading.width > 0 // at least 1 visible action
183 StyleHints {183 StyleHints {
184 ignoreUnknownProperties: false
184 overflowIconName: "navigation-menu"185 overflowIconName: "navigation-menu"
186 backgroundColor: header.__styleInstance.backgroundColor
185 }187 }
186 }188 }
187189
@@ -227,6 +229,10 @@
227 numberOfSlots: MathUtils.clamp(0.3*header.width/units.gu(4), 3, 6)229 numberOfSlots: MathUtils.clamp(0.3*header.width/units.gu(4), 3, 6)
228 delegate: header.__styleInstance.defaultActionDelegate230 delegate: header.__styleInstance.defaultActionDelegate
229 visible: trailing.width > 0 // at least 1 visible action231 visible: trailing.width > 0 // at least 1 visible action
232 StyleHints {
233 ignoreUnknownProperties: false
234 backgroundColor: header.__styleInstance.backgroundColor
235 }
230 }236 }
231237
232 /*!238 /*!
233239
=== modified file 'src/Ubuntu/Components/1.3/Scrollbar.qml'
--- src/Ubuntu/Components/1.3/Scrollbar.qml 2016-05-25 12:48:10 +0000
+++ src/Ubuntu/Components/1.3/Scrollbar.qml 2016-08-14 09:05:30 +0000
@@ -16,6 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.3 as Toolkit18import Ubuntu.Components 1.3 as Toolkit
19import Ubuntu.Components.Private 1.3 as Private
1920
20/*!21/*!
21 \qmltype Scrollbar22 \qmltype Scrollbar
@@ -141,14 +142,6 @@
141 */142 */
142 property bool __interactive: __styleInstance !== null && __styleInstance.interactive143 property bool __interactive: __styleInstance !== null && __styleInstance.interactive
143144
144
145 /*!
146 \internal
147 This trough of the scrollbar, it is used to define the position of the slider.
148 */
149 property Item __trough: __styleInstance !== null && __styleInstance.trough
150
151
152 /*!145 /*!
153 \internal146 \internal
154 simulate the system setting (which will be implemented in unity8, I guess)147 simulate the system setting (which will be implemented in unity8, I guess)
@@ -167,27 +160,28 @@
167 //Disable the input handling to let the events pass through in case we have an160 //Disable the input handling to let the events pass through in case we have an
168 //interactive scrollbar right below us (can happen with nested views)161 //interactive scrollbar right below us (can happen with nested views)
169 enabled: __interactive//&& __alwaysOnScrollbars162 enabled: __interactive//&& __alwaysOnScrollbars
163 visible: __initializedFlickable !== null
170164
171 implicitWidth: internals.vertical ? units.gu(3) : (flickableItem ? flickableItem.width : 0)165 implicitWidth: internals.vertical ? units.gu(3) : (__initializedFlickable ? __initializedFlickable.width : 0)
172 implicitHeight: !internals.vertical ? units.gu(3) : (flickableItem ? flickableItem.height : 0)166 implicitHeight: !internals.vertical ? units.gu(3) : (__initializedFlickable ? __initializedFlickable.height : 0)
173167
174 anchors {168 anchors {
175 left: (__viewport || flickableItem)169 left: (__viewport || __initializedFlickable)
176 ? internals.leftAnchor(__viewport ? __viewport : flickableItem)170 ? internals.leftAnchor(__viewport ? __viewport : __initializedFlickable)
177 : undefined171 : undefined
178 leftMargin: internals.leftAnchorMargin()172 leftMargin: internals.leftAnchorMargin()
179 right: (__viewport || flickableItem)173 right: (__viewport || __initializedFlickable)
180 ? internals.rightAnchor(__viewport ? __viewport : flickableItem)174 ? internals.rightAnchor(__viewport ? __viewport : __initializedFlickable)
181 : undefined175 : undefined
182 rightMargin: internals.rightAnchorMargin()176 rightMargin: internals.rightAnchorMargin()
183 top: (__viewport || flickableItem)177 top: (__viewport || __initializedFlickable)
184 ? internals.topAnchor(__viewport ? __viewport : flickableItem)178 ? internals.topAnchor(__viewport ? __viewport : __initializedFlickable)
185 : undefined179 : undefined
186 topMargin: (flickableItem ? flickableItem.topMargin : 0) + internals.topAnchorMargin()180 topMargin: (__initializedFlickable ? __initializedFlickable.topMargin : 0) + internals.topAnchorMargin()
187 bottom: (__viewport || flickableItem)181 bottom: (__viewport || __initializedFlickable)
188 ? internals.bottomAnchor(__viewport ? __viewport : flickableItem)182 ? internals.bottomAnchor(__viewport ? __viewport : __initializedFlickable)
189 : undefined183 : undefined
190 bottomMargin: (flickableItem ? flickableItem.bottomMargin : 0) + internals.bottomAnchorMargin()184 bottomMargin: (__initializedFlickable ? __initializedFlickable.bottomMargin : 0) + internals.bottomAnchorMargin()
191 }185 }
192186
193 /*!187 /*!
@@ -195,6 +189,26 @@
195 */189 */
196 onAlignChanged: if (!internals.checkAlign()) console.log("Wrong alignment set to Scrollbar: "+align)190 onAlignChanged: if (!internals.checkAlign()) console.log("Wrong alignment set to Scrollbar: "+align)
197191
192 //Don't do anything with flickableItem until its creation is complete, it would be a waste of cpu cycles
193 //and it would block the rendering thread for much longer
194 property var __initializedFlickable: null
195 Connections {
196 target: flickableItem
197 Component.onCompleted: __initializedFlickable = flickableItem
198 }
199 onFlickableItemChanged: {
200 if (!flickableItem) __initializedFlickable = null
201 else {
202 //can't use a binding for this, because the "completeness" of a component is
203 //not esposed to QML, QML just gets Component.onCompleted when a component is
204 //completed, but you won't get that if we're assigned a Flickable which is
205 //already "complete"
206 if (Private.PrivateScrollbarUtils.isComponentComplete(flickableItem)) {
207 __initializedFlickable = flickableItem
208 }
209 }
210 }
211
198 /*!212 /*!
199 \internal213 \internal
200 Internals: contains the common logic of the scrollbar like anchoring,214 Internals: contains the common logic of the scrollbar like anchoring,
@@ -204,7 +218,7 @@
204 QtObject {218 QtObject {
205 id: internals219 id: internals
206 property bool vertical: (align === Qt.AlignLeading) || (align === Qt.AlignTrailing)220 property bool vertical: (align === Qt.AlignLeading) || (align === Qt.AlignTrailing)
207 property bool scrollable: flickableItem && flickableItem.interactive && checkAlign()221 property bool scrollable: __initializedFlickable && __initializedFlickable.interactive && checkAlign()
208 property real nonOverlayScrollbarMargin: __styleInstance ? __styleInstance.nonOverlayScrollbarMargin : 0222 property real nonOverlayScrollbarMargin: __styleInstance ? __styleInstance.nonOverlayScrollbarMargin : 0
209223
210 function checkAlign()224 function checkAlign()
211225
=== modified file 'src/Ubuntu/Components/Popups/1.3/ActionSelectionPopover.qml'
--- src/Ubuntu/Components/Popups/1.3/ActionSelectionPopover.qml 2015-08-18 16:28:26 +0000
+++ src/Ubuntu/Components/Popups/1.3/ActionSelectionPopover.qml 2016-08-14 09:05:30 +0000
@@ -120,6 +120,8 @@
120 }120 }
121 /*! \internal */121 /*! \internal */
122 onTriggered: popover.hide()122 onTriggered: popover.hide()
123 // FIXME: Disabled actions should be visible, but greyed-out.
124 // See bug 1612579. Tests will also need to be updated.
123 visible: enabled && ((action === undefined) || action.visible)125 visible: enabled && ((action === undefined) || action.visible)
124 height: visible ? implicitHeight : 0126 height: visible ? implicitHeight : 0
125 }127 }
126128
=== modified file 'src/Ubuntu/Components/Styles/1.3/ActionBarStyle.qml'
--- src/Ubuntu/Components/Styles/1.3/ActionBarStyle.qml 2015-10-15 14:17:25 +0000
+++ src/Ubuntu/Components/Styles/1.3/ActionBarStyle.qml 2016-08-14 09:05:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -17,7 +17,7 @@
1717
18/*!18/*!
19 \qmltype ActionBarStyle19 \qmltype ActionBarStyle
20 \inqmlmodule Ubuntu.Components.Styles 1.120 \inqmlmodule Ubuntu.Components.Styles 1.3
21 \ingroup style-api21 \ingroup style-api
22 \brief Style API for action bar.22 \brief Style API for action bar.
2323
@@ -25,6 +25,16 @@
25 */25 */
26Item {26Item {
27 /*!27 /*!
28 The color of the background of the action bar.
29 */
30 property color backgroundColor
31
32 /*!
33 Configuration of the colors of the action buttons in the action bar.
34 */
35 readonly property ActionItemProperties buttons: ActionItemProperties { }
36
37 /*!
28 The default action delegate if the styled item does38 The default action delegate if the styled item does
29 not provide a different delegate.39 not provide a different delegate.
30 */40 */
3141
=== added file 'src/Ubuntu/Components/Styles/1.3/ActionItemProperties.qml'
--- src/Ubuntu/Components/Styles/1.3/ActionItemProperties.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Styles/1.3/ActionItemProperties.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,56 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16import QtQuick 2.4
17
18/*!
19 \qmltype ButtonProperties
20 \inqmlmodule Ubuntu.Components.Styles 1.3
21 \ingroup style-api
22 \brief Color properties for buttons.
23
24 Defines the colors of buttons.
25 */
26QtObject {
27 /*!
28 The foreground color of an unpressed enabled button.
29 */
30 property color foregroundColor
31
32 /*!
33 The foreground color of a disabled button.
34 */
35 property color disabledForegroundColor
36
37 /*!
38 The foreground color of a button when being pressed.
39 */
40 property color pressedForegroundColor
41
42 /*!
43 The background color of an unpressed enabled button.
44 */
45 property color backgroundColor
46
47 /*!
48 The background color of a disabled button.
49 */
50 property color disabledBackgroundColor
51
52 /*!
53 The background color of a button when being pressed.
54 */
55 property color pressedBackgroundColor
56}
057
=== modified file 'src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml'
--- src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml 2016-03-30 15:12:36 +0000
+++ src/Ubuntu/Components/Styles/1.3/PageHeaderStyle.qml 2016-08-14 09:05:30 +0000
@@ -30,7 +30,9 @@
30 property color foregroundColor30 property color foregroundColor
3131
32 /*!32 /*!
33 \deprecated
33 The color of disabled action buttons in the header.34 The color of disabled action buttons in the header.
35 Replaced by buttons.disabledForegroundColor.
34 */36 */
35 property color disabledForegroundColor37 property color disabledForegroundColor
3638
@@ -45,6 +47,11 @@
45 property color backgroundColor47 property color backgroundColor
4648
47 /*!49 /*!
50 Configuration of the colors of the action buttons in the header.
51 */
52 readonly property ActionItemProperties buttons: ActionItemProperties { }
53
54 /*!
48 The color of the divider at the bottom of the header.55 The color of the divider at the bottom of the header.
49 */56 */
50 property color dividerColor57 property color dividerColor
5158
=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
--- src/Ubuntu/Components/Styles/Styles.pro 2016-06-23 09:13:51 +0000
+++ src/Ubuntu/Components/Styles/Styles.pro 2016-08-14 09:05:30 +0000
@@ -13,6 +13,7 @@
13 1.3/PageHeaderStyle.qml \13 1.3/PageHeaderStyle.qml \
14 1.3/ToolbarStyle.qml \14 1.3/ToolbarStyle.qml \
15 1.3/SectionsStyle.qml \15 1.3/SectionsStyle.qml \
16 1.3/ActionItemProperties.qml \
1617
17load(ubuntu_qml_plugin)18load(ubuntu_qml_plugin)
1819
1920
=== modified file 'src/Ubuntu/Components/Styles/qmldir'
--- src/Ubuntu/Components/Styles/qmldir 2016-06-23 09:13:51 +0000
+++ src/Ubuntu/Components/Styles/qmldir 2016-08-14 09:05:30 +0000
@@ -12,3 +12,4 @@
12PageHeaderStyle 1.3 1.3/PageHeaderStyle.qml12PageHeaderStyle 1.3 1.3/PageHeaderStyle.qml
13ToolbarStyle 1.3 1.3/ToolbarStyle.qml13ToolbarStyle 1.3 1.3/ToolbarStyle.qml
14SectionsStyle 1.3 1.3/SectionsStyle.qml14SectionsStyle 1.3 1.3/SectionsStyle.qml
15ActionItemProperties 1.3 1.3/ActionItemProperties.qml
1516
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2015-12-09 21:41:45 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ActionBarStyle.qml 2016-08-14 09:05:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -28,19 +28,49 @@
28 // Unused with the standard action icon buttons, but may be used with a custom delegate.28 // Unused with the standard action icon buttons, but may be used with a custom delegate.
29 overflowText: "More"29 overflowText: "More"
3030
31 backgroundColor: theme.palette.normal.background
32 buttons {
33 foregroundColor: theme.palette.normal.backgroundText
34 pressedForegroundColor: buttons.foregroundColor
35 disabledForegroundColor: theme.palette.disabled.backgroundText
36 backgroundColor: "transparent" // action bar background is already colored
37 pressedBackgroundColor: theme.palette.highlighted.background
38 disabledBackgroundColor: buttons.backgroundColor
39 }
40
31 /*!41 /*!
32 The default action delegate if the styled item does42 The default action delegate if the styled item does
33 not provide a delegate.43 not provide a delegate.
34 */44 */
35 defaultDelegate: AbstractButton {45 defaultDelegate: Component {
36 style: IconButtonStyle { }46 AbstractButton {
37 objectName: action.objectName + "_button"47 id: button
38 height: parent ? parent.height : undefined48 style: IconButtonStyle {
39 action: modelData49 foregroundColor: button.pressed ?
50 actionBarStyle.buttons.pressedForegroundColor :
51 button.enabled ?
52 actionBarStyle.buttons.foregroundColor :
53 actionBarStyle.buttons.disabledForegroundColor
54 backgroundColor: button.pressed ?
55 actionBarStyle.buttons.pressedBackgroundColor :
56 button.enabled ?
57 actionBarStyle.buttons.backgroundColor :
58 actionBarStyle.buttons.disabledBackgroundColor
59 }
60 objectName: action.objectName + "_button"
61 height: parent ? parent.height : undefined
62 action: modelData
63 }
40 }64 }
4165
42 defaultNumberOfSlots: 366 defaultNumberOfSlots: 3
4367
68 Rectangle {
69 id: background
70 anchors.fill: parent
71 color: actionBarStyle.backgroundColor
72 }
73
44 Component {74 Component {
45 id: fadeInComponent75 id: fadeInComponent
46 SequentialAnimation {76 SequentialAnimation {
4777
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml 2016-02-09 15:56:48 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml 2016-08-14 09:05:30 +0000
@@ -237,6 +237,9 @@
237 }237 }
238 }238 }
239 }239 }
240
241 FocusShape {
242 }
240 }243 }
241244
242 Item {245 Item {
@@ -247,7 +250,8 @@
247 top: mainButton.bottom250 top: mainButton.bottom
248 right: parent.right251 right: parent.right
249 }252 }
250 opacity: styledItem.expanded && (styledItem.comboList.length > 0)? 1.0 : 0.0253 // Hide panel to suppress keyboard input including (Shift)Tab
254 visible: styledItem.expanded && (styledItem.comboList.length > 0)
251255
252 ShaderEffectSource {256 ShaderEffectSource {
253 id: listContent257 id: listContent
254258
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-04-27 07:31:49 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-08-14 09:05:30 +0000
@@ -26,7 +26,7 @@
26 color: styledItem.enabled26 color: styledItem.enabled
27 ? theme.palette.normal.focus27 ? theme.palette.normal.focus
28 : theme.palette.disabled.focus28 : theme.palette.disabled.focus
29 thickness: units.dp(1)29 thickness: units.dp(2)
30 radius: units.gu(1.7)30 radius: units.gu(1.7)
31 visible: styledItem.keyNavigationFocus31 visible: styledItem.keyNavigationFocus
3232
3333
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-06-14 14:37:54 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-08-14 09:05:30 +0000
@@ -26,6 +26,14 @@
26 subtitleColor: theme.palette.normal.backgroundTertiaryText26 subtitleColor: theme.palette.normal.backgroundTertiaryText
27 backgroundColor: theme.palette.normal.background27 backgroundColor: theme.palette.normal.background
28 dividerColor: theme.palette.normal.base28 dividerColor: theme.palette.normal.base
29 buttons {
30 foregroundColor: pageHeaderStyle.foregroundColor
31 disabledForegroundColor: pageHeaderStyle.disabledForegroundColor
32 pressedForegroundColor: buttons.foregroundColor
33 backgroundColor: "transparent"
34 pressedBackgroundColor: theme.palette.highlighted.background
35 disabledBackgroundColor: buttons.backgroundColor
36 }
2937
30 // Font weight for the title and subtitle38 // Font weight for the title and subtitle
31 property int fontWeight: Font.Light39 property int fontWeight: Font.Light
@@ -84,13 +92,22 @@
84 }92 }
8593
86 defaultActionDelegate: AbstractButton {94 defaultActionDelegate: AbstractButton {
95 id: button
87 style: IconButtonStyle { }96 style: IconButtonStyle { }
88 objectName: action.objectName + "_button"97 objectName: action.objectName + "_button"
89 height: internal.titleAreaHeight98 height: internal.titleAreaHeight
90 action: modelData99 action: modelData
91 StyleHints {100 StyleHints {
92 foregroundColor: enabled ? pageHeaderStyle.foregroundColor101 foregroundColor: button.pressed ?
93 : pageHeaderStyle.disabledForegroundColor102 pageHeaderStyle.buttons.pressedForegroundColor :
103 button.enabled ?
104 pageHeaderStyle.buttons.foregroundColor :
105 pageHeaderStyle.buttons.disabledForegroundColor
106 backgroundColor: button.pressed ?
107 pageHeaderStyle.buttons.pressedBackgroundColor :
108 button.enabled ?
109 pageHeaderStyle.buttons.backgroundColor :
110 pageHeaderStyle.buttons.disabledBackgroundColor
94 }111 }
95 }112 }
96113
97114
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2016-06-30 15:19:36 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2016-08-14 09:05:30 +0000
@@ -114,7 +114,7 @@
114 * HELPER PROPERTIES *114 * HELPER PROPERTIES *
115 *****************************************************/115 *****************************************************/
116 property alias thumb: slider116 property alias thumb: slider
117 property Item trough: trough117 property alias trough: trough
118118
119 //helper properties to ease code readability119 //helper properties to ease code readability
120 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.0120 property bool isScrollable: styledItem.__private.scrollable && pageSize > 0.0
@@ -126,7 +126,8 @@
126 property bool bottomAligned: (styledItem.align === Qt.AlignBottom)126 property bool bottomAligned: (styledItem.align === Qt.AlignBottom)
127127
128 //flickable helper properties128 //flickable helper properties
129 property Flickable flickableItem: styledItem.flickableItem129 //Don't do anything with the flickable until its Component.onCompleted is called, it's a waste of cycles
130 property Flickable flickableItem: styledItem.__initializedFlickable
130 property real pageSize: flickableItem131 property real pageSize: flickableItem
131 ? (isVertical ? flickableItem.height : flickableItem.width)132 ? (isVertical ? flickableItem.height : flickableItem.width)
132 : 0133 : 0
@@ -233,14 +234,18 @@
233 scrollAnimation.restart()234 scrollAnimation.restart()
234 } else {235 } else {
235 if (scrollAnimation.running) scrollAnimation.stop()236 if (scrollAnimation.running) scrollAnimation.stop()
236 styledItem.flickableItem[scrollbarUtils.propContent] = value237 if (flickableItem) {
237 styledItem.flickableItem.returnToBounds()238 flickableItem[scrollbarUtils.propContent] = value
239 flickableItem.returnToBounds()
240 }
238 }241 }
239 }242 }
240 function scrollToBeginning(animate) {243 function scrollToBeginning(animate) {
244 if (!flickableItem) return
241 scrollTo(flickableItem[scrollbarUtils.propOrigin] - visuals.leadingContentMargin, animate)245 scrollTo(flickableItem[scrollbarUtils.propOrigin] - visuals.leadingContentMargin, animate)
242 }246 }
243 function scrollToEnd(animate) {247 function scrollToEnd(animate) {
248 if (!flickableItem) return
244 scrollTo((flickableItem[scrollbarUtils.propOrigin]249 scrollTo((flickableItem[scrollbarUtils.propOrigin]
245 + totalContentSize - visuals.leadingContentMargin - pageSize), animate)250 + totalContentSize - visuals.leadingContentMargin - pageSize), animate)
246 }251 }
@@ -319,12 +324,14 @@
319 Calculates the slider position based on the visible area's ratios.324 Calculates the slider position based on the visible area's ratios.
320 */325 */
321 function sliderPos(scrollbar, min, max) {326 function sliderPos(scrollbar, min, max) {
327 if (!scrollbar.__initializedFlickable) return min
328
322 //the margin between the trough and the thumb min and max values329 //the margin between the trough and the thumb min and max values
323 var margin = scrollbar.__styleInstance.thumbsExtremesMargin330 var margin = scrollbar.__styleInstance.thumbsExtremesMargin
324331
325 //The total length of the path where the thumb can be positioned, from its min to its max value332 //The total length of the path where the thumb can be positioned, from its min to its max value
326 var draggableLength = scrollbar.__trough[propSize] - margin*2333 var draggableLength = visuals.trough[propSize] - margin*2
327 var maxPosRatio = 1.0 - (scrollbar.flickableItem ? scrollbar.flickableItem.visibleArea[propSizeRatio] : 1.0)334 var maxPosRatio = 1.0 - (scrollbar.__initializedFlickable ? scrollbar.__initializedFlickable.visibleArea[propSizeRatio] : 1.0)
328335
329 //Example with x/width, same applies to y/height336 //Example with x/width, same applies to y/height
330 //xPosition is in the range [0...1 - widthRatio]337 //xPosition is in the range [0...1 - widthRatio]
@@ -335,7 +342,7 @@
335 //the maxPosition is reached when xPosition becomes 1, and that never happens. To compensate that, we342 //the maxPosition is reached when xPosition becomes 1, and that never happens. To compensate that, we
336 //scale xPosition by ( 1 / ( 1 - widthRatio) ). This way, when xPosition reaches its max ( 1 - widthRatio )343 //scale xPosition by ( 1 / ( 1 - widthRatio) ). This way, when xPosition reaches its max ( 1 - widthRatio )
337 //we get a multiplication factor of 1344 //we get a multiplication factor of 1
338 return MathUtils.clamp(1.0 / maxPosRatio * (scrollbar.flickableItem ? scrollbar.flickableItem.visibleArea[propPosRatio] : 1.0)345 return MathUtils.clamp(1.0 / maxPosRatio * (scrollbar.__initializedFlickable ? scrollbar.__initializedFlickable.visibleArea[propPosRatio] : 1.0)
339 * (draggableLength - scrollbar.__styleInstance.thumb[propSize]) + margin, min, max);346 * (draggableLength - scrollbar.__styleInstance.thumb[propSize]) + margin, min, max);
340 }347 }
341348
@@ -349,8 +356,10 @@
349 THUMB CAN MOVE INTO! (which is what you want in 99.9% of the cases, for a scrollbar)356 THUMB CAN MOVE INTO! (which is what you want in 99.9% of the cases, for a scrollbar)
350 */357 */
351 function sliderSize(scrollbar, min, max) {358 function sliderSize(scrollbar, min, max) {
352 var sizeRatio = scrollbar.flickableItem ? scrollbar.flickableItem.visibleArea[propSizeRatio] : 1.0;359 if (!scrollbar.__initializedFlickable) return min
353 var posRatio = scrollbar.flickableItem ? scrollbar.flickableItem.visibleArea[propPosRatio] : 0.0;360
361 var sizeRatio = scrollbar.__initializedFlickable ? scrollbar.__initializedFlickable.visibleArea[propSizeRatio] : 1.0;
362 var posRatio = scrollbar.__initializedFlickable ? scrollbar.__initializedFlickable.visibleArea[propPosRatio] : 0.0;
354363
355 //(sizeRatio * max) is the current ideal size, as recommended by Flickable visibleArea props364 //(sizeRatio * max) is the current ideal size, as recommended by Flickable visibleArea props
356 var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0365 var sizeUnderflow = (sizeRatio * max) < min ? min - (sizeRatio * max) : 0
@@ -385,9 +394,11 @@
385 using an invisible cursor to drag the slider and the ListView position.394 using an invisible cursor to drag the slider and the ListView position.
386 */395 */
387 function scrollAndClamp(scrollbar, amount, min, max) {396 function scrollAndClamp(scrollbar, amount, min, max) {
388 return scrollbar.flickableItem[propOrigin] +397 if (!scrollbar.__initializedFlickable) return
389 MathUtils.clamp(scrollbar.flickableItem[propContent]398
390 - scrollbar.flickableItem[propOrigin] + amount,399 return scrollbar.__initializedFlickable[propOrigin] +
400 MathUtils.clamp(scrollbar.__initializedFlickable[propContent]
401 - scrollbar.__initializedFlickable[propOrigin] + amount,
391 min, max);402 min, max);
392 }403 }
393404
@@ -402,8 +413,10 @@
402 NOTE: when flickable.topMargin is 5GU, contentY has to be -5GU (not 0!) to be at the top of the scrollable!!413 NOTE: when flickable.topMargin is 5GU, contentY has to be -5GU (not 0!) to be at the top of the scrollable!!
403 */414 */
404 function dragAndClamp(scrollbar, relThumbPosition, contentSize, pageSize) {415 function dragAndClamp(scrollbar, relThumbPosition, contentSize, pageSize) {
405 scrollbar.flickableItem[propContent] =416 if (!scrollbar.__initializedFlickable) return
406 scrollbar.flickableItem[propOrigin] + relThumbPosition * (contentSize - scrollbar.flickableItem[propSize]) - leadingContentMargin; //don't use pageSize, we don't know if the scrollbar is edge to edge!;417
418 scrollbar.__initializedFlickable[propContent] =
419 scrollbar.__initializedFlickable[propOrigin] + relThumbPosition * (contentSize - scrollbar.__initializedFlickable[propSize]) - leadingContentMargin; //don't use pageSize, we don't know if the scrollbar is edge to edge!;
407 }420 }
408 }421 }
409422
@@ -424,7 +437,7 @@
424 //duration and easing coming from UX spec437 //duration and easing coming from UX spec
425 duration: UbuntuAnimation.SlowDuration438 duration: UbuntuAnimation.SlowDuration
426 easing.type: Easing.InOutCubic439 easing.type: Easing.InOutCubic
427 target: styledItem.flickableItem440 target: flickableItem
428 property: scrollbarUtils.propContent441 property: scrollbarUtils.propContent
429 //when the listview has variable size delegates the contentHeight estimation done by ListView442 //when the listview has variable size delegates the contentHeight estimation done by ListView
430 //could make us overshoot, especially when going from top to bottom of the list or viceversa.443 //could make us overshoot, especially when going from top to bottom of the list or viceversa.
@@ -748,7 +761,7 @@
748 pressHoldTimer.stop()761 pressHoldTimer.stop()
749 }762 }
750 onReleased: {763 onReleased: {
751 hoveringThumb = false764 handleHover(mouseX, mouseY)
752 resetDrag()765 resetDrag()
753 pressHoldTimer.stop()766 pressHoldTimer.stop()
754 }767 }
@@ -939,7 +952,9 @@
939 anchors.centerIn: parent952 anchors.centerIn: parent
940 width: __stepperAssetWidth953 width: __stepperAssetWidth
941 rotation: isVertical ? 180 : 90954 rotation: isVertical ? 180 : 90
942 source: visible ? Qt.resolvedUrl("../artwork/toolkit_scrollbar-stepper.svg") : ""955 //NOTE: Qt.resolvedUrl was removed because it does not seem to be needed and
956 //the QML profiler showed it's relatively expensive
957 source: visible ? "../artwork/toolkit_scrollbar-stepper.svg" : ""
943 asynchronous: true958 asynchronous: true
944 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,959 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,
945 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtBeginning])960 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtBeginning])
@@ -983,7 +998,9 @@
983 anchors.centerIn: parent998 anchors.centerIn: parent
984 width: __stepperAssetWidth999 width: __stepperAssetWidth
985 rotation: isVertical ? 0 : -901000 rotation: isVertical ? 0 : -90
986 source: visible ? Qt.resolvedUrl("../artwork/toolkit_scrollbar-stepper.svg") : ""1001 //NOTE: Qt.resolvedUrl was removed because it does not seem to be needed and
1002 //the QML profiler showed it's relatively expensive
1003 source: visible ? "../artwork/toolkit_scrollbar-stepper.svg" : ""
987 asynchronous: true1004 asynchronous: true
988 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,1005 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,
989 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtEnd])1006 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtEnd])
@@ -999,6 +1016,9 @@
999 //just a hack: a rectangle which covers the corner where scrollbars meet, when they're in steppers style1016 //just a hack: a rectangle which covers the corner where scrollbars meet, when they're in steppers style
1000 Rectangle {1017 Rectangle {
1001 id: cornerRect1018 id: cornerRect
1019 //NOTE: I tried grouping styledItem.__buddyScrollbar && styledItem.__buddyScrollbar.__styleInstance
1020 // && styledItem.__buddyScrollbar.__styleInstance.isScrollable in 1 property and use that for
1021 //all the anchors, but it turned out it makes the instantiation 2-3% slower!!!
1002 anchors.left: {1022 anchors.left: {
1003 if (styledItem.__buddyScrollbar && styledItem.__buddyScrollbar.__styleInstance1023 if (styledItem.__buddyScrollbar && styledItem.__buddyScrollbar.__styleInstance
1004 && styledItem.__buddyScrollbar.__styleInstance.isScrollable) {1024 && styledItem.__buddyScrollbar.__styleInstance.isScrollable) {
10051025
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-06-13 15:57:20 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-08-14 09:05:30 +0000
@@ -287,6 +287,7 @@
287 width: units.gu(1)287 width: units.gu(1)
288 height: units.gu(1)288 height: units.gu(1)
289 visible: false289 visible: false
290 asynchronous: true
290 rotation: 180291 rotation: 180
291 opacity: visible292 opacity: visible
292 ? sectionsListView.atXBeginning ? hoveringArea.iconsDisabledOpacity : 1.0293 ? sectionsListView.atXBeginning ? hoveringArea.iconsDisabledOpacity : 1.0
@@ -316,6 +317,7 @@
316 width: units.gu(1)317 width: units.gu(1)
317 height: units.gu(1)318 height: units.gu(1)
318 visible: false319 visible: false
320 asynchronous: true
319 opacity: visible321 opacity: visible
320 ? sectionsListView.atXEnd ? hoveringArea.iconsDisabledOpacity : 1.0322 ? sectionsListView.atXEnd ? hoveringArea.iconsDisabledOpacity : 1.0
321 : 0.0323 : 0.0
322324
=== modified file 'src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro'
--- src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro 2016-08-14 09:05:30 +0000
@@ -148,7 +148,8 @@
148 privates/ucpagewrapperincubator_p.h \148 privates/ucpagewrapperincubator_p.h \
149 privates/appheaderbase_p.h \149 privates/appheaderbase_p.h \
150 label_p.h \150 label_p.h \
151 ucbottomedgeregion_p_p.h151 ucbottomedgeregion_p_p.h \
152 privates/ucscrollbarutils_p.h
152153
153SOURCES += \154SOURCES += \
154 uctheme.cpp \155 uctheme.cpp \
@@ -224,7 +225,8 @@
224 privates/frame.cpp \225 privates/frame.cpp \
225 privates/ucpagewrapper.cpp \226 privates/ucpagewrapper.cpp \
226 privates/ucpagewrapperincubator.cpp \227 privates/ucpagewrapperincubator.cpp \
227 privates/appheaderbase.cpp228 privates/appheaderbase.cpp \
229 privates/ucscrollbarutils.cpp
228230
229# adapters231# adapters
230SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp232SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp
231233
=== modified file 'src/Ubuntu/UbuntuToolkit/privates/listviewextensions.cpp'
--- src/Ubuntu/UbuntuToolkit/privates/listviewextensions.cpp 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/privates/listviewextensions.cpp 2016-08-14 09:05:30 +0000
@@ -21,6 +21,7 @@
21#include "quickutils_p.h"21#include "quickutils_p.h"
22#include <QtQuick/QQuickItem>22#include <QtQuick/QQuickItem>
23#include <QtQuick/private/qquickflickable_p.h>23#include <QtQuick/private/qquickflickable_p.h>
24#include <QtQuick/private/qquickitemview_p.h> // for QQuickItemView::BottomToTop
2425
25UT_NAMESPACE_BEGIN26UT_NAMESPACE_BEGIN
2627
@@ -127,7 +128,7 @@
127 return false;128 return false;
128}129}
129130
130// override up/down key presses for ListView; returns true if the key event is consumed131// override cursor key presses for ListView; returns true if the key event is consumed
131// in which case ListView won't get it.132// in which case ListView won't get it.
132bool ListViewProxy::keyPressEvent(QKeyEvent *event)133bool ListViewProxy::keyPressEvent(QKeyEvent *event)
133{134{
@@ -138,9 +139,10 @@
138 || (orientation == Qt::Horizontal && key != Qt::Key_Left && key != Qt::Key_Right)) {139 || (orientation == Qt::Horizontal && key != Qt::Key_Left && key != Qt::Key_Right)) {
139 return false;140 return false;
140 }141 }
141 // for horizontal moves take into account the layout mirroring142 // effectiveLayoutDirection takes into account effectiveLayoutMirror and layoutDirection.
142 bool isRtl = QQuickItemPrivate::get(listView)->effectiveLayoutMirror;143 bool isRtl = (Qt::RightToLeft == listView->property("effectiveLayoutDirection").toInt());
143 bool forwards = (key == Qt::Key_Down || (isRtl ? key == Qt::Key_Left : key == Qt::Key_Right));144 bool isBtt = (QQuickItemView::BottomToTop == listView->property("verticalLayoutDirection").toInt());
145 bool forwards = (isBtt ? key == Qt::Key_Up : key == Qt::Key_Down) || (isRtl ? key == Qt::Key_Left : key == Qt::Key_Right);
144 int oldIndex = this->currentIndex();146 int oldIndex = this->currentIndex();
145 int currentIndex = this->currentIndex();147 int currentIndex = this->currentIndex();
146 int count = this->count();148 int count = this->count();
147149
=== modified file 'src/Ubuntu/UbuntuToolkit/privates/threelabelsslot_p.cpp'
--- src/Ubuntu/UbuntuToolkit/privates/threelabelsslot_p.cpp 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/privates/threelabelsslot_p.cpp 2016-08-14 09:05:30 +0000
@@ -44,6 +44,8 @@
44 //Using WrapAnywhere because ElideRight elides too early when used44 //Using WrapAnywhere because ElideRight elides too early when used
45 //together with WrapWord, and that produces an unexpected result.45 //together with WrapWord, and that produces an unexpected result.
46 //This will cover most of the usecases.46 //This will cover most of the usecases.
47 //NOTE: If you want to use ElideMiddle or ElideLeft you'll have to
48 //set wrapMode to NoWrap (see Text docs for more details)
47 m_title->setWrapMode(UCLabel::WrapAnywhere);49 m_title->setWrapMode(UCLabel::WrapAnywhere);
48 m_title->setElideMode(UCLabel::ElideRight);50 m_title->setElideMode(UCLabel::ElideRight);
49 m_title->setMaximumLineCount(1);51 m_title->setMaximumLineCount(1);
@@ -55,6 +57,8 @@
55{57{
56 if (m_subtitle != Q_NULLPTR) {58 if (m_subtitle != Q_NULLPTR) {
57 m_subtitle->setWrapMode(UCLabel::WrapAnywhere);59 m_subtitle->setWrapMode(UCLabel::WrapAnywhere);
60 //NOTE: If you want to use ElideMiddle or ElideLeft you'll have to
61 //set wrapMode to NoWrap (see Text docs for more details)
58 m_subtitle->setElideMode(UCLabel::ElideRight);62 m_subtitle->setElideMode(UCLabel::ElideRight);
59 m_subtitle->setMaximumLineCount(1);63 m_subtitle->setMaximumLineCount(1);
60 m_subtitle->setTextSize(UCLabel::Small);64 m_subtitle->setTextSize(UCLabel::Small);
@@ -65,6 +69,8 @@
65{69{
66 if (m_summary != Q_NULLPTR) {70 if (m_summary != Q_NULLPTR) {
67 m_summary->setWrapMode(UCLabel::WrapAnywhere);71 m_summary->setWrapMode(UCLabel::WrapAnywhere);
72 //NOTE: If you want to use ElideMiddle or ElideLeft you'll have to
73 //set wrapMode to NoWrap (see Text docs for more details)
68 m_summary->setElideMode(UCLabel::ElideRight);74 m_summary->setElideMode(UCLabel::ElideRight);
69 m_summary->setMaximumLineCount(2);75 m_summary->setMaximumLineCount(2);
70 m_summary->setTextSize(UCLabel::Small);76 m_summary->setTextSize(UCLabel::Small);
7177
=== modified file 'src/Ubuntu/UbuntuToolkit/privates/ucpagewrapper.cpp'
--- src/Ubuntu/UbuntuToolkit/privates/ucpagewrapper.cpp 2016-07-07 08:42:42 +0000
+++ src/Ubuntu/UbuntuToolkit/privates/ucpagewrapper.cpp 2016-08-14 09:05:30 +0000
@@ -208,8 +208,21 @@
208208
209 QQmlContext *context = m_itemContext ? m_itemContext : qmlContext(target);209 QQmlContext *context = m_itemContext ? m_itemContext : qmlContext(target);
210 for (;i != propMap.constEnd(); i++) {210 for (;i != propMap.constEnd(); i++) {
211 if (!QQmlProperty::write(target, i.key(), i.value(), context)) {211 QQmlProperty prop(target, i.key(), context);
212 qmlInfo(q) << "Could not assign value: "<<i.value()<<"to property: "<<i.key();212 bool convertible = true;
213 if (!qstrcmp(i.value().typeName(),"void*")) {
214 // we have void*, we cannot convert that one, so we must force the conversion
215 void *pvalue = i.value().value<void*>();
216 QVariant value(QVariant::Type(prop.propertyType()), pvalue);
217 convertible = value.isValid();
218 if (convertible) {
219 convertible = prop.write(value);
220 }
221 } else {
222 convertible = prop.write(i.value());
223 }
224 if (!convertible) {
225 qmlInfo(q) << "Could not assign value: " << i.value() << " to property: " << i.key();
213 }226 }
214 }227 }
215}228}
216229
=== added file 'src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils.cpp'
--- src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils.cpp 2016-08-14 09:05:30 +0000
@@ -0,0 +1,44 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Andrea Bernabei <andrea.bernabei@canonical.com>
17 */
18
19#include "ucscrollbarutils_p.h"
20#include <QtQuick/private/qquickitem_p.h>
21
22UT_NAMESPACE_BEGIN
23
24UCScrollbarUtils::UCScrollbarUtils(QObject *parent) : QObject(parent)
25{
26}
27
28bool UCScrollbarUtils::isComponentComplete(QQuickItem *item)
29{
30 if (item == Q_NULLPTR) {
31 qDebug() << "ScrollbarUtils: null Item parameter.";
32 return false;
33 } else {
34 QQuickItemPrivate *f = QQuickItemPrivate::get(item);
35 if (f == Q_NULLPTR) {
36 //don't fall apart, but give a warning
37 qDebug() << "ScrollbarUtils: failed to get item's pimpl.";
38 return false;
39 }
40 return f->componentComplete;
41 }
42}
43
44UT_NAMESPACE_END
045
=== added file 'src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils_p.h'
--- src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils_p.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/UbuntuToolkit/privates/ucscrollbarutils_p.h 2016-08-14 09:05:30 +0000
@@ -0,0 +1,41 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Andrea Bernabei <andrea.bernabei@canonical.com>
17 */
18
19#ifndef UCSCROLLBARUTILS_H
20#define UCSCROLLBARUTILS_H
21
22#include <QObject>
23#include <ubuntutoolkitglobal.h>
24
25class QQuickItem;
26
27UT_NAMESPACE_BEGIN
28
29class UBUNTUTOOLKIT_EXPORT UCScrollbarUtils : public QObject
30{
31 Q_OBJECT
32public:
33 explicit UCScrollbarUtils(QObject *parent = 0);
34
35 Q_INVOKABLE static bool isComponentComplete(QQuickItem *item);
36
37};
38
39UT_NAMESPACE_END
40
41#endif // UCSCROLLBARUTILS_H
042
=== modified file 'src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp'
--- src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp 2016-08-14 09:05:30 +0000
@@ -88,6 +88,7 @@
88#include <privates/frame_p.h>88#include <privates/frame_p.h>
89#include <privates/ucpagewrapper_p.h>89#include <privates/ucpagewrapper_p.h>
90#include <privates/appheaderbase_p.h>90#include <privates/appheaderbase_p.h>
91#include <privates/ucscrollbarutils_p.h>
9192
92// styles93// styles
93#include <ucbottomedgestyle_p.h>94#include <ucbottomedgestyle_p.h>
@@ -245,6 +246,9 @@
245 qmlRegisterType<UCAppHeaderBase>(privateUri, 1, 3, "AppHeaderBase");246 qmlRegisterType<UCAppHeaderBase>(privateUri, 1, 3, "AppHeaderBase");
246 qmlRegisterType<Tree>(privateUri, 1, 3, "Tree");247 qmlRegisterType<Tree>(privateUri, 1, 3, "Tree");
247248
249 //FIXME: move to a more generic location, i.e StyledItem or QuickUtils
250 qmlRegisterSimpleSingletonType<UCScrollbarUtils>(privateUri, 1, 3, "PrivateScrollbarUtils");
251
248 // allocate all context property objects prior we register them252 // allocate all context property objects prior we register them
249 initializeContextProperties(engine);253 initializeContextProperties(engine);
250254
251255
=== modified file 'src/Ubuntu/UbuntuToolkit/ucabstractbutton.cpp'
--- src/Ubuntu/UbuntuToolkit/ucabstractbutton.cpp 2016-07-07 08:42:42 +0000
+++ src/Ubuntu/UbuntuToolkit/ucabstractbutton.cpp 2016-08-14 09:05:30 +0000
@@ -35,12 +35,12 @@
35 , acceptEvents(true)35 , acceptEvents(true)
36 , pressAndHoldConnected(false)36 , pressAndHoldConnected(false)
37{37{
38 isFocusScope = false;
38}39}
39void UCAbstractButtonPrivate::init()40void UCAbstractButtonPrivate::init()
40{41{
41 Q_Q(UCAbstractButton);42 Q_Q(UCAbstractButton);
42 q->setActiveFocusOnPress(true);43 q->setActiveFocusOnPress(true);
43 q->setActiveFocusOnTab(true);
44}44}
4545
46/*!46/*!
4747
=== modified file 'src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp'
--- src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp 2016-07-07 08:42:42 +0000
+++ src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp 2016-08-14 09:05:30 +0000
@@ -382,7 +382,7 @@
382 d->url = url;382 d->url = url;
383 Q_EMIT contentChanged(d->url);383 Q_EMIT contentChanged(d->url);
384 // invoke loader if the preload is set384 // invoke loader if the preload is set
385 if (d->bottomEdge && (d->bottomEdge->preloadContent()) && !d->url.isValid()) {385 if (d->bottomEdge && (d->bottomEdge->preloadContent()) && d->url.isValid()) {
386 d->loadContent(UCBottomEdgeRegionPrivate::LoadingUrl);386 d->loadContent(UCBottomEdgeRegionPrivate::LoadingUrl);
387 }387 }
388}388}
389389
=== modified file 'src/Ubuntu/UbuntuToolkit/uclistitem.cpp'
--- src/Ubuntu/UbuntuToolkit/uclistitem.cpp 2016-07-07 08:42:42 +0000
+++ src/Ubuntu/UbuntuToolkit/uclistitem.cpp 2016-08-14 09:05:30 +0000
@@ -1127,7 +1127,7 @@
11271127
1128 // focus frame1128 // focus frame
1129 bool paintFocus = hasActiveFocus() && keyNavigationFocus();1129 bool paintFocus = hasActiveFocus() && keyNavigationFocus();
1130 rectNode->setPenWidth(paintFocus ? UCUnits::instance()->dp(1) : 0);1130 rectNode->setPenWidth(paintFocus ? UCUnits::instance()->dp(2) : 0);
1131 if (paintFocus) {1131 if (paintFocus) {
1132 QColor penColor;1132 QColor penColor;
1133 if (getTheme()) {1133 if (getTheme()) {
11341134
=== modified file 'src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp'
--- src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp 2016-08-14 09:05:30 +0000
@@ -40,6 +40,11 @@
40 ListItemLayout is essentially a \l {SlotsLayout} with a predefined40 ListItemLayout is essentially a \l {SlotsLayout} with a predefined
41 \l {SlotsLayout::mainSlot} that provides (up to) 3 Labels automatically laid out41 \l {SlotsLayout::mainSlot} that provides (up to) 3 Labels automatically laid out
42 according to our UI guidelines.42 according to our UI guidelines.
43
44 \b Note: those labels may have properties whose default value is different
45 from what is used by the standard Label component. The default wrapMode,
46 for instance, is different. Have a look at \l {Labels' properties} section.
47
43 This main slot has been optimized to cover most of the usecases48 This main slot has been optimized to cover most of the usecases
44 without compromising performance (read more in \l {Optimizing memory consumption}).49 without compromising performance (read more in \l {Optimizing memory consumption}).
4550
@@ -59,6 +64,28 @@
59 we made it possible to tweak the position of each slot by modifying64 we made it possible to tweak the position of each slot by modifying
60 its attached properties (see \l {Advanced layout tweaks}).65 its attached properties (see \l {Advanced layout tweaks}).
6166
67 \b Note that if you're wrapping the ListItemLayout in a container such
68 as \l {ListItem}, \b {you will have to specify the height of the container so that
69 it follows ListItemLayout's height}, otherwise the layout content may appear clipped or
70 not vertically centered.
71
72 See \b {\l {Resizing the layout} {here}} for more details. Here's an example:
73 \qml
74 import QtQuick 2.4
75 import Ubuntu.Component 1.3
76 ListItem {
77 //CORRECT, ListItem will be tall enough to accomodate all the content
78 height: layout.height + (divider.visible ? divider.height : 0)
79
80 ListItemLayout {
81 id: layout
82 title.text: "Hello developers!"
83 subtitle.text: "I am a ListItemLayout"
84 summary.text: "I resize automatically to accomodate all the elements I hold. My parents should track my height property!"
85 }
86 }
87 \endqml
88
62 If you need a progression symbol in your list item,89 If you need a progression symbol in your list item,
63 just add \l ProgressionSlot as a child of your ListItemLayout.90 just add \l ProgressionSlot as a child of your ListItemLayout.
64 No manual positioning is needed, the layout will handle it for you.91 No manual positioning is needed, the layout will handle it for you.
@@ -186,6 +213,39 @@
186 to have the same height even without having to fill \l subtitle's (or summary's)213 to have the same height even without having to fill \l subtitle's (or summary's)
187 text with dummy content.214 text with dummy content.
188215
216 \section1 Labels' properties
217
218 ListItemLayout's labels are the same component as \l {Label}, but with slightly different
219 default properties. Moreover, \l Label derives from \l {Text}. As a consequence,
220 you can access and override all the properties provided by \l {Text} and \l {Label}, if needed. Please
221 refer to \l {Text}'s and \l {Label}'s documentation to see the list of all the properties.
222
223 The default values for ListItemLayout's labels are defined in the documentation of each label.
224 See \l title, \l subtitle and \l summary.
225
226 \b Note: if you want to change the elide mode of a label to something other than \c Text.ElideRight,
227 make sure its \c wrapMode is set to \c Text.NoWrap. See \l Text::wrapMode for more details.
228
229 \qml
230 import QtQuick 2.4
231 import Ubuntu.Components 1.3
232 Item {
233 width: units.gu(30)
234 height: units.gu(50)
235 ListItem {
236 height: layout.height + (divider.visible ? divider.height : 0)
237 ListItemLayout {
238 id: fileLayout
239 //Let's change the default elide mode to Text.ElideMiddle
240 title.elide: Text.ElideMiddle
241 //ElideMiddle only works if there is no wrapping (see Text::wrapMode doc)
242 title.wrapMode: Text.NoWrap
243 title.text: "Red Roses run no risk, sir, on nurses order."
244 }
245 }
246 }
247 \endqml
248
189 \section1 Optimizing memory consumption249 \section1 Optimizing memory consumption
190250
191 In order to minimize memory consumption, the Labels in the \l SlotsLayout::mainSlot251 In order to minimize memory consumption, the Labels in the \l SlotsLayout::mainSlot
@@ -221,6 +281,7 @@
221281
222 \qml282 \qml
223 ListItem {283 ListItem {
284 height: layout.height + (divider.visible ? divider.height : 0)
224 property alias titleText: layout.title.text285 property alias titleText: layout.title.text
225 ListItemLayout {286 ListItemLayout {
226 id: layout287 id: layout
@@ -301,13 +362,28 @@
301 Text component, as shown in the following example:362 Text component, as shown in the following example:
302363
303 \qml364 \qml
304 Item {365 import QtQuick 2.4
305 ListItemLayout {366 import Ubuntu.Components 1.3
306 title.text: "Hello"367 ListItemLayout {
307 title.color: "yellow"368 height: units.gu(10)
308 }369 width: units.gu(30)
370 title.color: UbuntuColors.orange
371 title.maximumLineCount: 3
372 title.text: "Red Roses\nrun no risk,\nsir, on nurses order."
309 }373 }
310 \endqml374 \endqml
375
376 The default \l Text::elide value for \l title is \c Text.ElideRight.
377
378 The default \l Text::wrapMode is \c Text.WrapAnywhere.
379
380 That means, for instance, that if you want to use a different elide mode, you also have
381 to set wrapMode to \c Text.NoWrap. Refer to the official \l Text documentation for
382 further details.
383
384 The default \l Label::textSize is \c Label.Medium.
385
386 The rest of the properties have the same default values as \l Label.
311*/387*/
312UCLabel *UCListItemLayout::title()388UCLabel *UCListItemLayout::title()
313{389{
@@ -320,6 +396,14 @@
320 This property defines the subtitle label and its properties.396 This property defines the subtitle label and its properties.
321 Styling and font properties can be set by using the prefix397 Styling and font properties can be set by using the prefix
322 \c {subtitle.} in a similar way as shown in \l title.398 \c {subtitle.} in a similar way as shown in \l title.
399
400 The default \l Text::elide value for \l subtitle is \c Text.ElideRight.
401
402 The default \l Text::wrapMode is \c Text.WrapAnywhere.
403
404 The default \l Label::textSize is \c Label.Small.
405
406 The rest of the properties have the same default values as \l Label.
323*/407*/
324UCLabel *UCListItemLayout::subtitle()408UCLabel *UCListItemLayout::subtitle()
325{409{
@@ -332,6 +416,14 @@
332 This property defines the subtitle label and its properties.416 This property defines the subtitle label and its properties.
333 Styling and font properties can be set by using the prefix417 Styling and font properties can be set by using the prefix
334 \c {summary.} in a similar way as shown in \l title.418 \c {summary.} in a similar way as shown in \l title.
419
420 The default \l Text::elide value for \l summary is \c Text.ElideRight.
421
422 The default \l Text::wrapMode is \c Text.WrapAnywhere.
423
424 The default \l Label::textSize is \c Label.Small.
425
426 The rest of the properties have the same default values as \l Label.
335*/427*/
336UCLabel *UCListItemLayout::summary()428UCLabel *UCListItemLayout::summary()
337{429{
338430
=== modified file 'src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp'
--- src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp 2016-07-07 08:42:42 +0000
+++ src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp 2016-08-14 09:05:30 +0000
@@ -703,7 +703,7 @@
703 \qml703 \qml
704 ListItem {704 ListItem {
705 //CORRECT705 //CORRECT
706 height: layout.height + divider.height706 height: layout.height + (divider.visible ? divider.height : 0)
707707
708 SlotsLayout {708 SlotsLayout {
709 id: layout709 id: layout
@@ -765,7 +765,7 @@
765765
766 \qml766 \qml
767 ListItem {767 ListItem {
768 height: layout.height + divider.height768 height: layout.height + (divider.visible ? divider.height : 0)
769 onClicked: console.log("clicked!")769 onClicked: console.log("clicked!")
770770
771 SlotsLayout {771 SlotsLayout {
772772
=== modified file 'src/Ubuntu/UbuntuToolkit/ucstyleditembase_p.h'
--- src/Ubuntu/UbuntuToolkit/ucstyleditembase_p.h 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/ucstyleditembase_p.h 2016-08-14 09:05:30 +0000
@@ -43,7 +43,7 @@
43 Q_PROPERTY(bool activeFocusOnTab43 Q_PROPERTY(bool activeFocusOnTab
44 READ activeFocusOnTab244 READ activeFocusOnTab2
45 WRITE setActiveFocusOnTab245 WRITE setActiveFocusOnTab2
46 NOTIFY activeFocusOnTabChanged2 FINAL)46 NOTIFY activeFocusOnTabChanged2)
47 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QQmlComponent *style READ style WRITE setStyle RESET resetStyle NOTIFY styleChanged FINAL DESIGNABLE false)47 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QQmlComponent *style READ style WRITE setStyle RESET resetStyle NOTIFY styleChanged FINAL DESIGNABLE false)
48 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QQuickItem *__styleInstance READ styleInstance NOTIFY styleInstanceChanged FINAL DESIGNABLE false)48 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QQuickItem *__styleInstance READ styleInstance NOTIFY styleInstanceChanged FINAL DESIGNABLE false)
49 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QString styleName READ styleName WRITE setStyleName NOTIFY styleNameChanged FINAL REVISION 2)49 Q_PRIVATE_PROPERTY(UCStyledItemBase::d_func(), QString styleName READ styleName WRITE setStyleName NOTIFY styleNameChanged FINAL REVISION 2)
5050
=== modified file 'src/Ubuntu/UbuntuToolkit/ucstylehints.cpp'
--- src/Ubuntu/UbuntuToolkit/ucstylehints.cpp 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/ucstylehints.cpp 2016-08-14 09:05:30 +0000
@@ -225,15 +225,18 @@
225 m_propertyBackup.clear();225 m_propertyBackup.clear();
226226
227 QQuickItem *item = UCStyledItemBasePrivate::get(m_styledItem)->styleItem;227 QQuickItem *item = UCStyledItemBasePrivate::get(m_styledItem)->styleItem;
228 const QMetaObject *mo = item->metaObject();
229 const QString styleName = UCStyledItemBasePrivate::get(m_styledItem)->styleName();228 const QString styleName = UCStyledItemBasePrivate::get(m_styledItem)->styleName();
230 // apply values first229 // apply values first
231 for (int i = 0; i < m_values.size(); i++) {230 for (int i = 0; i < m_values.size(); i++) {
232 if (mo->indexOfProperty(m_values[i].first.toUtf8()) < 0) {231 // Checking the validity of the property using the index of m_values[i].first in
232 // item->metaObject is not sufficient in case of a grouped property, so we use
233 // PropertyChange to detect all properties that are not valid.
234 PropertyChange *change = new PropertyChange(item, m_values[i].first.toUtf8());
235 if (!change->property().isValid()) {
233 propertyNotFound(styleName, m_values[i].first);236 propertyNotFound(styleName, m_values[i].first);
237 delete change;
234 continue;238 continue;
235 }239 }
236 PropertyChange *change = new PropertyChange(item, m_values[i].first.toUtf8());
237 PropertyChange::setValue(change, m_values[i].second);240 PropertyChange::setValue(change, m_values[i].second);
238 m_propertyBackup << change;241 m_propertyBackup << change;
239 }242 }
240243
=== modified file 'src/Ubuntu/UbuntuToolkit/ucunits.cpp'
--- src/Ubuntu/UbuntuToolkit/ucunits.cpp 2016-07-07 07:21:48 +0000
+++ src/Ubuntu/UbuntuToolkit/ucunits.cpp 2016-08-14 09:05:30 +0000
@@ -71,16 +71,15 @@
71*/71*/
7272
73/*73/*
74 * Note on the interaction between GRID_UNIT_PX and QT_DEVICE_PIXEL_RATIO74 * In Qt5.6 the following variables affect scaling in QWidget and QML:
75 * 1. QT_SCALE_FACTOR: global integer scale factor, including point-sized fonts
76 * 2. QT_SCREEN_SCALE_FACTORS: a list of scale factors
77 * 3. QT_AUTO_SCREEN_SCALE_FACTOR: enables automatic scaling heuristics
75 *78 *
76 * In Qt5.4 there is a single means to scale the UI: the QT_DEVICE_PIXEL_RATIO environment79 * In Qt5.4 there is a single means to scale the UI: the QT_DEVICE_PIXEL_RATIO environment
77 * variable. This accepts only integer values, thus allowing a x2 or x3 scaling of any80 * variable. This accepts only integer values, thus allowing a x2 or x3 scaling of any
78 * Qt-based UI, that includes QWidget as well as any QML UI.81 * Qt-based UI, that includes QWidget as well as any QML UI.
79 *82 *
80 * Setting QT_DEVICE_PIXEL_RATIO=2 implies one density-independent pixel corresponds to 2
81 * physical pixels. Developers describe their UI in terms of density-independent pixels.
82 * Qt scales accordingly.
83 *
84 * The Ubuntu UI Toolkit has solved the scaling problem with the GRID_UNIT_PX variable.83 * The Ubuntu UI Toolkit has solved the scaling problem with the GRID_UNIT_PX variable.
85 * It offers more flexibility, but only scales QML applications written to use the UITK84 * It offers more flexibility, but only scales QML applications written to use the UITK
86 * (since it uses this Units class) as it is built on top of QML.85 * (since it uses this Units class) as it is built on top of QML.
@@ -184,13 +183,17 @@
184 return QString();183 return QString();
185 }184 }
186185
187 QFileInfo fileInfo(path);186 const QFileInfo fileInfo(path);
188 if (fileInfo.exists() && !fileInfo.isFile()) {187 if (fileInfo.exists()) {
189 return QString();188 if (fileInfo.isFile()) {
189 return QStringLiteral("1/") + path;
190 } else {
191 return QString();
192 }
190 }193 }
191194
192 QString prefix = fileInfo.dir().absolutePath() + "/" + fileInfo.baseName();195 const QString prefix = fileInfo.dir().absolutePath() + "/" + fileInfo.baseName();
193 QString suffix = "." + fileInfo.completeSuffix();196 const QString suffix = "." + fileInfo.completeSuffix();
194197
195 /* Use file with expected grid unit suffix if it exists.198 /* Use file with expected grid unit suffix if it exists.
196 For example, if m_gridUnit = 10, look for resource@10.png.199 For example, if m_gridUnit = 10, look for resource@10.png.
@@ -198,7 +201,7 @@
198201
199 path = prefix + suffixForGridUnit(m_gridUnit) + suffix;202 path = prefix + suffixForGridUnit(m_gridUnit) + suffix;
200 if (QFile::exists(path)) {203 if (QFile::exists(path)) {
201 return QString("1") + "/" + path;204 return QStringLiteral("1/") + path;
202 }205 }
203206
204 /* No file with expected grid unit suffix exists.207 /* No file with expected grid unit suffix exists.
@@ -219,7 +222,7 @@
219 */222 */
220 QStringList nameFilters;223 QStringList nameFilters;
221 nameFilters << fileInfo.baseName() + "@[0-9]*" + suffix;224 nameFilters << fileInfo.baseName() + "@[0-9]*" + suffix;
222 QStringList files = fileInfo.dir().entryList(nameFilters, QDir::Files);225 const QStringList files = fileInfo.dir().entryList(nameFilters, QDir::Files);
223226
224 if (!files.empty()) {227 if (!files.empty()) {
225 float selectedGridUnitSuffix = gridUnitSuffixFromFileName(files.first());228 float selectedGridUnitSuffix = gridUnitSuffixFromFileName(files.first());
@@ -237,11 +240,6 @@
237 return QString::number(scaleFactor) + "/" + path;240 return QString::number(scaleFactor) + "/" + path;
238 }241 }
239242
240 path = prefix + suffix;
241 if (QFile::exists(path)) {
242 return QString("1") + "/" + path;
243 }
244
245 return QString();243 return QString();
246}244}
247245
248246
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_actionbar.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_actionbar.py 2015-12-07 13:30:11 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_actionbar.py 2016-08-14 09:05:30 +0000
@@ -62,6 +62,9 @@
62 try:62 try:
63 object_name = action_object_name + "_button"63 object_name = action_object_name + "_button"
64 button = self.select_single(objectName=object_name)64 button = self.select_single(objectName=object_name)
65 # In an animating header, the button is disabled until the header
66 # animation is done. Wait for that:
67 button.enabled.wait_for(True)
65 self.pointing_device.click_object(button)68 self.pointing_device.click_object(button)
66 except dbus.StateNotFoundError:69 except dbus.StateNotFoundError:
67 # the button is not in the ActionBar, but it may be in the overflow70 # the button is not in the ActionBar, but it may be in the overflow
6871
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2016-04-21 03:23:24 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2016-08-14 09:05:30 +0000
@@ -261,6 +261,9 @@
261 except dbus.StateNotFoundError:261 except dbus.StateNotFoundError:
262 # for Ubuntu.Components < 1.3262 # for Ubuntu.Components < 1.3
263 button = self._get_action_button(action_object_name)263 button = self._get_action_button(action_object_name)
264 # In an animating header, the button is disabled until the header
265 # animation is done. Wait for that:
266 button.enabled.wait_for(True)
264 self.pointing_device.click_object(button)267 self.pointing_device.click_object(button)
265 except _common.ToolkitException:268 except _common.ToolkitException:
266 # Catch 'Button not found in ActionBar or overflow' exception269 # Catch 'Button not found in ActionBar or overflow' exception
267270
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py 2014-07-16 19:19:03 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py 2016-08-14 09:05:30 +0000
@@ -40,7 +40,7 @@
40 option_selector_delegate = self.select_single(40 option_selector_delegate = self.select_single(
41 'OptionSelectorDelegate', focus='True')41 'OptionSelectorDelegate', focus='True')
42 current_label = option_selector_delegate.select_single(42 current_label = option_selector_delegate.select_single(
43 'Label', visible='True')43 'UCLabel', visible='True')
44 return current_label.text44 return current_label.text
4545
46 def get_current_label(self):46 def get_current_label(self):
@@ -48,7 +48,7 @@
48 option_selector_delegate = self.select_single(48 option_selector_delegate = self.select_single(
49 'OptionSelectorDelegate', focus='True')49 'OptionSelectorDelegate', focus='True')
50 current_label = option_selector_delegate.select_single(50 current_label = option_selector_delegate.select_single(
51 'Label', visible='True')51 'UCLabel', visible='True')
52 return current_label52 return current_label
5353
54 def _expand(self):54 def _expand(self):
@@ -69,7 +69,7 @@
6969
70 Example usage::70 Example usage::
71 select_option(objectName="myOptionSelectorDelegate")71 select_option(objectName="myOptionSelectorDelegate")
72 select_option('Label', text="some_text_here")72 select_option('UCLabel', text="some_text_here")
7373
74 :parameter kwargs: keywords used to find property(s) of delegate in74 :parameter kwargs: keywords used to find property(s) of delegate in
75 option selector75 option selector
7676
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py 2016-06-21 05:51:15 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py 2016-08-14 09:05:30 +0000
@@ -98,8 +98,7 @@
98 self.pointing_device.click_object(button)98 self.pointing_device.click_object(button)
9999
100 def _get_button(self, object_name):100 def _get_button(self, object_name):
101 return self.select_single(101 return self.select_single(objectName=object_name)
102 'UbuntuToolkit::UCActionItem', objectName=object_name)
103102
104 @autopilot_logging.log_action(logger.info)103 @autopilot_logging.log_action(logger.info)
105 def click_back_button(self):104 def click_back_button(self):
106105
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py 2016-06-21 18:55:01 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py 2016-08-14 09:05:30 +0000
@@ -98,7 +98,12 @@
98 button = self.select_single(objectName=object_name)98 button = self.select_single(objectName=object_name)
99 except dbus.StateNotFoundError:99 except dbus.StateNotFoundError:
100 raise _common.ToolkitException(100 raise _common.ToolkitException(
101 'Action with objectName "{0}" not found.'.format(object_name))101 'Button for action with objectName "{0}" not found.'.format(
102 action_object_name))
103 if not button.visible:
104 raise _common.ToolkitException(
105 'Button for action with objectName "{0}" not visible.'.format(
106 action_object_name))
102 self.pointing_device.click_object(button)107 self.pointing_device.click_object(button)
103 if self.autoClose:108 if self.autoClose:
104 try:109 try:
105110
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,31 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Item {
26 CheckBox {
27 checked: false
28 objectName: "test_checkbox"
29 }
30 }
31}
032
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,31 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Item {
26 Switch {
27 checked: false
28 objectName: "test_switch"
29 }
30 }
31}
032
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py 2016-08-14 09:05:30 +0000
@@ -15,6 +15,7 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import time17import time
18import os
1819
19from autopilot import input20from autopilot import input
20from testtools.matchers import GreaterThan, LessThan21from testtools.matchers import GreaterThan, LessThan
@@ -24,51 +25,22 @@
24from ubuntuuitoolkit import tests25from ubuntuuitoolkit import tests
2526
2627
27TEST_QML_WITH_CHECKBOX = ("""28class ToggleTestCase(tests.QMLFileAppTestCase):
28import QtQuick 2.029
29import Ubuntu.Components 1.030 path = os.path.abspath(__file__)
3031 dir_path = os.path.dirname(path)
31MainView {32 switch_test_qml_file_path = os.path.join(
32 width: units.gu(48)33 dir_path, 'test_checkbox.ToggleTestCase.test_with_switch.qml')
33 height: units.gu(60)34 checkbox_test_qml_file_path = os.path.join(
34 objectName: "mainView"35 dir_path, 'test_checkbox.ToggleTestCase.test_with_checkbox.qml')
35
36 Item {
37 CheckBox {
38 checked: false
39 objectName: "test_checkbox"
40 }
41 }
42}
43""")
44
45
46TEST_QML_WITH_SWITCH = ("""
47import QtQuick 2.0
48import Ubuntu.Components 1.0
49
50MainView {
51 width: units.gu(48)
52 height: units.gu(60)
53 objectName: "mainView"
54
55 Item {
56 Switch {
57 checked: false
58 objectName: "test_switch"
59 }
60 }
61}
62""")
63
64
65class ToggleTestCase(tests.QMLStringAppTestCase):
6636
67 scenarios = [37 scenarios = [
68 ('checkbox', dict(38 ('checkbox', dict(
69 test_qml=TEST_QML_WITH_CHECKBOX, objectName='test_checkbox')),39 test_qml_file_path=checkbox_test_qml_file_path,
40 objectName='test_checkbox')),
70 ('switch', dict(41 ('switch', dict(
71 test_qml=TEST_QML_WITH_SWITCH, objectName='test_switch'))42 test_qml_file_path=switch_test_qml_file_path,
43 objectName='test_switch'))
72 ]44 ]
7345
74 def setUp(self):46 def setUp(self):
7547
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py 2016-08-14 09:05:30 +0000
@@ -41,6 +41,8 @@
41 ubuntuuitoolkit.check_autopilot_version()41 ubuntuuitoolkit.check_autopilot_version()
4242
4343
44# FIXME: this class is not used anywhere, and QMLStringAppTestCase subclasses
45# no longer work (see bug 1578319), so the code below can be deleted.
44class UbuntuUIToolkitCustomProxyObjectBaseTestCase(tests.QMLStringAppTestCase):46class UbuntuUIToolkitCustomProxyObjectBaseTestCase(tests.QMLStringAppTestCase):
4547
46 def test_pointing_device(self):48 def test_pointing_device(self):
4749
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,72 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.1
19import Ubuntu.Components.Pickers 1.0
20
21MainView {
22 width: units.gu(48)
23 height: units.gu(60)
24 objectName: "mainView"
25
26 Column {
27 DatePicker {
28 id: datePicker
29 objectName: 'datePicker'
30 mode: 'Years|Months|Days'
31 maximum: {
32 var d = new Date()
33 d.setFullYear('2030')
34 return d
35 }
36 minimum: {
37 var d = new Date()
38 d.setFullYear('1990')
39 return d
40 }
41 date: {
42 var d = new Date()
43 d.setFullYear('2010')
44 d.setMonth('5')
45 d.setDate('15')
46 return d
47 }
48 }
49 DatePicker {
50 id: timePicker
51 objectName: 'timePicker'
52 mode: 'Hours|Minutes|Seconds'
53 maximum: {
54 var d = new Date()
55 d.setFullYear('2030')
56 return d
57 }
58 minimum: {
59 var d = new Date()
60 d.setFullYear('1990')
61 return d
62 }
63 date: {
64 var d = new Date()
65 d.setHours(12)
66 d.setMinutes('30')
67 d.setSeconds('30')
68 return d
69 }
70 }
71 }
72}
073
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py 2016-08-14 09:05:30 +0000
@@ -14,72 +14,19 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os
17import datetime18import datetime
1819
19import ubuntuuitoolkit20import ubuntuuitoolkit
20from ubuntuuitoolkit import pickers, tests21from ubuntuuitoolkit import pickers, tests
2122
2223
23class DatePickerBaseTestCase(tests.QMLStringAppTestCase):24class DatePickerBaseTestCase(tests.QMLFileAppTestCase):
2425
25 test_qml = ("""26 path = os.path.abspath(__file__)
26import QtQuick 2.027 dir_path = os.path.dirname(path)
27import Ubuntu.Components 1.128 test_qml_file_path = os.path.join(
28import Ubuntu.Components.Pickers 1.029 dir_path, 'test_date_picker.DatePickerBaseTestCase.qml')
29
30MainView {
31 width: units.gu(48)
32 height: units.gu(60)
33 objectName: "mainView"
34
35 Column {
36 DatePicker {
37 id: datePicker
38 objectName: 'datePicker'
39 mode: 'Years|Months|Days'
40 maximum: {
41 var d = new Date()
42 d.setFullYear('2030')
43 return d
44 }
45 minimum: {
46 var d = new Date()
47 d.setFullYear('1990')
48 return d
49 }
50 date: {
51 var d = new Date()
52 d.setFullYear('2010')
53 d.setMonth('5')
54 d.setDate('15')
55 return d
56 }
57 }
58 DatePicker {
59 id: timePicker
60 objectName: 'timePicker'
61 mode: 'Hours|Minutes|Seconds'
62 maximum: {
63 var d = new Date()
64 d.setFullYear('2030')
65 return d
66 }
67 minimum: {
68 var d = new Date()
69 d.setFullYear('1990')
70 return d
71 }
72 date: {
73 var d = new Date()
74 d.setHours(12)
75 d.setMinutes('30')
76 d.setSeconds('30')
77 return d
78 }
79 }
80 }
81}
82""")
8330
84 def setUp(self):31 def setUp(self):
85 super().setUp()32 super().setUp()
8633
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,34 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20MainView {
21 objectName: 'mainView'
22 width: units.gu(48)
23 height: units.gu(60)
24
25 Flickable {
26 objectName: 'flickable'
27 }
28 ListView {
29 objectName: 'listView'
30 }
31 Label {
32 objectName: 'label'
33 }
34}
035
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,83 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Label {
26 id: clickedLabel
27 objectName: "clickedLabel"
28 text: "No element clicked."
29 }
30
31 Flickable {
32 anchors {
33 fill: parent
34 topMargin: clickedLabel.height
35 }
36 objectName: 'flickable'
37 height: units.gu(60)
38 contentHeight: bottomButton.y + bottomButton.height
39 contentWidth: topRightButton.x +
40 Math.max(topRightButton.width, bottomRightButton.width)
41
42 Button {
43 id: topButton
44 objectName: 'topButton'
45 text: 'Top button'
46 onClicked: clickedLabel.text = objectName
47 }
48 Rectangle {
49 id: emptyRectangle
50 width: units.gu(70)
51 height: units.gu(80)
52 anchors.top: topButton.bottom
53 }
54 Button {
55 id: bottomButton
56 objectName: 'bottomButton'
57 text: 'Bottom button'
58 onClicked: clickedLabel.text = objectName
59 anchors.top: emptyRectangle.bottom
60 }
61 Button {
62 id: topRightButton
63 objectName: 'topRightButton'
64 text: 'Top-right button'
65 onClicked: clickedLabel.text = objectName
66 anchors {
67 top: parent.top
68 left: emptyRectangle.right
69 }
70 }
71 Button {
72 id: bottomRightButton
73 objectName: 'bottomRightButton'
74 text: 'Bottom-right button'
75 onClicked: clickedLabel.text = objectName
76 anchors {
77 top: emptyRectangle.bottom
78 left: emptyRectangle.right
79 }
80 }
81 }
82}
83
084
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,31 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: 'mainView'
24
25 Flickable {
26 objectName: 'testFlickable'
27 width: 200; height: 200
28 contentWidth: image.width; contentHeight: image.height
29 }
30}
31
032
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2016-01-18 14:51:22 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2016-08-14 09:05:30 +0000
@@ -16,6 +16,7 @@
1616
17from unittest import mock17from unittest import mock
1818
19import os
19import testtools20import testtools
20import ubuntuuitoolkit21import ubuntuuitoolkit
21from ubuntuuitoolkit import (22from ubuntuuitoolkit import (
@@ -49,7 +50,7 @@
49 self.assertFalse(element.is_flickable())50 self.assertFalse(element.is_flickable())
5051
5152
52class IsFlickableTestCase(tests.QMLStringAppTestCase):53class IsFlickableTestCase(tests.QMLFileAppTestCase):
53 """Functional test to check that is_flickable returns the right value.54 """Functional test to check that is_flickable returns the right value.
5455
55 We already have tests for is_flickable with mocks, so here we just check56 We already have tests for is_flickable with mocks, so here we just check
@@ -57,26 +58,10 @@
5758
58 """59 """
5960
60 test_qml = ("""61 path = os.path.abspath(__file__)
61import QtQuick 2.462 dir_path = os.path.dirname(path)
62import Ubuntu.Components 1.363 test_qml_file_path = os.path.join(
6364 dir_path, 'test_flickable.IsFlickableTestCase.qml')
64MainView {
65 objectName: 'mainView'
66 width: units.gu(48)
67 height: units.gu(60)
68
69 Flickable {
70 objectName: 'flickable'
71 }
72 ListView {
73 objectName: 'listView'
74 }
75 Label {
76 objectName: 'label'
77 }
78}
79""")
8065
81 scenarios = [66 scenarios = [
82 ('main view', dict(object_name='mainView', is_flickable=False)),67 ('main view', dict(object_name='mainView', is_flickable=False)),
@@ -93,76 +78,12 @@
9378
94# FIXME: Only left-to-right (where x=0 is leftmost) layouts are taken into79# FIXME: Only left-to-right (where x=0 is leftmost) layouts are taken into
95# account. Add support for horizontal flicking with right-to-left layouts.80# account. Add support for horizontal flicking with right-to-left layouts.
96class SwipeFlickableTestCase(tests.QMLStringAppTestCase):81class SwipeFlickableTestCase(tests.QMLFileAppTestCase):
9782
98 test_qml = ("""83 path = os.path.abspath(__file__)
99import QtQuick 2.484 dir_path = os.path.dirname(path)
100import Ubuntu.Components 1.385 test_qml_file_path = os.path.join(
10186 dir_path, 'test_flickable.SwipeFlickableTestCase.qml')
102MainView {
103 width: units.gu(48)
104 height: units.gu(60)
105 objectName: "mainView"
106
107 Label {
108 id: clickedLabel
109 objectName: "clickedLabel"
110 text: "No element clicked."
111 }
112
113 Flickable {
114 anchors {
115 fill: parent
116 topMargin: clickedLabel.height
117 }
118 objectName: 'flickable'
119 height: units.gu(60)
120 contentHeight: bottomButton.y + bottomButton.height
121 contentWidth: topRightButton.x +
122 Math.max(topRightButton.width, bottomRightButton.width)
123
124 Button {
125 id: topButton
126 objectName: 'topButton'
127 text: 'Top button'
128 onClicked: clickedLabel.text = objectName
129 }
130 Rectangle {
131 id: emptyRectangle
132 width: units.gu(70)
133 height: units.gu(80)
134 anchors.top: topButton.bottom
135 }
136 Button {
137 id: bottomButton
138 objectName: 'bottomButton'
139 text: 'Bottom button'
140 onClicked: clickedLabel.text = objectName
141 anchors.top: emptyRectangle.bottom
142 }
143 Button {
144 id: topRightButton
145 objectName: 'topRightButton'
146 text: 'Top-right button'
147 onClicked: clickedLabel.text = objectName
148 anchors {
149 top: parent.top
150 left: emptyRectangle.right
151 }
152 }
153 Button {
154 id: bottomRightButton
155 objectName: 'bottomRightButton'
156 text: 'Bottom-right button'
157 onClicked: clickedLabel.text = objectName
158 anchors {
159 top: emptyRectangle.bottom
160 left: emptyRectangle.right
161 }
162 }
163 }
164}
165""")
16687
167 def setUp(self):88 def setUp(self):
168 super().setUp()89 super().setUp()
@@ -393,24 +314,12 @@
393 self.assertEqual('Could not swipe in the flickable.', str(error))314 self.assertEqual('Could not swipe in the flickable.', str(error))
394315
395316
396class UnityFlickableTestCase(tests.QMLStringAppTestCase):317class UnityFlickableTestCase(tests.QMLFileAppTestCase):
397318
398 test_qml = ("""319 path = os.path.abspath(__file__)
399import QtQuick 2.4320 dir_path = os.path.dirname(path)
400import Ubuntu.Components 1.3321 test_qml_file_path = os.path.join(
401322 dir_path, 'test_flickable.UnityFlickableTestCase.qml')
402MainView {
403 width: units.gu(48)
404 height: units.gu(60)
405 objectName: 'mainView'
406
407 Flickable {
408 objectName: 'testFlickable'
409 width: 200; height: 200
410 contentWidth: image.width; contentHeight: image.height
411 }
412}
413""")
414323
415 def get_command_line(self, command_line):324 def get_command_line(self, command_line):
416 command_line.append('-engine')325 command_line.append('-engine')
417326
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,35 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19import Ubuntu.Components.ListItems 1.0 as ListItem
20
21MainView {
22 objectName: 'mainView'
23 width: units.gu(48)
24 height: units.gu(60)
25
26 Flickable {
27 objectName: 'flickable'
28 }
29 ListView {
30 objectName: 'listView'
31 }
32 Label {
33 objectName: 'label'
34 }
35}
036
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Label {
26 id: clickedLabel
27 objectName: "clickedLabel"
28 text: "No element clicked."
29 }
30
31 Flickable {
32 anchors {
33 fill: parent
34 topMargin: clickedLabel.height
35 // It can't be at the bottom, or the toolbar will be opened
36 // when we try to click it.
37 bottomMargin: units.gu(10)
38 }
39 objectName: 'flickable'
40 height: units.gu(60)
41 contentHeight: bottomButton.y + bottomButton.height
42
43 Button {
44 id: topButton
45 objectName: 'topButton'
46 text: 'Top button'
47 onClicked: clickedLabel.text = objectName
48 }
49 Rectangle {
50 id: emptyRectangle
51 height: units.gu(80)
52 anchors.top: topButton.bottom
53 }
54 Button {
55 id: bottomButton
56 objectName: 'bottomButton'
57 text: 'Bottom button'
58 onClicked: clickedLabel.text = objectName
59 anchors.top: emptyRectangle.bottom
60 }
61 }
62}
063
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,30 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: 'mainView'
24
25 Flickable {
26 objectName: 'testFlickable'
27 width: 200; height: 200
28 contentWidth: image.width; contentHeight: image.height
29 }
30}
031
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py 2016-01-18 15:39:13 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py 2016-08-14 09:05:30 +0000
@@ -15,6 +15,7 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17from unittest import mock17from unittest import mock
18import os
1819
19import testtools20import testtools
20import ubuntuuitoolkit21import ubuntuuitoolkit
@@ -49,7 +50,7 @@
49 self.assertFalse(element.is_flickable())50 self.assertFalse(element.is_flickable())
5051
5152
52class IsFlickableTestCase(tests.QMLStringAppTestCase):53class IsFlickableTestCase(tests.QMLFileAppTestCase):
53 """Functional test to check that is_flickable returns the right value.54 """Functional test to check that is_flickable returns the right value.
5455
55 We already have tests for is_flickable with mocks, so here we just check56 We already have tests for is_flickable with mocks, so here we just check
@@ -57,27 +58,10 @@
5758
58 """59 """
5960
60 test_qml = ("""61 path = os.path.abspath(__file__)
61import QtQuick 2.062 dir_path = os.path.dirname(path)
62import Ubuntu.Components 1.063 test_qml_file_path = os.path.join(
63import Ubuntu.Components.ListItems 1.0 as ListItem64 dir_path, 'test_flickable_uitk10.IsFlickableTestCase.qml')
64
65MainView {
66 objectName: 'mainView'
67 width: units.gu(48)
68 height: units.gu(60)
69
70 Flickable {
71 objectName: 'flickable'
72 }
73 ListView {
74 objectName: 'listView'
75 }
76 Label {
77 objectName: 'label'
78 }
79}
80""")
8165
82 scenarios = [66 scenarios = [
83 ('main view', dict(object_name='mainView', is_flickable=False)),67 ('main view', dict(object_name='mainView', is_flickable=False)),
@@ -92,56 +76,12 @@
92 self.assertEqual(element.is_flickable(), self.is_flickable)76 self.assertEqual(element.is_flickable(), self.is_flickable)
9377
9478
95class SwipeFlickableTestCase(tests.QMLStringAppTestCase):79class SwipeFlickableTestCase(tests.QMLFileAppTestCase):
9680
97 test_qml = ("""81 path = os.path.abspath(__file__)
98import QtQuick 2.082 dir_path = os.path.dirname(path)
99import Ubuntu.Components 1.083 test_qml_file_path = os.path.join(
10084 dir_path, 'test_flickable_uitk10.SwipeFlickableTestCase.qml')
101MainView {
102 width: units.gu(48)
103 height: units.gu(60)
104 objectName: "mainView"
105
106 Label {
107 id: clickedLabel
108 objectName: "clickedLabel"
109 text: "No element clicked."
110 }
111
112 Flickable {
113 anchors {
114 fill: parent
115 topMargin: clickedLabel.height
116 // It can't be at the bottom, or the toolbar will be opened
117 // when we try to click it.
118 bottomMargin: units.gu(10)
119 }
120 objectName: 'flickable'
121 height: units.gu(60)
122 contentHeight: bottomButton.y + bottomButton.height
123
124 Button {
125 id: topButton
126 objectName: 'topButton'
127 text: 'Top button'
128 onClicked: clickedLabel.text = objectName
129 }
130 Rectangle {
131 id: emptyRectangle
132 height: units.gu(80)
133 anchors.top: topButton.bottom
134 }
135 Button {
136 id: bottomButton
137 objectName: 'bottomButton'
138 text: 'Bottom button'
139 onClicked: clickedLabel.text = objectName
140 anchors.top: emptyRectangle.bottom
141 }
142 }
143}
144""")
14585
146 def setUp(self):86 def setUp(self):
147 super().setUp()87 super().setUp()
@@ -271,24 +211,12 @@
271 self.assertEqual('Could not swipe in the flickable.', str(error))211 self.assertEqual('Could not swipe in the flickable.', str(error))
272212
273213
274class UnityFlickableTestCase(tests.QMLStringAppTestCase):214class UnityFlickableTestCase(tests.QMLFileAppTestCase):
275215
276 test_qml = ("""216 path = os.path.abspath(__file__)
277import QtQuick 2.0217 dir_path = os.path.dirname(path)
278import Ubuntu.Components 1.0218 test_qml_file_path = os.path.join(
279219 dir_path, 'test_flickable_uitk10.UnityFlickableTestCase.qml')
280MainView {
281 width: units.gu(48)
282 height: units.gu(60)
283 objectName: 'mainView'
284
285 Flickable {
286 objectName: 'testFlickable'
287 width: 200; height: 200
288 contentWidth: image.width; contentHeight: image.height
289 }
290}
291""")
292220
293 def get_command_line(self, command_line):221 def get_command_line(self, command_line):
294 command_line.append('-engine')222 command_line.append('-engine')
295223
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,79 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19import Ubuntu.Components.ListItems 1.0
20
21MainView {
22 width: units.gu(48)
23 height: units.gu(60)
24 objectName: "mainView"
25
26 Page {
27
28 ListModel {
29 id: testModel
30
31 ListElement {
32 name: "listitem_destroyed_on_remove_with_confirm"
33 label: "Item destroyed on remove with confirmation"
34 confirm: true
35 }
36 ListElement {
37 name: "listitem_destroyed_on_remove_without_confirm"
38 label: "Item destroyed on remove without confirmation"
39 confirm: false
40 }
41 }
42
43 Column {
44 anchors { fill: parent }
45
46 Standard {
47 objectName: "listitem_standard"
48 confirmRemoval: true
49 removable: true
50 text: 'Slide to remove'
51 }
52
53 Empty {
54 objectName: "listitem_empty"
55 }
56
57 Standard {
58 objectName: "listitem_without_confirm"
59 confirmRemoval: false
60 removable: true
61 text: "Item without delete confirmation"
62 }
63
64 ListView {
65 anchors { left: parent.left; right: parent.right }
66 height: childrenRect.height
67 model: testModel
68
69 delegate: Standard {
70 removable: true
71 confirmRemoval: confirm
72 onItemRemoved: testModel.remove(index)
73 text: label
74 objectName: name
75 }
76 }
77 }
78 }
79}
080
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py 2016-08-14 09:05:30 +0000
@@ -48,74 +48,12 @@
48 listitems.Subtitled, listitems.Base))48 listitems.Subtitled, listitems.Base))
4949
5050
51class SwipeToDeleteTestCase(tests.QMLStringAppTestCase):51class SwipeToDeleteTestCase(tests.QMLFileAppTestCase):
5252
53 test_qml = ("""53 path = os.path.abspath(__file__)
54import QtQuick 2.054 dir_path = os.path.dirname(path)
55import Ubuntu.Components 1.055 test_qml_file_path = os.path.join(
56import Ubuntu.Components.ListItems 1.056 dir_path, 'test_listitems.SwipeToDeleteTestCase.qml')
57
58
59MainView {
60 width: units.gu(48)
61 height: units.gu(60)
62 objectName: "mainView"
63
64 Page {
65
66 ListModel {
67 id: testModel
68
69 ListElement {
70 name: "listitem_destroyed_on_remove_with_confirm"
71 label: "Item destroyed on remove with confirmation"
72 confirm: true
73 }
74 ListElement {
75 name: "listitem_destroyed_on_remove_without_confirm"
76 label: "Item destroyed on remove without confirmation"
77 confirm: false
78 }
79 }
80
81 Column {
82 anchors { fill: parent }
83
84 Standard {
85 objectName: "listitem_standard"
86 confirmRemoval: true
87 removable: true
88 text: 'Slide to remove'
89 }
90
91 Empty {
92 objectName: "listitem_empty"
93 }
94
95 Standard {
96 objectName: "listitem_without_confirm"
97 confirmRemoval: false
98 removable: true
99 text: "Item without delete confirmation"
100 }
101
102 ListView {
103 anchors { left: parent.left; right: parent.right }
104 height: childrenRect.height
105 model: testModel
106
107 delegate: Standard {
108 removable: true
109 confirmRemoval: confirm
110 onItemRemoved: testModel.remove(index)
111 text: label
112 objectName: name
113 }
114 }
115 }
116 }
117}
118""")
11957
120 def setUp(self):58 def setUp(self):
121 super().setUp()59 super().setUp()
12260
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24 useDeprecatedToolbar: false
25
26 PageStack {
27 id: pageStack
28 Component.onCompleted: push(page0)
29
30 Page {
31 id: page0
32 title: "Page 0"
33 visible: false
34
35 Button {
36 objectName: "go_to_page1"
37 text: "Go to page 1"
38 onClicked: pageStack.push(page1)
39 }
40 }
41
42 Page {
43 id: page1
44 title: "Page 1"
45 visible: false
46 }
47 }
48}
049
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24 useDeprecatedToolbar: true
25
26 PageStack {
27 id: pageStack
28 Component.onCompleted: push(page0)
29
30 Page {
31 id: page0
32 title: "Page 0"
33 visible: false
34
35 Button {
36 objectName: "go_to_page1"
37 text: "Go to page 1"
38 onClicked: pageStack.push(page1)
39 }
40 }
41
42 Page {
43 id: page1
44 title: "Page 1"
45 visible: false
46 }
47 }
48}
049
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24}
025
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.3
18import Ubuntu.Components 1.2
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24}
025
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2015-09-22 15:56:35 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2016-08-14 09:05:30 +0000
@@ -14,24 +14,19 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os
17from unittest import mock18from unittest import mock
1819
19import ubuntuuitoolkit20import ubuntuuitoolkit
20from ubuntuuitoolkit import tests21from ubuntuuitoolkit import tests
2122
2223
23class MainView10TestCase(tests.QMLStringAppTestCase):24class MainView10TestCase(tests.QMLFileAppTestCase):
2425
25 test_qml = ("""26 path = os.path.abspath(__file__)
26import QtQuick 2.027 dir_path = os.path.dirname(path)
27import Ubuntu.Components 1.028 test_qml_file_path = os.path.join(
2829 dir_path, 'test_main_view.MainView10TestCase.qml')
29MainView {
30 width: units.gu(48)
31 height: units.gu(60)
32 objectName: "mainView"
33}
34""")
3530
36 def test_main_view_custom_proxy_object(self):31 def test_main_view_custom_proxy_object(self):
37 self.assertIsInstance(self.main_view, ubuntuuitoolkit.MainView)32 self.assertIsInstance(self.main_view, ubuntuuitoolkit.MainView)
@@ -75,18 +70,12 @@
75 str(error), 'The MainView has no Tabs.')70 str(error), 'The MainView has no Tabs.')
7671
7772
78class MainView12TestCase(tests.QMLStringAppTestCase):73class MainView12TestCase(tests.QMLFileAppTestCase):
7974
80 test_qml = ("""75 path = os.path.abspath(__file__)
81import QtQuick 2.376 dir_path = os.path.dirname(path)
82import Ubuntu.Components 1.277 test_qml_file_path = os.path.join(
8378 dir_path, 'test_main_view.MainView12TestCase.qml')
84MainView {
85 width: units.gu(48)
86 height: units.gu(60)
87 objectName: "mainView"
88}
89""")
9079
91 def test_main_view_custom_proxy_object(self):80 def test_main_view_custom_proxy_object(self):
92 self.assertIsInstance(self.main_view, ubuntuuitoolkit.MainView)81 self.assertIsInstance(self.main_view, ubuntuuitoolkit.MainView)
@@ -128,51 +117,20 @@
128 str(error), 'The MainView has no Toolbar.')117 str(error), 'The MainView has no Toolbar.')
129118
130119
131TEST_GO_BACK_QML_FORMAT = ("""120class GoBackTestCase(tests.QMLFileAppTestCase):
132import QtQuick 2.0121
133import Ubuntu.Components 1.0122 path = os.path.abspath(__file__)
134123 dir_path = os.path.dirname(path)
135MainView {{124 toolbar_test_qml_file_path = os.path.join(
136 width: units.gu(48)125 dir_path, 'test_main_view.GoBackTestCase.back_in_toolbar.qml')
137 height: units.gu(60)126 header_test_qml_file_path = os.path.join(
138 objectName: "mainView"127 dir_path, 'test_main_view.GoBackTestCase.back_in_header.qml')
139 useDeprecatedToolbar: {use_deprecated_toolbar}
140
141 PageStack {{
142 id: pageStack
143 Component.onCompleted: push(page0)
144
145 Page {{
146 id: page0
147 title: "Page 0"
148 visible: false
149
150 Button {{
151 objectName: "go_to_page1"
152 text: "Go to page 1"
153 onClicked: pageStack.push(page1)
154 }}
155 }}
156
157 Page {{
158 id: page1
159 title: "Page 1"
160 visible: false
161 }}
162 }}
163}}
164""")
165
166
167class GoBackTestCase(tests.QMLStringAppTestCase):
168128
169 scenarios = [129 scenarios = [
170 ('back in toolbar', dict(130 ('back_in_toolbar', dict(
171 test_qml=TEST_GO_BACK_QML_FORMAT.format(131 test_qml_file_path=toolbar_test_qml_file_path)),
172 use_deprecated_toolbar='true'))),132 ('back_in_header', dict(
173 ('back in header', dict(133 test_qml_file_path=header_test_qml_file_path))
174 test_qml=TEST_GO_BACK_QML_FORMAT.format(
175 use_deprecated_toolbar='false')))
176 ]134 ]
177135
178 def setUp(self):136 def setUp(self):
179137
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,60 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.3
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Page{
26
27 Column {
28 anchors.left: parent.left
29 anchors.right: parent.right
30 anchors.fill: parent
31
32 spacing: units.gu(3)
33
34 Component {
35 id: valueSelectorDelegate
36 OptionSelectorDelegate {
37 text: label
38 objectName: name
39 }
40 }
41
42 ListModel {
43 id: valueModel
44 ListElement { name: "one"; label: "Value 1" }
45 ListElement { name: "two"; label: "Value 2" }
46 ListElement { name: "three"; label: "Value 3" }
47 ListElement { name: "four"; label: "Value 4" }
48 ListElement { name: "five"; label: "Value 5" }
49 }
50
51 OptionSelector {
52 id: valueSelector
53 objectName: "test_option_selector_collapsed"
54 text: "Collapsed"
55 delegate: valueSelectorDelegate
56 model: valueModel
57 }
58 }
59 }
60}
061
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,42 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.3
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(120)
23 objectName: "mainView"
24
25 Column {
26 anchors.fill: parent
27 anchors.left: parent.left
28 anchors.right: parent.right
29 spacing: units.gu(3)
30
31 OptionSelector {
32 objectName: "option_selector"
33 text: i18n.tr("option_selector")
34 expanded: true
35 model: [i18n.tr("Red"),
36 i18n.tr("Blue"),
37 i18n.tr("Green"),
38 i18n.tr("Yellow"),
39 i18n.tr("Black")]
40 }
41 }
42}
043
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py 2016-08-14 09:05:30 +0000
@@ -14,58 +14,18 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os
17import ubuntuuitoolkit18import ubuntuuitoolkit
18from ubuntuuitoolkit import tests19from ubuntuuitoolkit import tests
1920
2021
21class OptionSelectorCustomDelegateTestCase(tests.QMLStringAppTestCase):22class OptionSelectorCustomDelegateTestCase(tests.QMLFileAppTestCase):
2223
23 test_qml = ("""24 path = os.path.abspath(__file__)
24import QtQuick 2.025 dir_path = os.path.dirname(path)
25import Ubuntu.Components 1.026 test_qml_file_path = os.path.join(
2627 dir_path,
27MainView {28 'test_optionselector.OptionSelectorCustomDelegateTestCase.qml')
28 width: units.gu(48)
29 height: units.gu(60)
30 objectName: "mainView"
31
32 Page{
33
34 Column {
35 anchors.left: parent.left
36 anchors.right: parent.right
37 anchors.fill: parent
38
39 spacing: units.gu(3)
40
41 Component {
42 id: valueSelectorDelegate
43 OptionSelectorDelegate {
44 text: label
45 objectName: name
46 }
47 }
48
49 ListModel {
50 id: valueModel
51 ListElement { name: "one"; label: "Value 1" }
52 ListElement { name: "two"; label: "Value 2" }
53 ListElement { name: "three"; label: "Value 3" }
54 ListElement { name: "four"; label: "Value 4" }
55 ListElement { name: "five"; label: "Value 5" }
56 }
57
58 OptionSelector {
59 id: valueSelector
60 objectName: "test_option_selector_collapsed"
61 text: "Collapsed"
62 delegate: valueSelectorDelegate
63 model: valueModel
64 }
65 }
66 }
67}
68""")
6929
70 def setUp(self):30 def setUp(self):
71 super().setUp()31 super().setUp()
@@ -119,36 +79,12 @@
119 self.assertEqual(2, self.option_selector.selectedIndex)79 self.assertEqual(2, self.option_selector.selectedIndex)
12080
12181
122class OptionSelectorTestCase(tests.QMLStringAppTestCase):82class OptionSelectorTestCase(tests.QMLFileAppTestCase):
12383
124 test_qml = ("""84 path = os.path.abspath(__file__)
125import QtQuick 2.085 dir_path = os.path.dirname(path)
126import Ubuntu.Components 1.086 test_qml_file_path = os.path.join(
12787 dir_path, 'test_optionselector.OptionSelectorTestCase.qml')
128MainView {
129 width: units.gu(48)
130 height: units.gu(120)
131 objectName: "mainView"
132
133 Column {
134 anchors.fill: parent
135 anchors.left: parent.left
136 anchors.right: parent.right
137 spacing: units.gu(3)
138
139 OptionSelector {
140 objectName: "option_selector"
141 text: i18n.tr("option_selector")
142 expanded: true
143 model: [i18n.tr("Red"),
144 i18n.tr("Blue"),
145 i18n.tr("Green"),
146 i18n.tr("Yellow"),
147 i18n.tr("Black")]
148 }
149 }
150}
151""")
15288
153 def setUp(self):89 def setUp(self):
154 super().setUp()90 super().setUp()
@@ -176,23 +112,23 @@
176112
177 def test_select_option(self):113 def test_select_option(self):
178 """select_text() must select the text in the OptionSelector"""114 """select_text() must select the text in the OptionSelector"""
179 self.option_selector.select_option('Label', text="Green")115 self.option_selector.select_option('UCLabel', text="Green")
180 self.assertEqual(2, self.option_selector.selectedIndex)116 self.assertEqual(2, self.option_selector.selectedIndex)
181117
182 def test_get_selected_text(self):118 def test_get_selected_text(self):
183 """get_selected_text() must return the text selected item"""119 """get_selected_text() must return the text selected item"""
184 self.option_selector.select_option('Label', text="Blue")120 self.option_selector.select_option('UCLabel', text="Blue")
185 self.assertEqual(1, self.option_selector.selectedIndex)121 self.assertEqual(1, self.option_selector.selectedIndex)
186 self.assertEqual(122 self.assertEqual(
187 self.option_selector.get_selected_text(), "Blue")123 self.option_selector.get_selected_text(), "Blue")
188124
189 def test_same_item_2_times(self):125 def test_same_item_2_times(self):
190 """Emulator must be able to select 2 items in a row"""126 """Emulator must be able to select 2 items in a row"""
191 self.option_selector.select_option('Label', text="Green")127 self.option_selector.select_option('UCLabel', text="Green")
192 self.assertEqual(128 self.assertEqual(
193 self.option_selector.get_selected_text(), "Green")129 self.option_selector.get_selected_text(), "Green")
194 self.assertEqual(2, self.option_selector.selectedIndex)130 self.assertEqual(2, self.option_selector.selectedIndex)
195 self.option_selector.select_option('Label', text="Green")131 self.option_selector.select_option('UCLabel', text="Green")
196 self.assertEqual(132 self.assertEqual(
197 self.option_selector.get_selected_text(), "Green")133 self.option_selector.get_selected_text(), "Green")
198 self.assertEqual(2, self.option_selector.selectedIndex)134 self.assertEqual(2, self.option_selector.selectedIndex)
199135
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ActionSelectionPopoverTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ActionSelectionPopoverTestCase.qml 2015-10-01 12:26:23 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ActionSelectionPopoverTestCase.qml 2016-08-14 09:05:30 +0000
@@ -48,11 +48,13 @@
48 Action {48 Action {
49 text: "Action two"49 text: "Action two"
50 objectName: "actionDisabled"50 objectName: "actionDisabled"
51 enabled: false
51 onTriggered: label.text = "Disabled button clicked."52 onTriggered: label.text = "Disabled button clicked."
52 }53 }
53 Action {54 Action {
54 text: "Action three"55 text: "Action three"
55 objectName: "actionHidden"56 objectName: "actionHidden"
57 visible: false
56 onTriggered: label.text = "Hidden button clicked."58 onTriggered: label.text = "Hidden button clicked."
57 }59 }
58 }60 }
5961
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19import Ubuntu.Components.Popups 1.0
20
21MainView {
22 width: units.gu(48)
23 height: units.gu(60)
24 objectName: "mainView"
25
26 Button {
27 objectName: "openComposerSheetButton"
28 text: "Open Composer Sheet"
29 onClicked: PopupUtils.open(testComposerSheet);
30 }
31
32 Label {
33 id: "label"
34 objectName: "actionLabel"
35 anchors.centerIn: parent
36 text: "No action taken."
37 }
38
39 Component {
40 id: testComposerSheet
41 ComposerSheet {
42 id: sheet
43 objectName: "testComposerSheet"
44 onCancelClicked: {
45 label.text = "Cancel selected."
46 }
47 onConfirmClicked: {
48 label.text = "Confirm selected."
49 }
50 }
51 }
52}
053
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py 2015-09-30 15:10:11 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py 2016-08-14 09:05:30 +0000
@@ -23,6 +23,8 @@
2323
24class ActionSelectionPopoverTestCase(tests.QMLFileAppTestCase):24class ActionSelectionPopoverTestCase(tests.QMLFileAppTestCase):
2525
26 # FIXME: Currently we are only testing UITK 1.0 Popups,
27 # we need to test 1.3 as well. See bug 1612582.
26 path = os.path.abspath(__file__)28 path = os.path.abspath(__file__)
27 dir_path = os.path.dirname(path)29 dir_path = os.path.dirname(path)
28 test_qml_file_path = os.path.join(30 test_qml_file_path = os.path.join(
@@ -60,7 +62,7 @@
60 popover.click_action_button, 'actionTwo')62 popover.click_action_button, 'actionTwo')
61 self.assertEqual(63 self.assertEqual(
62 str(error),64 str(error),
63 'Action with objectName "actionTwo" not found.')65 'Button for action with objectName "actionTwo" not found.')
6466
65 def test_click_disabled_button_by_object_name(self):67 def test_click_disabled_button_by_object_name(self):
66 self._open_popover()68 self._open_popover()
@@ -72,7 +74,7 @@
72 popover.click_action_button, 'actionDisabled')74 popover.click_action_button, 'actionDisabled')
73 self.assertEqual(75 self.assertEqual(
74 str(error),76 str(error),
75 'Action with objectName "actionDisabled" not found.')77 'Button for action with objectName "actionDisabled" not visible.')
7678
77 def test_click_hidden_button_by_object_name(self):79 def test_click_hidden_button_by_object_name(self):
78 self._open_popover()80 self._open_popover()
@@ -83,7 +85,7 @@
83 popover.click_action_button, 'actionHidden')85 popover.click_action_button, 'actionHidden')
84 self.assertEqual(86 self.assertEqual(
85 str(error),87 str(error),
86 'Action with objectName "actionHidden" not found.')88 'Button for action with objectName "actionHidden" not visible.')
8789
88 def _open_popover(self):90 def _open_popover(self):
89 open_button = self.main_view.select_single(91 open_button = self.main_view.select_single(
@@ -110,46 +112,12 @@
110 str(error), 'The popover is not open.')112 str(error), 'The popover is not open.')
111113
112114
113class ComposerSheetTestCase(tests.QMLStringAppTestCase):115class ComposerSheetTestCase(tests.QMLFileAppTestCase):
114116
115 test_qml = ("""117 path = os.path.abspath(__file__)
116import QtQuick 2.0118 dir_path = os.path.dirname(path)
117import Ubuntu.Components 1.0119 test_qml_file_path = os.path.join(
118import Ubuntu.Components.Popups 1.0120 dir_path, 'test_popups.ComposerSheetTestCase.qml')
119
120MainView {
121 width: units.gu(48)
122 height: units.gu(60)
123 objectName: "mainView"
124
125 Button {
126 objectName: "openComposerSheetButton"
127 text: "Open Composer Sheet"
128 onClicked: PopupUtils.open(testComposerSheet);
129 }
130
131 Label {
132 id: "label"
133 objectName: "actionLabel"
134 anchors.centerIn: parent
135 text: "No action taken."
136 }
137
138 Component {
139 id: testComposerSheet
140 ComposerSheet {
141 id: sheet
142 objectName: "testComposerSheet"
143 onCancelClicked: {
144 label.text = "Cancel selected."
145 }
146 onConfirmClicked: {
147 label.text = "Confirm selected."
148 }
149 }
150 }
151}
152""")
153121
154 def setUp(self):122 def setUp(self):
155 super().setUp()123 super().setUp()
156124
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19import Ubuntu.Components.ListItems 1.0 as ListItem
20
21MainView {
22 width: units.gu(48)
23 height: units.gu(20)
24 objectName: "mainView"
25
26 Page {
27
28 Flickable {
29
30 Column {
31 id: column
32 width: units.gu(48)
33 // The column height is greater than the main view height, so
34 // the bottom of the list is out of view.
35 height: units.gu(40)
36
37 Label {
38 id: clickedLabel
39 objectName: "clickedLabel"
40 text: "No element clicked."
41 }
42
43 ListView {
44 id: testListView
45 objectName: "testListView"
46 anchors.left: parent.left
47 anchors.right: parent.right
48 height: column.height - clickedLabel.paintedHeight
49 clip: true
50 model: 20
51
52 delegate: ListItem.Standard {
53 objectName: "testListElement%1".arg(index)
54 text: "test list element %1".arg(index)
55 onClicked: clickedLabel.text = objectName
56 height: units.gu(5)
57 }
58 }
59 }
60 }
61 }
62}
063
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2016-01-20 17:35:53 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2016-08-14 09:05:30 +0000
@@ -150,57 +150,13 @@
150 str(error), 'List element with objectName "unexisting" not found.')150 str(error), 'List element with objectName "unexisting" not found.')
151151
152152
153class QQuickListViewOutOfViewTestCase(tests.QMLStringAppTestCase):153class QQuickListViewOutOfViewTestCase(tests.QMLFileAppTestCase):
154 """Test that we can make elements visible when the list is out of view."""154 """Test that we can make elements visible when the list is out of view."""
155155
156 test_qml = ("""156 path = os.path.abspath(__file__)
157import QtQuick 2.0157 dir_path = os.path.dirname(path)
158import Ubuntu.Components 1.0158 test_qml_file_path = os.path.join(
159import Ubuntu.Components.ListItems 1.0 as ListItem159 dir_path, 'test_qquicklistview.QQuickListViewOutOfViewTestCase.qml')
160
161MainView {
162 width: units.gu(48)
163 height: units.gu(20)
164 objectName: "mainView"
165
166 Page {
167
168 Flickable {
169
170 Column {
171 id: column
172 width: units.gu(48)
173 // The column height is greater than the main view height, so
174 // the bottom of the list is out of view.
175 height: units.gu(40)
176
177 Label {
178 id: clickedLabel
179 objectName: "clickedLabel"
180 text: "No element clicked."
181 }
182
183 ListView {
184 id: testListView
185 objectName: "testListView"
186 anchors.left: parent.left
187 anchors.right: parent.right
188 height: column.height - clickedLabel.paintedHeight
189 clip: true
190 model: 20
191
192 delegate: ListItem.Standard {
193 objectName: "testListElement%1".arg(index)
194 text: "test list element %1".arg(index)
195 onClicked: clickedLabel.text = objectName
196 height: units.gu(5)
197 }
198 }
199 }
200 }
201 }
202}
203""")
204160
205 def setUp(self):161 def setUp(self):
206 super().setUp()162 super().setUp()
207163
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,30 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Item {
26 TextArea {
27 objectName: "simple_text_area"
28 }
29 }
30}
031
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py 2015-06-17 15:06:48 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py 2016-08-14 09:05:30 +0000
@@ -14,30 +14,19 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os
17from testtools.matchers import GreaterThan18from testtools.matchers import GreaterThan
1819
19import ubuntuuitoolkit20import ubuntuuitoolkit
20from ubuntuuitoolkit import tests21from ubuntuuitoolkit import tests
2122
2223
23class TextAreaTestCase(tests.QMLStringAppTestCase):24class TextAreaTestCase(tests.QMLFileAppTestCase):
2425
25 test_qml = ("""26 path = os.path.abspath(__file__)
26import QtQuick 2.027 dir_path = os.path.dirname(path)
27import Ubuntu.Components 1.028 test_qml_file_path = os.path.join(
2829 dir_path, 'test_textarea.TextAreaTestCase.qml')
29MainView {
30 width: units.gu(48)
31 height: units.gu(60)
32 objectName: "mainView"
33
34 Item {
35 TextArea {
36 objectName: "simple_text_area"
37 }
38 }
39}
40""")
4130
42 def setUp(self):31 def setUp(self):
43 super().setUp()32 super().setUp()
4433
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,49 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.0
19
20MainView {
21 width: units.gu(50)
22 height: units.gu(50)
23 objectName: "mainView"
24
25 // Make sure that for these tests the toolbar starts closed.
26 Component.onCompleted: {
27 __propagated.toolbar.close();
28 }
29
30 Page {
31
32 Label {
33 id: "label"
34 objectName: "clicked_label"
35 anchors.centerIn: parent
36 text: "Button not clicked."
37 }
38
39 tools: ToolbarItems {
40 ToolbarButton {
41 objectName: "buttonName"
42 action: Action {
43 text: "buttonText"
44 onTriggered: label.text = "Button clicked."
45 }
46 }
47 }
48 }
49}
050
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py 2016-08-14 09:05:30 +0000
@@ -14,49 +14,19 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os
17from unittest import mock18from unittest import mock
1819
19import ubuntuuitoolkit20import ubuntuuitoolkit
20from ubuntuuitoolkit import tests21from ubuntuuitoolkit import tests
2122
2223
23class ToolbarTestCase(tests.QMLStringAppTestCase):24class ToolbarTestCase(tests.QMLFileAppTestCase):
2425
25 test_qml = ("""26 path = os.path.abspath(__file__)
26import QtQuick 2.027 dir_path = os.path.dirname(path)
27import Ubuntu.Components 1.028 test_qml_file_path = os.path.join(
2829 dir_path, 'test_toolbar.ToolbarTestCase.qml')
29MainView {
30 width: units.gu(50)
31 height: units.gu(50)
32 objectName: "mainView"
33
34 // Make sure that for these tests the toolbar starts closed.
35 Component.onCompleted: {
36 __propagated.toolbar.close();
37 }
38
39 Page {
40
41 Label {
42 id: "label"
43 objectName: "clicked_label"
44 anchors.centerIn: parent
45 text: "Button not clicked."
46 }
47
48 tools: ToolbarItems {
49 ToolbarButton {
50 objectName: "buttonName"
51 action: Action {
52 text: "buttonText"
53 onTriggered: label.text = "Button clicked."
54 }
55 }
56 }
57 }
58}
59""")
6030
61 def setUp(self):31 def setUp(self):
62 super().setUp()32 super().setUp()
6333
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2015-10-04 13:20:26 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2016-08-14 09:05:30 +0000
@@ -35,7 +35,6 @@
35 def setUp(self):35 def setUp(self):
36 self.test_source_path = self._get_test_source_path()36 self.test_source_path = self._get_test_source_path()
37 self.test_qml_file_path = self._get_test_qml_file_path()37 self.test_qml_file_path = self._get_test_qml_file_path()
38 self.desktop_file_path = self._get_desktop_file_path()
3938
40 if self.should_simulate_device():39 if self.should_simulate_device():
41 # Hide the Unity7 launcher because it takes space that might be40 # Hide the Unity7 launcher because it takes space that might be
@@ -102,25 +101,6 @@
102 return '/usr/lib/{}/qt5/examples//ubuntu-ui-toolkit/examples/' \101 return '/usr/lib/{}/qt5/examples//ubuntu-ui-toolkit/examples/' \
103 'ubuntu-ui-toolkit-gallery'.format(host_multiarch)102 'ubuntu-ui-toolkit-gallery'.format(host_multiarch)
104103
105 def _get_desktop_file_path(self):
106 desktop_file_path = os.path.join(
107 self.test_source_path,
108 'ubuntu-ui-toolkit-gallery.desktop')
109 if self._application_source_exists():
110 local_desktop_file_dir = (
111 ubuntuuitoolkit.tests.get_local_desktop_file_directory())
112 if not os.path.exists(local_desktop_file_dir):
113 os.makedirs(local_desktop_file_dir)
114 local_desktop_file_path = os.path.join(
115 local_desktop_file_dir, 'ubuntu-ui-toolkit-gallery.desktop')
116 shutil.copy(desktop_file_path, local_desktop_file_path)
117 # We can't delete the desktop file before we close the application,
118 # so we save it on an attribute to be deleted on tear down.
119 self.local_desktop_file_path = local_desktop_file_path
120 return local_desktop_file_path
121 else:
122 return desktop_file_path
123
124 def open_page(self, page):104 def open_page(self, page):
125 """Open a page of the widget gallery.105 """Open a page of the widget gallery.
126106
127107
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2016-08-14 09:05:30 +0000
@@ -37,7 +37,8 @@
37 self.assertEqual(37 self.assertEqual(
38 collapsed_option_selector.get_selected_text(), 'Value 1')38 collapsed_option_selector.get_selected_text(), 'Value 1')
3939
40 collapsed_option_selector.select_option('Label', text='Value 4')40 collapsed_option_selector.select_option(
41 'UCLabel', text='Once upon a time there was a story nobody told.')
41 self.assertEqual(collapsed_option_selector.get_selected_index(), 3)42 self.assertEqual(collapsed_option_selector.get_selected_index(), 3)
4243
43 def test_select_option_from_expanded_optionselector(self):44 def test_select_option_from_expanded_optionselector(self):
@@ -48,7 +49,8 @@
48 self.assertEqual(49 self.assertEqual(
49 expanded_option_selector.get_selected_text(), 'Value 1')50 expanded_option_selector.get_selected_text(), 'Value 1')
5051
51 expanded_option_selector.select_option('Label', text='Value 4')52 expanded_option_selector.select_option(
53 'UCLabel', text='Once upon a time there was a story nobody told.')
52 self.assertEqual(expanded_option_selector.get_selected_index(), 3)54 self.assertEqual(expanded_option_selector.get_selected_index(), 3)
5355
54 def test_select_option_from_optionselector_with_custom_model(self):56 def test_select_option_from_optionselector_with_custom_model(self):
@@ -61,6 +63,6 @@
61 option_selector_with_custom_model.get_selected_index(), 0)63 option_selector_with_custom_model.get_selected_index(), 0)
6264
63 option_selector_with_custom_model.select_option(65 option_selector_with_custom_model.select_option(
64 'Label', text='Name 4')66 'UCLabel', text='Name 4')
65 self.assertEqual(67 self.assertEqual(
66 option_selector_with_custom_model.get_selected_index(), 3)68 option_selector_with_custom_model.get_selected_index(), 3)
6769
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_launcher.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_launcher.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_launcher.py 2016-08-14 09:05:30 +0000
@@ -37,6 +37,18 @@
37 self.assertThat(textfield.text, Eventually(Equals("Yes")))37 self.assertThat(textfield.text, Eventually(Equals("Yes")))
3838
3939
40class LauncherWindowTestCase(tests.QMLFileAppTestCase):
41 path = os.path.abspath(__file__)
42 dir_path = os.path.dirname(path)
43 test_qml_file_path = os.path.join(
44 dir_path, 'test_launcher.window.qml')
45
46 def test_window_root_item(self):
47 label = self.main_view.select_single(objectName="label")
48 self.assertThat(label.text,
49 Eventually(Equals("Lorem ipsum dolor sit amet")))
50
51
40class LauncherQtTestTestCase(tests.QMLFileAppTestCase):52class LauncherQtTestTestCase(tests.QMLFileAppTestCase):
41 path = os.path.abspath(__file__)53 path = os.path.abspath(__file__)
42 dir_path = os.path.dirname(path)54 dir_path = os.path.dirname(path)
4355
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_launcher.testcase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/test_launcher.testcase.qml 2015-03-03 13:20:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_launcher.testcase.qml 2016-08-14 09:05:30 +0000
@@ -17,7 +17,7 @@
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Components 1.119import Ubuntu.Components 1.1
20import Ubuntu.Test 1.020import Ubuntu.Test 1.0 // UbuntuTestCase
2121
22MainView {22MainView {
23 width: units.gu(48)23 width: units.gu(48)
2424
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/test_launcher.window.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/test_launcher.window.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_launcher.window.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright 2014-2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import QtQuick.Window 2.2 // Not Ubuntu.Test
19import Ubuntu.Components 1.3
20
21Window {
22 title: "Hello World"
23 minimumWidth: units.gu(30)
24 minimumHeight: units.gu(50)
25 maximumWidth: units.gu(90)
26 maximumHeight: units.gu(120)
27 MainView {
28 objectName: "mainView"
29
30 Page {
31 title: "Launcher/Window"
32
33 Column {
34 Label {
35 objectName: "label"
36 text: "Lorem ipsum dolor sit amet"
37 width: units.gu(25)
38 height: units.gu(25)
39 }
40 }
41 }
42 }
43}
044
=== removed file 'tests/unit/README'
--- tests/unit/README 2013-06-26 22:44:07 +0000
+++ tests/unit/README 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1== How to execute a single qml test ==
2
3When current path is tests/unit/tst_components:
4QML2_IMPORT_PATH=../../../modules:$QML2_IMPORT_PATH UBUNTU_UI_TOOLKIT_THEMES_PATH=../../../modules qmltestrunner -input tst_yourtest.qml -import "../../../modules"
50
=== added file 'tests/unit/bottomedge/ExternalContent.qml'
--- tests/unit/bottomedge/ExternalContent.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/bottomedge/ExternalContent.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18import QtQuick 2.4
19import Ubuntu.Components 1.3
20
21Rectangle {
22 objectName: "external"
23 width: parent ? parent.width : 0
24 height: parent ? parent.height : 0
25 color: UbuntuColors.silk
26}
27
028
=== added file 'tests/unit/bottomedge/PreloadContentUrl.qml'
--- tests/unit/bottomedge/PreloadContentUrl.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/bottomedge/PreloadContentUrl.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,35 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18import QtQuick 2.4
19import Ubuntu.Components 1.3
20
21Item {
22 id: holder
23 width: units.gu(40)
24 height: units.gu(71)
25
26 BottomEdge {
27 id: bottomEdge
28 height: parent.height
29 hint.text: "Test"
30 objectName: "testItem"
31 preloadContent: true
32 contentUrl: Qt.resolvedUrl("ExternalContent.qml")
33 }
34}
35
036
=== modified file 'tests/unit/bottomedge/bottomedge.pro'
--- tests/unit/bottomedge/bottomedge.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/bottomedge/bottomedge.pro 2016-08-14 09:05:30 +0000
@@ -24,4 +24,6 @@
24 UncoveredByRegion.qml \24 UncoveredByRegion.qml \
25 OverriddenHintTrigger.qml \25 OverriddenHintTrigger.qml \
26 PreloadedContent.qml \26 PreloadedContent.qml \
27 BottomEdgeWithAction.qml27 BottomEdgeWithAction.qml \
28 PreloadContentUrl.qml \
29 ExternalContent.qml
2830
=== modified file 'tests/unit/bottomedge/tst_bottomedge.cpp'
--- tests/unit/bottomedge/tst_bottomedge.cpp 2016-07-25 23:24:46 +0000
+++ tests/unit/bottomedge/tst_bottomedge.cpp 2016-08-14 09:05:30 +0000
@@ -941,6 +941,16 @@
941 QCOMPARE(regionObjects[i++], QString("default"));941 QCOMPARE(regionObjects[i++], QString("default"));
942 }942 }
943943
944 void test_preload_content_url()
945 {
946 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadContentUrl.qml"));
947 UCBottomEdge *bottomEdge = test->testItem();
948
949 // commit so the contentItem is set
950 bottomEdge->commit();
951 QTRY_VERIFY(bottomEdge->contentItem());
952 }
953
944 void test_reset_preload_content()954 void test_reset_preload_content()
945 {955 {
946 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadedContent.qml"));956 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadedContent.qml"));
947957
=== added file 'tests/unit/subtheming/GroupPropertyValueHints.qml'
--- tests/unit/subtheming/GroupPropertyValueHints.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/subtheming/GroupPropertyValueHints.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Item {
21 width: units.gu(40)
22 height: units.gu(71)
23
24 HintedButton {
25 objectName: "Button"
26 id: button
27 gradient: UbuntuColors.greyGradient
28 StyleHints {
29 ignoreUnknownProperties: false
30 gradientProxy.topColor: "orange"
31 }
32 }
33}
034
=== added file 'tests/unit/subtheming/StyleHintsInvalidGroupedProperty.qml'
--- tests/unit/subtheming/StyleHintsInvalidGroupedProperty.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/subtheming/StyleHintsInvalidGroupedProperty.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,30 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Item {
21 width: units.gu(40)
22 height: units.gu(71)
23
24 Button {
25 StyleHints {
26 ignoreUnknownProperties: false
27 gradientProxy.invalidProperty: 10
28 }
29 }
30}
031
=== modified file 'tests/unit/subtheming/subtheming.pro'
--- tests/unit/subtheming/subtheming.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/subtheming/subtheming.pro 2016-08-14 09:05:30 +0000
@@ -37,9 +37,11 @@
37 StyleHintsWithObject.qml \37 StyleHintsWithObject.qml \
38 StyleHintsElsewhere.qml \38 StyleHintsElsewhere.qml \
39 StyleHintsInvalidProperty.qml \39 StyleHintsInvalidProperty.qml \
40 StyleHintsInvalidGroupedProperty.qml \
40 PropertyBindingHints.qml \41 PropertyBindingHints.qml \
41 MoreStyleHints.qml \42 MoreStyleHints.qml \
42 GroupPropertyBindingHints.qml \43 GroupPropertyBindingHints.qml \
44 GroupPropertyValueHints.qml \
43 OverrideStyleHints.qml \45 OverrideStyleHints.qml \
44 HintedButton.qml \46 HintedButton.qml \
45 OtherVersion.qml \47 OtherVersion.qml \
4648
=== modified file 'tests/unit/subtheming/tst_subtheming.cpp'
--- tests/unit/subtheming/tst_subtheming.cpp 2016-07-25 23:24:46 +0000
+++ tests/unit/subtheming/tst_subtheming.cpp 2016-08-14 09:05:30 +0000
@@ -831,6 +831,9 @@
831 << "StyleHintsElsewhere.qml" << 24 << 5 << "QML StyleHints: StyleHints must be declared in a StyledItem or a derivate of it.";831 << "StyleHintsElsewhere.qml" << 24 << 5 << "QML StyleHints: StyleHints must be declared in a StyledItem or a derivate of it.";
832 QTest::newRow("Invalid property")832 QTest::newRow("Invalid property")
833 << "StyleHintsInvalidProperty.qml" << 25 << 9 << "QML StyleHints: Style 'ButtonStyle' has no property called 'invalidProperty'.";833 << "StyleHintsInvalidProperty.qml" << 25 << 9 << "QML StyleHints: Style 'ButtonStyle' has no property called 'invalidProperty'.";
834 QTest::newRow("Invalid grouped property")
835 << "StyleHintsInvalidGroupedProperty.qml" << 25 << 9 << "QML StyleHints: Style 'ButtonStyle' has no property called 'gradientProxy.invalidProperty'.";
836
834 }837 }
835 void test_stylehints_errors()838 void test_stylehints_errors()
836 {839 {
@@ -881,8 +884,11 @@
881884
882 QTest::newRow("Same document")885 QTest::newRow("Same document")
883 << "MoreStyleHints.qml" << "defaultColor" << QColor("brown") << QColor("brown") << "minimumWidth" << units.gu(20);886 << "MoreStyleHints.qml" << "defaultColor" << QColor("brown") << QColor("brown") << "minimumWidth" << units.gu(20);
884 QTest::newRow("Different document")887 QTest::newRow("Different document, binding")
885 << "GroupPropertyBindingHints.qml" << "gradientProxy.topColor" << QColor("blue") << QColor("tan") << "minimumWidth" << units.gu(20);888 << "GroupPropertyBindingHints.qml" << "gradientProxy.topColor" << QColor("blue") << QColor("tan") << "minimumWidth" << units.gu(20);
889 // regression test for bug #1602836.
890 QTest::newRow("Different document, value")
891 << "GroupPropertyValueHints.qml" << "gradientProxy.topColor" << QColor("orange") << QColor("orange") << "minimumWidth" << units.gu(20);
886 }892 }
887 void test_stylehints_multiple()893 void test_stylehints_multiple()
888 {894 {
889895
=== modified file 'tests/unit/units/dpr1/tst_units.cpp'
--- tests/unit/units/dpr1/tst_units.cpp 2016-07-07 15:33:34 +0000
+++ tests/unit/units/dpr1/tst_units.cpp 2016-08-14 09:05:30 +0000
@@ -28,7 +28,7 @@
28private Q_SLOTS:28private Q_SLOTS:
2929
30 void defaultGridUnit() {30 void defaultGridUnit() {
31 qputenv("GRID_UNIT_PX", "");31 qunsetenv("GRID_UNIT_PX");
32 UCUnits units;32 UCUnits units;
33 QCOMPARE(units.gridUnit(), 8.0f);33 QCOMPARE(units.gridUnit(), 8.0f);
34 }34 }
@@ -46,7 +46,7 @@
46 qputenv("GRID_UNIT_PX", gridUnit);46 qputenv("GRID_UNIT_PX", gridUnit);
47 UCUnits units;47 UCUnits units;
48 QCOMPARE(units.gridUnit(), 11.0);48 QCOMPARE(units.gridUnit(), 11.0);
49 qputenv("GRID_UNIT_PX", "");49 qunsetenv("GRID_UNIT_PX");
50 }50 }
5151
52 void dpGridUnitDefault() {52 void dpGridUnitDefault() {
5353
=== modified file 'tests/unit/units/dpr2/tst_units_dpr2.cpp'
--- tests/unit/units/dpr2/tst_units_dpr2.cpp 2016-07-07 15:33:34 +0000
+++ tests/unit/units/dpr2/tst_units_dpr2.cpp 2016-08-14 09:05:30 +0000
@@ -135,6 +135,8 @@
135int main(int argc, char *argv[])135int main(int argc, char *argv[])
136{136{
137 qputenv("QT_DEVICE_PIXEL_RATIO", "2");137 qputenv("QT_DEVICE_PIXEL_RATIO", "2");
138 qputenv("QT_SCALE_FACTOR", "2");
139 qunsetenv("GRID_UNIT_PX");
138140
139 QGuiApplication app(argc, argv);141 QGuiApplication app(argc, argv);
140 app.setAttribute(Qt::AA_Use96Dpi, true);142 app.setAttribute(Qt::AA_Use96Dpi, true);
141143
=== modified file 'tests/unit/units/dpr3/tst_units_dpr3.cpp'
--- tests/unit/units/dpr3/tst_units_dpr3.cpp 2016-07-07 15:33:34 +0000
+++ tests/unit/units/dpr3/tst_units_dpr3.cpp 2016-08-14 09:05:30 +0000
@@ -80,6 +80,8 @@
80int main(int argc, char *argv[])80int main(int argc, char *argv[])
81{81{
82 qputenv("QT_DEVICE_PIXEL_RATIO", "3");82 qputenv("QT_DEVICE_PIXEL_RATIO", "3");
83 qputenv("QT_SCALE_FACTOR", "3");
84 qunsetenv("GRID_UNIT_PX");
8385
84 QGuiApplication app(argc, argv);86 QGuiApplication app(argc, argv);
85 app.setAttribute(Qt::AA_Use96Dpi, true);87 app.setAttribute(Qt::AA_Use96Dpi, true);
8688
=== modified file 'tests/unit/visual/tst_actionbar.13.qml'
--- tests/unit/visual/tst_actionbar.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_actionbar.13.qml 2016-08-14 09:05:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -15,38 +15,71 @@
15 */15 */
1616
17import QtQuick 2.417import QtQuick 2.4
18import QtQuick.Layouts 1.1
18import Ubuntu.Test 1.019import Ubuntu.Test 1.0
19import Ubuntu.Components 1.320import Ubuntu.Components 1.3
2021
21Item {22Item {
22 id: root23 id: root
23 width: 40024 width: units.gu(50)
24 height: 60025 height: units.gu(60)
2526
26 property list<Action> actionList: [27 property list<Action> actionList: [
27 Action {28 Action {
28 iconName: "alarm-clock"29 iconName: "alarm-clock"
29 text: "Tick tock"30 text: "Tick tock"
31 onTriggered: print("tock")
30 },32 },
31 Action {33 Action {
32 iconName: "appointment"34 iconName: "appointment"
33 text: "Date"35 text: "Date"
36 onTriggered: print("date")
34 },37 },
35 Action {38 Action {
36 iconName: "attachment"39 iconName: "attachment"
37 text: "Attach"40 text: "Attach"
41 onTriggered: print("attach")
38 },42 },
39 Action {43 Action {
40 iconName: "contact"44 iconName: "contact"
41 text: "Contact"45 text: "Contact"
46 onTriggered: print("contact")
42 },47 },
43 Action {48 Action {
44 iconName: "like"49 iconName: "like"
45 text: "Like"50 text: "Like"
51 onTriggered: print("+1")
46 },52 },
47 Action {53 Action {
48 iconName: "lock"54 iconName: "lock"
49 text: "Lock"55 text: "Lock"
56 onTriggered: print("lock")
57 },
58 Action {
59 iconName: "camcorder"
60 text: "Camera"
61 onTriggered: print("cam")
62 },
63 Action {
64 iconName: "location"
65 text: "Location"
66 onTriggered: print("loc")
67 enabled: false
68 },
69 Action {
70 iconName: "message"
71 text: "Message"
72 onTriggered: print("msg")
73 },
74 Action {
75 iconName: "livetv"
76 text: "Television"
77 onTriggered: print("tv")
78 },
79 Action {
80 iconName: "lock-broken"
81 text: "Unlock"
82 onTriggered: print("unlock")
50 }83 }
51 ]84 ]
5285
@@ -54,10 +87,12 @@
54 Action {87 Action {
55 iconName: "share"88 iconName: "share"
56 text: "Share"89 text: "Share"
90 onTriggered: print("share")
57 },91 },
58 Action {92 Action {
59 iconName: "starred"93 iconName: "starred"
60 text: "Favorite"94 text: "Favorite"
95 onTriggered: print("fav")
61 }96 }
62 ]97 ]
6398
@@ -70,13 +105,12 @@
70 }105 }
71 height: childrenRect.height106 height: childrenRect.height
72107
73 Item {108 RowLayout {
74 width: parent.width109 width: parent.width
75 height: childrenRect.height110 height: childrenRect.height
76111
77 Label {112 Label {
78 anchors {113 anchors {
79 left: parent.left
80 verticalCenter: shortBar.verticalCenter114 verticalCenter: shortBar.verticalCenter
81 }115 }
82 text: "" + shortBar.numberOfSlots + " slot(s):"116 text: "" + shortBar.numberOfSlots + " slot(s):"
@@ -85,18 +119,17 @@
85 ActionBar {119 ActionBar {
86 // no numberOfSlots specified. Using default value.120 // no numberOfSlots specified. Using default value.
87 id: shortBar121 id: shortBar
88 anchors.right: parent.right122 Layout.fillWidth: true
89 actions: root.shortActionList123 actions: root.shortActionList
90 }124 }
91 }125 }
92126
93 Item {127 RowLayout {
94 width: parent.width128 width: parent.width
95 height: childrenRect.height129 height: childrenRect.height
96130
97 Label {131 Label {
98 anchors {132 anchors {
99 left: parent.left
100 verticalCenter: bar.verticalCenter133 verticalCenter: bar.verticalCenter
101 }134 }
102 text: "" + bar.numberOfSlots + " slot(s):"135 text: "" + bar.numberOfSlots + " slot(s):"
@@ -104,9 +137,36 @@
104137
105 ActionBar {138 ActionBar {
106 id: bar139 id: bar
107 anchors.right: parent.right140 Layout.fillWidth: true
108 numberOfSlots: numberOfActionsSlider.value.toFixed(0)141 numberOfSlots: numberOfActionsSlider.value.toFixed(0)
109 actions: root.actionList142 actions: root.actionList
143 }
144 }
145
146 RowLayout {
147 width: parent.width
148 height: childrenRect.height
149 Label {
150 anchors {
151 verticalCenter: coloredBar.verticalCenter
152 }
153 text: "colored:"
154 }
155 ActionBar {
156 id: coloredBar
157 Layout.fillWidth: true
158 numberOfSlots: numberOfActionsSlider.value.toFixed(0)
159 actions: root.actionList
160 StyleHints {
161 ignoreUnknownProperties: false
162 backgroundColor: UbuntuColors.blue
163 buttons {
164 foregroundColor: "white"
165 disabledForegroundColor: UbuntuColors.silk
166 pressedBackgroundColor: UbuntuColors.ash
167 disabledBackgroundColor: UbuntuColors.slate
168 }
169 }
110 }170 }
111 }171 }
112172
@@ -122,20 +182,19 @@
122 live: true182 live: true
123 }183 }
124184
125 Item {185 RowLayout {
126 width: parent.width186 width: parent.width
127 height: childrenRect.height187 height: childrenRect.height
128188
129 Label {189 Label {
130 anchors {190 anchors {
131 left: parent.left
132 verticalCenter: customDelegateBar.verticalCenter191 verticalCenter: customDelegateBar.verticalCenter
133 }192 }
134 text: "Custom delegate"193 text: "Custom delegate"
135 }194 }
136 ActionBar {195 ActionBar {
137 id: customDelegateBar196 id: customDelegateBar
138 anchors.right: parent.right197 Layout.fillWidth: true
139 actions: root.shortActionList198 actions: root.shortActionList
140 delegate: Button {199 delegate: Button {
141 action: modelData200 action: modelData
@@ -146,23 +205,25 @@
146 }205 }
147 }206 }
148207
149 Item {208 RowLayout {
150 width: parent.width209 width: parent.width
151 height: childrenRect.height210 height: childrenRect.height
152 Label {211 Label {
153 anchors {212 anchors {
154 left: parent.left
155 verticalCenter: greenButtonsBar.verticalCenter213 verticalCenter: greenButtonsBar.verticalCenter
156 }214 }
157 text: "Custom delegate 2"215 text: "Custom delegate 2"
158 }216 }
159 ActionBar {217 ActionBar {
218 // Note: The same result (green buttons) can be accomplished
219 // by setting the foregroundColor in the style.
160 id: greenButtonsBar220 id: greenButtonsBar
161 anchors.right: parent.right221 Layout.fillWidth: true
162 actions: root.actionList222 actions: root.actionList
163 delegate: AbstractButton {223 delegate: AbstractButton {
164 styleName: "IconButtonStyle"224 styleName: "IconButtonStyle"
165 action: modelData225 action: modelData
226 height: greenButtonsBar.height
166 StyleHints {227 StyleHints {
167 foregroundColor: UbuntuColors.green228 foregroundColor: UbuntuColors.green
168 }229 }
169230
=== added file 'tests/unit/visual/tst_adaptivepagelayout_param.13.qml'
--- tests/unit/visual/tst_adaptivepagelayout_param.13.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/visual/tst_adaptivepagelayout_param.13.qml 2016-08-14 09:05:30 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import QtTest 1.0
19import Ubuntu.Test 1.3
20import Ubuntu.Components 1.3
21
22AdaptivePageLayout {
23 id: apl
24 width: units.gu(80)
25 height: units.gu(71)
26 asynchronous: false
27
28 primaryPage: Page {
29 header: PageHeader {
30 title: "Test"
31 }
32 }
33
34 Component {
35 id: testPage
36 Page {
37 objectName: "test_page"
38 header: PageHeader {
39 title: "NextPage"
40 }
41 property QtObject model : QtObject { objectName: "test" }
42 }
43 }
44
45 UbuntuTestCase {
46 when: windowShown
47
48 function findPageFromLayout(apl, objectName) {
49 var body = findChild(apl, "body");
50 verify(body);
51 return findChild(body, objectName);
52 }
53
54 function test_parameters_bug1604780() {
55 apl.addPageToCurrentColumn(apl.primaryPage, testPage, {model: null});
56 var page = findPageFromLayout(apl, "test_page");
57 verify(page);
58 compare(page.model, null);
59 }
60 }
61}
62
063
=== modified file 'tests/unit/visual/tst_combobutton.13.qml'
--- tests/unit/visual/tst_combobutton.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_combobutton.13.qml 2016-08-14 09:05:30 +0000
@@ -139,7 +139,7 @@
139 rectCombo.expanded = true;139 rectCombo.expanded = true;
140 waitForRendering(rectCombo);140 waitForRendering(rectCombo);
141 var comboListPanel = findChild(rectCombo, "combobutton_combopanel");141 var comboListPanel = findChild(rectCombo, "combobutton_combopanel");
142 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);142 tryCompareFunction(function() { return comboListPanel.visible}, true);
143 }143 }
144144
145 function test_expandRectComboThroughClick() {145 function test_expandRectComboThroughClick() {
@@ -148,7 +148,7 @@
148 waitForRendering(rectCombo);148 waitForRendering(rectCombo);
149 compare(rectCombo.expanded, true, "combo is not expanded");149 compare(rectCombo.expanded, true, "combo is not expanded");
150 var comboListPanel = findChild(rectCombo, "combobutton_combopanel");150 var comboListPanel = findChild(rectCombo, "combobutton_combopanel");
151 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);151 tryCompareFunction(function() { return comboListPanel.visible}, true);
152 }152 }
153153
154 function test_autoCollapse() {154 function test_autoCollapse() {
@@ -157,12 +157,12 @@
157 mouseClick(dropDown, dropDown.width / 2, dropDown.height / 2);157 mouseClick(dropDown, dropDown.width / 2, dropDown.height / 2);
158 waitForRendering(rectCombo);158 waitForRendering(rectCombo);
159 compare(rectCombo.expanded, true, "combo is not expanded");159 compare(rectCombo.expanded, true, "combo is not expanded");
160 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);160 tryCompareFunction(function() { return comboListPanel.visible}, true);
161161
162 mouseClick(rectCombo, rectCombo.width / 2, rectCombo.collapsedHeight / 2);162 mouseClick(rectCombo, rectCombo.width / 2, rectCombo.collapsedHeight / 2);
163 waitForRendering(rectCombo);163 waitForRendering(rectCombo);
164 compare(rectCombo.expanded, false, "combo is not collapsed");164 compare(rectCombo.expanded, false, "combo is not collapsed");
165 tryCompareFunction(function() { return comboListPanel.opacity}, 0.0);165 tryCompareFunction(function() { return comboListPanel.visible}, false);
166 }166 }
167167
168 function test_flickRectCombo() {168 function test_flickRectCombo() {
@@ -174,7 +174,7 @@
174 var comboList = findChild(rectCombo, "combobutton_combolist");174 var comboList = findChild(rectCombo, "combobutton_combolist");
175 mouseClick(dropDown, dropDown.width / 2, dropDown.height / 2);175 mouseClick(dropDown, dropDown.width / 2, dropDown.height / 2);
176 waitForRendering(rectCombo);176 waitForRendering(rectCombo);
177 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);177 tryCompareFunction(function() { return comboListPanel.visible}, true);
178 verify(comboList.height > rectCombo.expandedHeight);178 verify(comboList.height > rectCombo.expandedHeight);
179 // comboList flicker is the combolist parent's parent179 // comboList flicker is the combolist parent's parent
180 var comboListFlicker = findChild(rectCombo, "combobutton_contentflicker");180 var comboListFlicker = findChild(rectCombo, "combobutton_contentflicker");
@@ -196,10 +196,11 @@
196 var comboList = findChild(columnCombo, "combobutton_combolist");196 var comboList = findChild(columnCombo, "combobutton_combolist");
197 columnCombo.expanded = true;197 columnCombo.expanded = true;
198 waitForRendering(columnCombo);198 waitForRendering(columnCombo);
199 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);199 tryCompareFunction(function() { return comboListPanel.visible}, true);
200 var comboListFlicker = findChild(columnCombo, "combobutton_contentflicker");200 var comboListFlicker = findChild(columnCombo, "combobutton_contentflicker");
201 waitForRendering(comboListFlicker);
201 compare(comboListFlicker.interactive, false, "combo list holder must not be interactive");202 compare(comboListFlicker.interactive, false, "combo list holder must not be interactive");
202 compare(comboListFlicker.height, columnCombo.comboListHeight, "combo list height differs from the holder height");203 tryCompare(comboListFlicker, 'height', columnCombo.comboListHeight, 500, "combo list height differs from the holder height");
203 }204 }
204205
205 function test_emptyComboExpanded() {206 function test_emptyComboExpanded() {
@@ -208,7 +209,7 @@
208 combo.expanded = true;209 combo.expanded = true;
209 waitForRendering(combo);210 waitForRendering(combo);
210 waitForRendering(comboListPanel);211 waitForRendering(comboListPanel);
211 tryCompareFunction(function() { return comboListPanel.opacity}, 0.0, 1000);212 tryCompareFunction(function() { return comboListPanel.visible}, false, 1000);
212 }213 }
213214
214 function test_longCombo() {215 function test_longCombo() {
@@ -217,7 +218,7 @@
217 longCombo.expanded = true;218 longCombo.expanded = true;
218 waitForRendering(longCombo);219 waitForRendering(longCombo);
219 waitForRendering(comboListPanel);220 waitForRendering(comboListPanel);
220 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);221 tryCompareFunction(function() { return comboListPanel.visible}, true);
221 verify(comboListPanel.height < longCombo.expandedHeight);222 verify(comboListPanel.height < longCombo.expandedHeight);
222 }223 }
223224
@@ -227,9 +228,21 @@
227 listCombo.expanded = true;228 listCombo.expanded = true;
228 waitForRendering(listCombo);229 waitForRendering(listCombo);
229 waitForRendering(comboListPanel);230 waitForRendering(comboListPanel);
230 tryCompareFunction(function() { return comboListPanel.opacity}, 1.0);231 tryCompareFunction(function() { return comboListPanel.visible}, true);
231232
232 compare(list.height, comboList.height, "list and comboList height differs");233 compare(list.height, comboList.height, "list and comboList height differs");
233 }234 }
235
236 function test_expand_via_keyboard() {
237 rectCombo.forceActiveFocus();
238 waitForRendering(rectCombo);
239 tryCompare(rectCombo, 'expanded', false, 500, "ComboBox not expanded after focus");
240 keyClick(Qt.Key_Space);
241 waitForRendering(rectCombo);
242 verify(rectCombo.expanded, true, "ComboBox was expanded via the Space key");
243 keyClick(Qt.Key_Space);
244 waitForRendering(rectCombo);
245 tryCompare(rectCombo, 'expanded', false, 500, "ComboBox was collapsed via the Space key");
246 }
234 }247 }
235}248}
236249
=== modified file 'tests/unit/visual/tst_focus.13.qml'
--- tests/unit/visual/tst_focus.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_focus.13.qml 2016-08-14 09:05:30 +0000
@@ -279,6 +279,8 @@
279 {tag: "ActionBar", from: 'actionBarShare_button', to: picker, key: Qt.Key_Tab},279 {tag: "ActionBar", from: 'actionBarShare_button', to: picker, key: Qt.Key_Tab},
280 {tag: "ActionBar(back)", from: picker, to: 'actionBarShare_button', key: Qt.Key_Backtab},280 {tag: "ActionBar(back)", from: picker, to: 'actionBarShare_button', key: Qt.Key_Backtab},
281 */281 */
282 {tag: "ComboButton", from: pickerPanel, to: comboButton, key: Qt.Key_Tab},
283 {tag: "ComboButton(back)", from: comboButton, to: pickerPanel, key: Qt.Key_Backtab},
282 // Left click/ tap284 // Left click/ tap
283 {tag: "TextField(click)", from: dummy, to: textField, key: Qt.LeftButton},285 {tag: "TextField(click)", from: dummy, to: textField, key: Qt.LeftButton},
284 {tag: "TextArea(click)", from: dummy, to: textArea, key: Qt.LeftButton},286 {tag: "TextArea(click)", from: dummy, to: textArea, key: Qt.LeftButton},
@@ -370,10 +372,11 @@
370372
371 var center = centerOf(dropdownButton);373 var center = centerOf(dropdownButton);
372 mouseClick(dropdownButton, center.x, center.y);374 mouseClick(dropdownButton, center.x, center.y);
375 waitForRendering(dropdownButton);
373 waitForRendering(comboButton);376 waitForRendering(comboButton);
374 // FIXME: lp#1368390: Buttons shouldn't grab input focus on click377 // FIXME: lp#1368390: Buttons shouldn't grab input focus on click
375 compare(dropdownButton.focus, true, "Dropdown button hasn't got focused!");378 compare(dropdownButton.activeFocus, false, "Dropdown button hasn't got focused!");
376 compare(comboButton.focus, true, "ComboButton hasn't been focused!");379 compare(comboButton.activeFocus, true, "ComboButton hasn't been focused!");
377 comboButton.expanded = false;380 comboButton.expanded = false;
378 waitForRendering(comboButton);381 waitForRendering(comboButton);
379 }382 }
@@ -448,6 +451,9 @@
448 {tag: "ListItem/Enter", key: Qt.Key_Enter, item: listItem, signalName: 'onClicked'},451 {tag: "ListItem/Enter", key: Qt.Key_Enter, item: listItem, signalName: 'onClicked'},
449 {tag: "ListItem/Return", key: Qt.Key_Return, item: listItem, signalName: 'onClicked'},452 {tag: "ListItem/Return", key: Qt.Key_Return, item: listItem, signalName: 'onClicked'},
450 {tag: "ListItem/Space", key: Qt.Key_Space, item: listItem, signalName: 'onClicked'},453 {tag: "ListItem/Space", key: Qt.Key_Space, item: listItem, signalName: 'onClicked'},
454 {tag: "ComboButton/Enter", key: Qt.Key_Enter, item: button , signalName: 'onTriggered'},
455 {tag: "ComboButton/Return", key: Qt.Key_Return, item: button, signalName: 'onTriggered'},
456 {tag: "ComboButton/Space", key: Qt.Key_Space, item: button, signalName: 'onTriggered'},
451 ];457 ];
452 }458 }
453 function test_trigger_via_keyboard(data) {459 function test_trigger_via_keyboard(data) {
454460
=== modified file 'tests/unit/visual/tst_listitem.12.qml'
--- tests/unit/visual/tst_listitem.12.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_listitem.12.qml 2016-08-14 09:05:30 +0000
@@ -245,7 +245,7 @@
245245
246 function test_0_defaults() {246 function test_0_defaults() {
247 verify(defaults.contentItem !== null, "Defaults is null");247 verify(defaults.contentItem !== null, "Defaults is null");
248 compare(defaults.color, "#000000", "Transparent by default");248 compare(defaults.color.toString(), Qt.rgba(0.0, 0.0, 0.0, 0.0).toString(), "Transparent by default");
249 compare(defaults.highlightColor, theme.palette.selected.background, "theme.palette.selected.background color by default")249 compare(defaults.highlightColor, theme.palette.selected.background, "theme.palette.selected.background color by default")
250 compare(defaults.highlighted, false, "Not highlighted by default");250 compare(defaults.highlighted, false, "Not highlighted by default");
251 compare(defaults.divider.visible, true, "divider is visible by default");251 compare(defaults.divider.visible, true, "divider is visible by default");
252252
=== modified file 'tests/unit/visual/tst_listitem.13.qml'
--- tests/unit/visual/tst_listitem.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_listitem.13.qml 2016-08-14 09:05:30 +0000
@@ -245,7 +245,7 @@
245245
246 function test_0_defaults() {246 function test_0_defaults() {
247 verify(defaults.contentItem !== null, "Defaults is null");247 verify(defaults.contentItem !== null, "Defaults is null");
248 compare(defaults.color, "#000000", "Transparent by default");248 compare(defaults.color.toString(), Qt.rgba(0.0, 0.0, 0.0, 0.0).toString(), "Transparent by default");
249 compare(defaults.highlightColor, theme.palette.selected.background, "theme.palette.selected.background color by default")249 compare(defaults.highlightColor, theme.palette.selected.background, "theme.palette.selected.background color by default")
250 compare(defaults.highlighted, false, "Not highlighted by default");250 compare(defaults.highlighted, false, "Not highlighted by default");
251 compare(defaults.divider.visible, true, "divider is visible by default");251 compare(defaults.divider.visible, true, "divider is visible by default");
252252
=== modified file 'tests/unit/visual/tst_listitem_focus.13.qml'
--- tests/unit/visual/tst_listitem_focus.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_listitem_focus.13.qml 2016-08-14 09:05:30 +0000
@@ -27,27 +27,125 @@
2727
28 property Item activeFocusItem: Window.activeFocusItem28 property Item activeFocusItem: Window.activeFocusItem
2929
30 PageHeader {
31 id: header
32 title: "ListItem focus test"
33 extension: Sections {
34 id: directionSections
35 width: parent.width
36 selectedIndex: -1
37 function setupListView(showContent, orientation, reverseDirection) {
38 testCase.cleanup();
39 var test = testCase.loadTest(listView);
40 test.orientation = orientation;
41 if (reverseDirection) {
42 if (orientation === ListView.Horizontal) {
43 test.layoutDirection = Qt.RightToLeft;
44 } else {
45 test.verticalLayoutDirection = ListView.BottomToTop;
46 }
47 }
48 if (showContent) {
49 test.delegate = listItemWithContent;
50 } else {
51 test.delegate = simpleListItem;
52 }
53 }
54
55 actions: [
56 Action {
57 text: "TopToBottom"
58 onTriggered: directionSections.setupListView(switchContentAction.showContent,
59 ListView.Vertical, false);
60 },
61 Action {
62 text: "LeftToRight"
63 onTriggered: directionSections.setupListView(switchContentAction.showContent,
64 ListView.Horizontal, false);
65 },
66 Action {
67 text: "BottomToTop"
68 onTriggered: directionSections.setupListView(switchContentAction.showContent,
69 ListView.Vertical, true);
70 },
71 Action {
72 text: "RightToLeft"
73 onTriggered: directionSections.setupListView(switchContentAction.showContent,
74 ListView.Horizontal, true);
75 }
76
77 ]
78 }
79 trailingActionBar.actions: [
80 Action {
81 id: switchContentAction
82 property bool showContent: false
83 iconName: showContent ? "select" : "select-none"
84 onTriggered: {
85 showContent = !showContent;
86 if (directionSections.selectedIndex >= 0) {
87 directionSections.actions[directionSections.selectedIndex].trigger();
88 }
89 }
90 }
91 ]
92 }
93
30 Rectangle {94 Rectangle {
31 id: topItem95 id: topFocusItem
32 objectName: "topItem"96 objectName: "topFocusItem"
33 activeFocusOnTab: true97 activeFocusOnTab: true
34 width: parent.width98 anchors {
99 left: parent.left
100 right: parent.right
101 top: header.bottom
102 }
35 height: units.gu(2)103 height: units.gu(2)
104 border {
105 width: units.dp(3)
106 color: topFocusItem.activeFocus ? UbuntuColors.orange : UbuntuColors.silk
107 }
36 }108 }
37
38 Loader {109 Loader {
39 id: testLoader110 id: testLoader
40 anchors {111 anchors {
41 fill: parent112 left: parent.left
42 topMargin: topItem.height113 right: parent.right
114 top: topFocusItem.bottom
115 bottom: bottomFocusItem.top
116 }
117 clip: true
118 }
119 Rectangle {
120 id: bottomFocusItem
121 objectName: "bottomFocusItem"
122 activeFocusOnTab: true
123 anchors {
124 left: parent.left
125 right: parent.right
126 bottom: parent.bottom
127 }
128 height: units.gu(2)
129 border {
130 width: units.dp(3)
131 color: bottomFocusItem.activeFocus ? UbuntuColors.orange : UbuntuColors.silk
43 }132 }
44 }133 }
45134
46 Component {135 Component {
47 id: simpleListItem136 id: simpleListItem
48 ListItem {137 ListItem {
138 id: listItem
49 objectName: "simple" + index139 objectName: "simple" + index
50 property int itemIndex: index140 property int itemIndex: index
141 Label {
142 anchors {
143 left: parent.left
144 leftMargin: units.gu(2)
145 verticalCenter: parent.verticalCenter
146 }
147 text: listItem.objectName
148 }
51 }149 }
52 }150 }
53151
@@ -61,7 +159,7 @@
61 spacing: units.gu(1)159 spacing: units.gu(1)
62 CheckBox { objectName: "checkbox" + listItem.itemIndex }160 CheckBox { objectName: "checkbox" + listItem.itemIndex }
63 Switch { objectName: "switch" + listItem.itemIndex }161 Switch { objectName: "switch" + listItem.itemIndex }
64 Button { objectName: "button" + listItem.itemIndex; text: "test" }162 Button { objectName: "button" + listItem.itemIndex; text: "test " + itemIndex }
65 }163 }
66 leadingActions: ListItemActions {164 leadingActions: ListItemActions {
67 actions: Action {165 actions: Action {
@@ -100,6 +198,7 @@
100 }198 }
101199
102 ListItemTestCase13 {200 ListItemTestCase13 {
201 id: testCase
103 name: "ListItemFocus"202 name: "ListItemFocus"
104 when: windowShown203 when: windowShown
105204
@@ -114,7 +213,7 @@
114 wait(200);213 wait(200);
115 }214 }
116 function init() {215 function init() {
117 topItem.forceActiveFocus(Qt.TabFocusReason);216 topFocusItem.forceActiveFocus(Qt.TabFocusReason);
118 }217 }
119218
120 function initTestCase() {219 function initTestCase() {
@@ -124,10 +223,10 @@
124 // Tab/Backtab focuses the First ListItem in a ListView223 // Tab/Backtab focuses the First ListItem in a ListView
125 function test_focusing_listview_focuses_first_item_data() {224 function test_focusing_listview_focuses_first_item_data() {
126 return [225 return [
127 {tag: "Tab, no content", preFocus: topItem, delegate: simpleListItem, key: Qt.Key_Tab, focusItem: "simple0"},226 {tag: "Tab, no content", preFocus: topFocusItem, delegate: simpleListItem, key: Qt.Key_Tab, focusItem: "simple0"},
128 {tag: "Tab, with content", preFocus: topItem, delegate: listItemWithContent, key: Qt.Key_Tab, focusItem: "withContent0"},227 {tag: "Tab, with content", preFocus: topFocusItem, delegate: listItemWithContent, key: Qt.Key_Tab, focusItem: "withContent0"},
129 {tag: "Backtab, no content", preFocus: topItem, delegate: simpleListItem, key: Qt.Key_Backtab, focusItem: "simple0"},228 {tag: "Backtab, no content", preFocus: bottomFocusItem, delegate: simpleListItem, key: Qt.Key_Backtab, focusItem: "simple0"},
130 {tag: "Backtab, with content", preFocus: topItem, delegate: listItemWithContent, key: Qt.Key_Backtab, focusItem: "withContent0"},229 {tag: "Backtab, with content", preFocus: bottomFocusItem, delegate: listItemWithContent, key: Qt.Key_Backtab, focusItem: "withContent0"},
131 ];230 ];
132 }231 }
133 function test_focusing_listview_focuses_first_item(data) {232 function test_focusing_listview_focuses_first_item(data) {
@@ -155,6 +254,15 @@
155 keyTimes: 3,254 keyTimes: 3,
156 focusItems: ["simple1", "simple2", "simple3"]255 focusItems: ["simple1", "simple2", "simple3"]
157 },256 },
257 { tag: "BottomToTop up, no content, bottom to top direction, from beginning",
258 delegate: simpleListItem,
259 orientation: ListView.Vertical,
260 direction: ListView.BottomToTop,
261 initialIndex: 0,
262 key: Qt.Key_Up,
263 keyTimes: 3,
264 focusItems: ["simple1", "simple2", "simple3"]
265 },
158 {266 {
159 tag: "Down, no contents, near end",267 tag: "Down, no contents, near end",
160 delegate: simpleListItem,268 delegate: simpleListItem,
@@ -165,6 +273,17 @@
165 // Don't navigate beyond the last item:273 // Don't navigate beyond the last item:
166 focusItems: ["simple"+(n-2), "simple"+(n-1), "simple"+(n-1)]274 focusItems: ["simple"+(n-2), "simple"+(n-1), "simple"+(n-1)]
167 },275 },
276 {
277 tag: "BottomToTop up, no contents, near end",
278 delegate: simpleListItem,
279 orientation: ListView.Vertical,
280 direction: ListView.BottomToTop,
281 initialIndex: n - 3,
282 key: Qt.Key_Up,
283 keyTimes: 3,
284 // Don't navigate beyond the last item:
285 focusItems: ["simple"+(n-2), "simple"+(n-1), "simple"+(n-1)]
286 },
168 { tag: "Up, no content, near beginning",287 { tag: "Up, no content, near beginning",
169 delegate: simpleListItem,288 delegate: simpleListItem,
170 orientation: ListView.Vertical,289 orientation: ListView.Vertical,
@@ -173,6 +292,15 @@
173 keyTimes: 3,292 keyTimes: 3,
174 focusItems: ["simple1", "simple0", "simple0"]293 focusItems: ["simple1", "simple0", "simple0"]
175 },294 },
295 { tag: "BottomToTop down, no content, near beginning",
296 delegate: simpleListItem,
297 orientation: ListView.Vertical,
298 direction: ListView.BottomToTop,
299 initialIndex: 2,
300 key: Qt.Key_Down,
301 keyTimes: 3,
302 focusItems: ["simple1", "simple0", "simple0"]
303 },
176 {304 {
177 tag: "Up, no contents, from end",305 tag: "Up, no contents, from end",
178 delegate: simpleListItem,306 delegate: simpleListItem,
@@ -182,6 +310,16 @@
182 keyTimes: 3,310 keyTimes: 3,
183 focusItems: ["simple"+(n-2), "simple"+(n-3), "simple"+(n-4)]311 focusItems: ["simple"+(n-2), "simple"+(n-3), "simple"+(n-4)]
184 },312 },
313 {
314 tag: "BottomToTop down, no contents, from end",
315 delegate: simpleListItem,
316 orientation: ListView.Vertical,
317 direction: ListView.BottomToTop,
318 initialIndex: n - 1,
319 key: Qt.Key_Down,
320 keyTimes: 3,
321 focusItems: ["simple"+(n-2), "simple"+(n-3), "simple"+(n-4)]
322 },
185 { tag: "Left, no content, near beginning",323 { tag: "Left, no content, near beginning",
186 delegate: simpleListItem,324 delegate: simpleListItem,
187 orientation: ListView.Horizontal,325 orientation: ListView.Horizontal,
@@ -190,6 +328,15 @@
190 keyTimes: 3,328 keyTimes: 3,
191 focusItems: ["simple1", "simple0", "simple0"]329 focusItems: ["simple1", "simple0", "simple0"]
192 },330 },
331 { tag: "RightToLeft right, no content, near beginning",
332 delegate: simpleListItem,
333 orientation: ListView.Horizontal,
334 direction: Qt.RightToLeft,
335 initialIndex: 2,
336 key: Qt.Key_Right,
337 keyTimes: 3,
338 focusItems: ["simple1", "simple0", "simple0"]
339 },
193 { tag: "Left, no content, from end",340 { tag: "Left, no content, from end",
194 delegate: simpleListItem,341 delegate: simpleListItem,
195 orientation: ListView.Horizontal,342 orientation: ListView.Horizontal,
@@ -198,6 +345,15 @@
198 keyTimes: 3,345 keyTimes: 3,
199 focusItems: ["simple"+(n-2), "simple"+(n-3), "simple"+(n-4)]346 focusItems: ["simple"+(n-2), "simple"+(n-3), "simple"+(n-4)]
200 },347 },
348 { tag: "RightToLeft right, no content, from end",
349 delegate: simpleListItem,
350 orientation: ListView.Horizontal,
351 direction: Qt.RightToLeft,
352 initialIndex: n - 1,
353 key: Qt.Key_Right,
354 keyTimes: 3,
355 focusItems: ["simple"+(n-2), "simple"+(n-3), "simple"+(n-4)]
356 },
201 { tag: "Right, no content, from beginning",357 { tag: "Right, no content, from beginning",
202 delegate: simpleListItem,358 delegate: simpleListItem,
203 orientation: ListView.Horizontal,359 orientation: ListView.Horizontal,
@@ -206,6 +362,15 @@
206 keyTimes: 5,362 keyTimes: 5,
207 focusItems: ["simple1", "simple2", "simple3", "simple4", "simple5"]363 focusItems: ["simple1", "simple2", "simple3", "simple4", "simple5"]
208 },364 },
365 { tag: "RightToLeft left, no content, from beginning",
366 delegate: simpleListItem,
367 orientation: ListView.Horizontal,
368 direction: Qt.RightToLeft,
369 initialIndex: 0,
370 key: Qt.Key_Left,
371 keyTimes: 5,
372 focusItems: ["simple1", "simple2", "simple3", "simple4", "simple5"]
373 },
209 { tag: "Right, no content, near end",374 { tag: "Right, no content, near end",
210 delegate: simpleListItem,375 delegate: simpleListItem,
211 orientation: ListView.Horizontal,376 orientation: ListView.Horizontal,
@@ -214,6 +379,15 @@
214 keyTimes: 2,379 keyTimes: 2,
215 focusItems: ["simple"+(n-2), "simple"+(n-1), "simple"+(n-1)]380 focusItems: ["simple"+(n-2), "simple"+(n-1), "simple"+(n-1)]
216 },381 },
382 { tag: "RightToLeft left, no content, near end",
383 delegate: simpleListItem,
384 orientation: ListView.Horizontal,
385 direction: Qt.RightToLeft,
386 initialIndex: n - 3,
387 key: Qt.Key_Left,
388 keyTimes: 2,
389 focusItems: ["simple"+(n-2), "simple"+(n-1), "simple"+(n-1)]
390 },
217 { tag: "Down, with content, from beginning",391 { tag: "Down, with content, from beginning",
218 delegate: listItemWithContent,392 delegate: listItemWithContent,
219 orientation: ListView.Vertical,393 orientation: ListView.Vertical,
@@ -222,6 +396,15 @@
222 keyTimes: 3,396 keyTimes: 3,
223 focusItems: ["withContent1", "withContent2", "withContent3"]397 focusItems: ["withContent1", "withContent2", "withContent3"]
224 },398 },
399 { tag: "BottomToTop up, with content, from beginning",
400 delegate: listItemWithContent,
401 orientation: ListView.Vertical,
402 direction: ListView.BottomToTop,
403 initialIndex: 0,
404 key: Qt.Key_Up,
405 keyTimes: 3,
406 focusItems: ["withContent1", "withContent2", "withContent3"]
407 },
225 { tag: "Down, with content, near end",408 { tag: "Down, with content, near end",
226 delegate: listItemWithContent,409 delegate: listItemWithContent,
227 orientation: ListView.Vertical,410 orientation: ListView.Vertical,
@@ -230,6 +413,15 @@
230 keyTimes: 3,413 keyTimes: 3,
231 focusItems: ["withContent"+(n-2), "withContent"+(n-1), "withContent"+(n-1)]414 focusItems: ["withContent"+(n-2), "withContent"+(n-1), "withContent"+(n-1)]
232 },415 },
416 { tag: "BottomToTop up, with content, near end",
417 delegate: listItemWithContent,
418 orientation: ListView.Vertical,
419 direction: ListView.BottomToTop,
420 initialIndex: n - 3,
421 key: Qt.Key_Up,
422 keyTimes: 3,
423 focusItems: ["withContent"+(n-2), "withContent"+(n-1), "withContent"+(n-1)]
424 },
233 { tag: "Up, with content, near beginning",425 { tag: "Up, with content, near beginning",
234 delegate: listItemWithContent,426 delegate: listItemWithContent,
235 orientation: ListView.Vertical,427 orientation: ListView.Vertical,
@@ -238,6 +430,15 @@
238 keyTimes: 3,430 keyTimes: 3,
239 focusItems: ["withContent1", "withContent0", "withContent0"]431 focusItems: ["withContent1", "withContent0", "withContent0"]
240 },432 },
433 { tag: "BottomToTop down, with content, near beginning",
434 delegate: listItemWithContent,
435 orientation: ListView.Vertical,
436 direction: ListView.BottomToTop,
437 initialIndex: 2,
438 key: Qt.Key_Down,
439 keyTimes: 3,
440 focusItems: ["withContent1", "withContent0", "withContent0"]
441 },
241 { tag: "Up, with content, from end",442 { tag: "Up, with content, from end",
242 delegate: listItemWithContent,443 delegate: listItemWithContent,
243 orientation: ListView.Vertical,444 orientation: ListView.Vertical,
@@ -245,6 +446,15 @@
245 key: Qt.Key_Up,446 key: Qt.Key_Up,
246 keyTimes: 2,447 keyTimes: 2,
247 focusItems: ["withContent"+(n-2), "withContent"+(n-3)]448 focusItems: ["withContent"+(n-2), "withContent"+(n-3)]
449 },
450 { tag: "BottomToTop down, with content, from end",
451 delegate: listItemWithContent,
452 orientation: ListView.Vertical,
453 direction: ListView.BottomToTop,
454 initialIndex: n - 1,
455 key: Qt.Key_Down,
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: