Merge lp:~daker/ubuntu-ui-toolkit/fix.1341559 into lp:ubuntu-ui-toolkit/staging

Proposed by Adnane Belmadiaf on 2017-02-17
Status: Merged
Approved by: Christian Dywan on 2017-02-21
Approved revision: 2177
Merged at revision: 2175
Proposed branch: lp:~daker/ubuntu-ui-toolkit/fix.1341559
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 50 lines (+16/-0)
3 files modified
components.api (+1/-0)
src/imports/Components/1.3/OptionSelector.qml (+6/-0)
tests/unit/visual/tst_optionselector.13.qml (+9/-0)
To merge this branch: bzr merge lp:~daker/ubuntu-ui-toolkit/fix.1341559
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve on 2017-02-21
Christian Dywan (community) 2017-02-17 Approve on 2017-02-21
Review via email: mp+317568@code.launchpad.net

Commit message

Add count prop to OptionSelector

Description of the change

Add count prop to OptionSelector

To post a comment you must log in.
Christian Dywan (kalikiana) wrote :

Can we have a unit test in tests/unit/visual/tst_optionselector.13.qml verifying that the count is correct?

review: Needs Fixing
2175. By Adnane Belmadiaf on 2017-02-20

Fix components.api

2176. By Adnane Belmadiaf on 2017-02-20

Add test for the OptionSelector count prop

Christian Dywan (kalikiana) wrote :

Looks good! Let's see if Jenkins agrees.

review: Approve
Christian Dywan (kalikiana) wrote :

@@ -731,6 +731,7 @@ Ubuntu.Components.OptionSelector 1.0 0.1
 Ubuntu.Components.OptionSelector 1.3: Empty
     property bool colourImage
     property double containerHeight
+ readonly property int count
     property bool currentlyExpanded
     property Component delegate
     property bool expanded
@@ -740,7 +741,6 @@ Ubuntu.Components.OptionSelector 1.3: Em
     property var model
     property bool multiSelection
     property int selectedIndex
- readonly property int count
 Ubuntu.Components.OptionSelectorDelegate 1.0 0.1: Empty
     property color assetColour
     property bool colourImage
Differences in API. Did you forget to update components.api?

review: Needs Fixing
2177. By Adnane Belmadiaf on 2017-02-21

Fix components.api

Christian Dywan (kalikiana) wrote :

Sweet! Thanks for fixing!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2017-01-26 11:59:45 +0000
+++ components.api 2017-02-21 14:57:14 +0000
@@ -731,6 +731,7 @@
731Ubuntu.Components.OptionSelector 1.3: Empty731Ubuntu.Components.OptionSelector 1.3: Empty
732 property bool colourImage732 property bool colourImage
733 property double containerHeight733 property double containerHeight
734 readonly property int count
734 property bool currentlyExpanded735 property bool currentlyExpanded
735 property Component delegate736 property Component delegate
736 property bool expanded737 property bool expanded
737738
=== modified file 'src/imports/Components/1.3/OptionSelector.qml'
--- src/imports/Components/1.3/OptionSelector.qml 2016-08-22 10:18:57 +0000
+++ src/imports/Components/1.3/OptionSelector.qml 2017-02-21 14:57:14 +0000
@@ -155,6 +155,12 @@
155 }155 }
156156
157 /*!157 /*!
158 \qmlproperty int count
159 This property holds the number of items in the OptionSelector.
160 */
161 property alias count: list.count
162
163 /*!
158 \qmlproperty int selectedIndex164 \qmlproperty int selectedIndex
159 The index of the currently selected element in our list.165 The index of the currently selected element in our list.
160 */166 */
161167
=== modified file 'tests/unit/visual/tst_optionselector.13.qml'
--- tests/unit/visual/tst_optionselector.13.qml 2016-09-19 11:13:19 +0000
+++ tests/unit/visual/tst_optionselector.13.qml 2017-02-21 14:57:14 +0000
@@ -183,8 +183,17 @@
183 function test_custom_data() {183 function test_custom_data() {
184 return test_arrow_select_data()184 return test_arrow_select_data()
185 }185 }
186
186 function test_custom(data) {187 function test_custom(data) {
187 test_arrow_select(data, customSelector, 2);188 test_arrow_select(data, customSelector, 2);
188 }189 }
190
191 function test_count() {
192 var selector = defaultSelector;
193 sections.selectedIndex = 0;
194 selector.forceActiveFocus();
195 waitForRendering(selector);
196 compare(selector.count, customModel.count);
197 }
189 }198 }
190}199}

Subscribers

People subscribed via source and target branches