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
=== modified file 'modules/Ubuntu/Components/ListItems/Expandable.qml'
--- modules/Ubuntu/Components/ListItems/Expandable.qml 2014-02-26 09:46:30 +0000
+++ modules/Ubuntu/Components/ListItems/Expandable.qml 2014-03-17 16:43:33 +0000
@@ -212,6 +212,12 @@
212 anchors { left: parent.left; top: parent.top; right: parent.right }212 anchors { left: parent.left; top: parent.top; right: parent.right }
213 enabled: root.collapseOnClick && root.expanded213 enabled: root.collapseOnClick && root.expanded
214 height: root.collapsedHeight214 height: root.collapsedHeight
215 onClicked: root.expanded = false;215 onClicked: {
216 if (priv.isInExpandableListView) {
217 priv.view.expandedIndex = -1;
218 } else {
219 root.expanded = false;
220 }
221 }
216 }222 }
217}223}
218224
=== modified file 'tests/unit_x11/tst_components/tst_ubuntulistview.qml'
--- tests/unit_x11/tst_components/tst_ubuntulistview.qml 2014-03-05 16:58:40 +0000
+++ tests/unit_x11/tst_components/tst_ubuntulistview.qml 2014-03-17 16:43:33 +0000
@@ -189,6 +189,20 @@
189 189
190 }190 }
191191
192 function test_collapseOnClick() {
193 var item = findChild(ubuntuListView, "expandable1");
194 item.collapseOnClick = true;
195 expandItem(item);
196
197 compare(ubuntuListView.expandedIndex, 1);
198
199 mouseClick(item, item.width / 2, item.collapsedHeight / 2);
200 tryCompare(ubuntuListView, "expandedIndex", -1);
201
202 // restore stuff we've changed
203 item.collapseOnClick = false;
204 }
205
192 function cleanup() {206 function cleanup() {
193 // Restore listview height207 // Restore listview height
194 ubuntuListView.height = units.gu(60);208 ubuntuListView.height = units.gu(60);

Subscribers

People subscribed via source and target branches

to status/vote changes: