Merge lp:~mzanetti/ubuntu-ui-toolkit/fix-collapseOnClick-with-ubuntulistview into lp:ubuntu-ui-toolkit

Proposed by Michael Zanetti
Status: Merged
Merged at revision: 995
Proposed branch: lp:~mzanetti/ubuntu-ui-toolkit/fix-collapseOnClick-with-ubuntulistview
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 42 lines (+21/-1)
2 files modified
modules/Ubuntu/Components/ListItems/Expandable.qml (+7/-1)
tests/unit_x11/tst_components/tst_ubuntulistview.qml (+14/-0)
To merge this branch: bzr merge lp:~mzanetti/ubuntu-ui-toolkit/fix-collapseOnClick-with-ubuntulistview
Reviewer Review Type Date Requested Status
Zsombor Egri Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+211363@code.launchpad.net

Commit message

fix collapseOnClick in combination with UbuntuListView

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.

N/A

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

Yes.

* Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

Yes.

* Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ui-toolkit) on device or emulator?

No. Waiting for Ci@home.

* If you changed the UI, was the change specified/approved by design?

N/A

* If you changed the packaging (debian), did you subscribe a core-dev to this MP?

N/A

To post a comment you must log in.
978. By Michael Zanetti

added a test for the fix

Revision history for this message
Martin Kaistra (djfun) wrote :

fixes the problems in http://paste.ubuntu.com/7109005/ for me

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Seems to be doing the job! Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/ListItems/Expandable.qml'
2--- modules/Ubuntu/Components/ListItems/Expandable.qml 2014-02-26 09:46:30 +0000
3+++ modules/Ubuntu/Components/ListItems/Expandable.qml 2014-03-17 16:43:33 +0000
4@@ -212,6 +212,12 @@
5 anchors { left: parent.left; top: parent.top; right: parent.right }
6 enabled: root.collapseOnClick && root.expanded
7 height: root.collapsedHeight
8- onClicked: root.expanded = false;
9+ onClicked: {
10+ if (priv.isInExpandableListView) {
11+ priv.view.expandedIndex = -1;
12+ } else {
13+ root.expanded = false;
14+ }
15+ }
16 }
17 }
18
19=== modified file 'tests/unit_x11/tst_components/tst_ubuntulistview.qml'
20--- tests/unit_x11/tst_components/tst_ubuntulistview.qml 2014-03-05 16:58:40 +0000
21+++ tests/unit_x11/tst_components/tst_ubuntulistview.qml 2014-03-17 16:43:33 +0000
22@@ -189,6 +189,20 @@
23
24 }
25
26+ function test_collapseOnClick() {
27+ var item = findChild(ubuntuListView, "expandable1");
28+ item.collapseOnClick = true;
29+ expandItem(item);
30+
31+ compare(ubuntuListView.expandedIndex, 1);
32+
33+ mouseClick(item, item.width / 2, item.collapsedHeight / 2);
34+ tryCompare(ubuntuListView, "expandedIndex", -1);
35+
36+ // restore stuff we've changed
37+ item.collapseOnClick = false;
38+ }
39+
40 function cleanup() {
41 // Restore listview height
42 ubuntuListView.height = units.gu(60);

Subscribers

People subscribed via source and target branches

to status/vote changes: