Merge lp:~unity-team/ubuntu-ui-toolkit/fix-1240019 into lp:ubuntu-ui-toolkit

Proposed by Michał Sawicz
Status: Rejected
Rejected by: Tim Peeters
Proposed branch: lp:~unity-team/ubuntu-ui-toolkit/fix-1240019
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 319 lines (+62/-41)
9 files modified
CHANGES (+3/-0)
components.api (+1/-0)
examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml (+27/-24)
modules/Ubuntu/Components/ListItems/ItemSelector.qml (+3/-0)
modules/Ubuntu/Components/ListItems/ValueSelector.qml (+3/-1)
modules/Ubuntu/Components/OptionSelector.qml (+12/-4)
modules/Ubuntu/Components/OptionSelectorDelegate.qml (+10/-10)
modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml (+1/-0)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py (+2/-2)
To merge this branch: bzr merge lp:~unity-team/ubuntu-ui-toolkit/fix-1240019
Reviewer Review Type Date Requested Status
Tim Peeters Needs Resubmitting
PS Jenkins bot continuous-integration Needs Fixing
Zsombor Egri Pending
Review via email: mp+203899@code.launchpad.net

This proposal supersedes a proposal from 2013-12-17.

Commit message

Deprecated ItemSelector and ValueSelector.
Merged functionality into OptionSelector with use of contained property.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote : Posted in a previous version of this proposal

OK. So, detecting whether the component is used as ListItem or not is useless here, however the property name is not so QMLish, let's say in this way. So my proposal to this would be":
1. either to use OptionSelector as base class for ItemSelector, and define different style (or no style at all) for ItemSelector, and configure the 'contains' property needs with the style item itself (i.e. define a property in the style which when exist, would drive the thin dividers, etc from OptionSelector; the ItemSelectorStyle could not have this property set or even defined)
2. Rename the 'contains' property to something more descriptive

I'd prefer the first approach, then we would have clear differentiation on which to be used where, but still similar functionality.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

If this MR is still valid, please resubmit it for merging into our staging branch.

review: Needs Resubmitting

Unmerged revisions

889. By Nicolas d'Offay

Merged potential fix for test.

888. By Nicolas d'Offay

Reverted change.

887. By Nicolas d'Offay

Changed name of item in test.

886. By Nicolas d'Offay

Another attempted test fix.

885. By Nicolas d'Offay

Attempted fix of test.

884. By Nicolas d'Offay

Merged trunk.

883. By Nicolas d'Offay

Merged trunk.

882. By Nicolas d'Offay

Updated CHANGES.

881. By Nicolas d'Offay

Fixed dividers.

880. By Nicolas d'Offay

Merged functionality of ItemSelector into OptionSelector.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES'
--- CHANGES 2013-12-05 14:54:53 +0000
+++ CHANGES 2014-01-30 09:32:49 +0000
@@ -9,7 +9,10 @@
99
10API Changes10API Changes
11***********11***********
12* ADDED IN: OptionSelector: property bool contained
12* ADDED IN: PickerDelegate: readonly property Picker picker13* ADDED IN: PickerDelegate: readonly property Picker picker
14* DEPRECATED: ItemSelector
15* DEPRECATED: ValueSelector
13* CHANGED IN: OptionSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded16* CHANGED IN: OptionSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded
14* CHANGED IN: ItemSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded17* CHANGED IN: ItemSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded
15* ADDED IN: Action: property string iconName18* ADDED IN: Action: property string iconName
1619
=== modified file 'components.api'
--- components.api 2013-12-17 14:05:43 +0000
+++ components.api 2014-01-30 09:32:49 +0000
@@ -193,6 +193,7 @@
193 property real containerHeight193 property real containerHeight
194 property int selectedIndex194 property int selectedIndex
195 property bool currentlyExpanded195 property bool currentlyExpanded
196 property bool contained
196 readonly property real itemHeight197 readonly property real itemHeight
197 signal delegateClicked(int index)198 signal delegateClicked(int index)
198 signal expansionCompleted()199 signal expansionCompleted()
199200
=== modified file 'examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml'
--- examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2013-12-02 14:03:16 +0000
+++ examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2014-01-30 09:32:49 +0000
@@ -28,8 +28,8 @@
28 spacing: units.gu(3)28 spacing: units.gu(3)
2929
30 OptionSelector {30 OptionSelector {
31 objectName: "optionselector_collapsed"31 objectName: "optionselector_collapsed"
32 text: i18n.tr("Collapsed")32 text: i18n.tr("Collapsed")
33 model: [i18n.tr("Value 1"),33 model: [i18n.tr("Value 1"),
34 i18n.tr("Value 2"),34 i18n.tr("Value 2"),
35 i18n.tr("Value 3"),35 i18n.tr("Value 3"),
@@ -41,9 +41,9 @@
41 text: i18n.tr("Expanded")41 text: i18n.tr("Expanded")
42 expanded: true42 expanded: true
43 model: [i18n.tr("Value 1"),43 model: [i18n.tr("Value 1"),
44 i18n.tr("Value 2"),44 i18n.tr("Value 2"),
45 i18n.tr("Value 3"),45 i18n.tr("Value 3"),
46 i18n.tr("Value 4")]46 i18n.tr("Value 4")]
47 }47 }
4848
49 OptionSelector {49 OptionSelector {
@@ -52,16 +52,17 @@
52 expanded: false52 expanded: false
53 multiSelection: true53 multiSelection: true
54 model: [i18n.tr("Value 1"),54 model: [i18n.tr("Value 1"),
55 i18n.tr("Value 2"),55 i18n.tr("Value 2"),
56 i18n.tr("Value 3"),56 i18n.tr("Value 3"),
57 i18n.tr("Value 4")]57 i18n.tr("Value 4")]
58 }58 }
5959
60 OptionSelector {60 OptionSelector {
61 objectName: "optionselector_custommodel"61 objectName: "optionselector_custommodel"
62 text: i18n.tr("Custom Model")62 text: i18n.tr("Custom Model")
63 model: customModel63 model: customModel
64 expanded: true64 expanded: true
65 contained: false
65 colourImage: true66 colourImage: true
66 delegate: selectorDelegate67 delegate: selectorDelegate
67 }68 }
@@ -82,14 +83,15 @@
82 OptionSelector {83 OptionSelector {
83 text: i18n.tr("Custom container height")84 text: i18n.tr("Custom container height")
84 model: [i18n.tr("Value 1"),85 model: [i18n.tr("Value 1"),
85 i18n.tr("Value 2"),86 i18n.tr("Value 2"),
86 i18n.tr("Value 3"),87 i18n.tr("Value 3"),
87 i18n.tr("Value 4"),88 i18n.tr("Value 4"),
88 i18n.tr("Value 5"),89 i18n.tr("Value 5"),
89 i18n.tr("Value 6"),90 i18n.tr("Value 6"),
90 i18n.tr("Value 7"),91 i18n.tr("Value 7"),
91 i18n.tr("Value 8")]92 i18n.tr("Value 8")]
92 containerHeight: itemHeight * 493 containerHeight: itemHeight * 4
94 contained: false
93 }95 }
9496
95 OptionSelector {97 OptionSelector {
@@ -97,14 +99,15 @@
97 expanded: true99 expanded: true
98 selectedIndex: -1100 selectedIndex: -1
99 model: [i18n.tr("Value 1"),101 model: [i18n.tr("Value 1"),
100 i18n.tr("Value 2"),102 i18n.tr("Value 2"),
101 i18n.tr("Value 3"),103 i18n.tr("Value 3"),
102 i18n.tr("Value 4"),104 i18n.tr("Value 4"),
103 i18n.tr("Value 5"),105 i18n.tr("Value 5"),
104 i18n.tr("Value 6"),106 i18n.tr("Value 6"),
105 i18n.tr("Value 7"),107 i18n.tr("Value 7"),
106 i18n.tr("Value 8")]108 i18n.tr("Value 8")]
107 containerHeight: itemHeight * 4109 containerHeight: itemHeight * 4
110 contained: false
108 }111 }
109 }112 }
110 }113 }
111114
=== modified file 'modules/Ubuntu/Components/ListItems/ItemSelector.qml'
--- modules/Ubuntu/Components/ListItems/ItemSelector.qml 2013-12-05 17:00:33 +0000
+++ modules/Ubuntu/Components/ListItems/ItemSelector.qml 2014-01-30 09:32:49 +0000
@@ -19,6 +19,7 @@
19import Ubuntu.Components 0.119import Ubuntu.Components 0.1
2020
21/*!21/*!
22 ****DEPRECATED! PLEASE THE OPTION SELECTOR WITH CONTAINED PROPERTY TRUE.****
22 \qmltype ItemSelector23 \qmltype ItemSelector
23 \inqmlmodule Ubuntu.Components.ListItems 0.124 \inqmlmodule Ubuntu.Components.ListItems 0.1
24 \ingroup ubuntu-listitems25 \ingroup ubuntu-listitems
@@ -194,6 +195,8 @@
194 __height: column.height195 __height: column.height
195 showDivider: false196 showDivider: false
196197
198 Component.onCompleted: console.debug("ITEMSELECTOR IS DEPRECATED. PLEASE USE OPTIONSELECTOR WITH contained: true");
199
197 Column {200 Column {
198 id: column201 id: column
199202
200203
=== modified file 'modules/Ubuntu/Components/ListItems/ValueSelector.qml'
--- modules/Ubuntu/Components/ListItems/ValueSelector.qml 2013-11-06 22:52:15 +0000
+++ modules/Ubuntu/Components/ListItems/ValueSelector.qml 2014-01-30 09:32:49 +0000
@@ -18,7 +18,7 @@
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
1919
20/*!20/*!
21 ****DEPRECATED! PLEASE USE ITEM SELECTOR OR FOR THE UBUNTU SHAPE VERSION THE OPTION SELECTOR.****21 ****DEPRECATED! PLEASE USE THE OPTION SELECTOR.****
2222
23 \qmltype ValueSelector23 \qmltype ValueSelector
24 \inqmlmodule Ubuntu.Components.ListItems 0.124 \inqmlmodule Ubuntu.Components.ListItems 0.1
@@ -184,6 +184,8 @@
184184
185 showDivider: false185 showDivider: false
186186
187 Component.onCompleted: console.debug("VALUESELECTOR IS DEPRECATED. PLEASE USE OPTIONSELECTOR WITH contained: false");
188
187 Column {189 Column {
188 id: column190 id: column
189 anchors {191 anchors {
190192
=== modified file 'modules/Ubuntu/Components/OptionSelector.qml'
--- modules/Ubuntu/Components/OptionSelector.qml 2013-12-13 15:50:35 +0000
+++ modules/Ubuntu/Components/OptionSelector.qml 2014-01-30 09:32:49 +0000
@@ -175,6 +175,12 @@
175 property alias currentlyExpanded: listContainer.currentlyExpanded175 property alias currentlyExpanded: listContainer.currentlyExpanded
176176
177 /*!177 /*!
178 \preliminary
179 Is full width activated or is this a contained selector? The contained selector has an UbuntuShape background.
180 */
181 property bool contained: true
182
183 /*!
178 \qmlproperty real itemHeight184 \qmlproperty real itemHeight
179 Height of an individual list item.185 Height of an individual list item.
180 */186 */
@@ -190,7 +196,7 @@
190 */196 */
191 signal expansionCompleted()197 signal expansionCompleted()
192198
193 /*!199 /*!
194 \internal200 \internal
195 Trigger the action, passing the current index.201 Trigger the action, passing the current index.
196 */202 */
@@ -204,20 +210,20 @@
204 Column {210 Column {
205 id: column211 id: column
206212
207 spacing: units.gu(2)
208 anchors {213 anchors {
209 left: parent.left214 left: parent.left
210 right: parent.right215 right: parent.right
211 }216 }
212217
213 Label {218 ListItem.Standard {
214 id : label219 id : label
215220
216 text: optionSelector.text221 text: optionSelector.text
217 visible: optionSelector.text !== "" ? true : false222 visible: optionSelector.text !== "" ? true : false
223 showDivider: !contained
218 }224 }
219225
220 StyledItem {226 ListItem.Standard {
221 id: listContainer227 id: listContainer
222 objectName: "listContainer"228 objectName: "listContainer"
223229
@@ -225,6 +231,7 @@
225 readonly property url tick: __styleInstance.tick231 readonly property url tick: __styleInstance.tick
226 readonly property color themeColour: Theme.palette.selected.fieldText232 readonly property color themeColour: Theme.palette.selected.fieldText
227 readonly property alias colourImage: optionSelector.colourImage233 readonly property alias colourImage: optionSelector.colourImage
234 property alias contained: optionSelector.contained
228 property bool currentlyExpanded: expanded || multiSelection235 property bool currentlyExpanded: expanded || multiSelection
229236
230 anchors {237 anchors {
@@ -233,6 +240,7 @@
233 }240 }
234 state: optionSelector.expanded ? "expanded" : "collapsed"241 state: optionSelector.expanded ? "expanded" : "collapsed"
235 style: Theme.createStyleComponent("OptionSelectorStyle.qml", listContainer)242 style: Theme.createStyleComponent("OptionSelectorStyle.qml", listContainer)
243 showDivider: !currentlyExpanded && !contained
236 states: [ State {244 states: [ State {
237 name: "expanded"245 name: "expanded"
238 when: listContainer.currentlyExpanded246 when: listContainer.currentlyExpanded
239247
=== modified file 'modules/Ubuntu/Components/OptionSelectorDelegate.qml'
--- modules/Ubuntu/Components/OptionSelectorDelegate.qml 2013-12-04 15:51:58 +0000
+++ modules/Ubuntu/Components/OptionSelectorDelegate.qml 2014-01-30 09:32:49 +0000
@@ -72,7 +72,7 @@
72 property url icon: iconSource72 property url icon: iconSource
73 onIconChanged: if (icon != iconSource) {73 onIconChanged: if (icon != iconSource) {
74 console.warn("WARNING: OptionSelectorDelegate.icon is DEPRECATED. " +74 console.warn("WARNING: OptionSelectorDelegate.icon is DEPRECATED. " +
75 "Use iconName and iconSource instead.")75 "Use iconName and iconSource instead.")
76 }76 }
7777
78 /*!78 /*!
@@ -140,7 +140,7 @@
140 gl_FragColor = colour * sourceColour.a * qt_Opacity;140 gl_FragColor = colour * sourceColour.a * qt_Opacity;
141 }"141 }"
142142
143 showDivider: index !== listView.count - 1 ? 1 : 0143 showDivider: index === listView.count - 1 && listView.container.contained ? 0 : 1
144 highlightWhenPressed: false144 highlightWhenPressed: false
145 selected: ListView.isCurrentItem145 selected: ListView.isCurrentItem
146 anchors {146 anchors {
@@ -314,12 +314,12 @@
314 duration: Toolkit.UbuntuAnimation.FastDuration314 duration: Toolkit.UbuntuAnimation.FastDuration
315 }315 }
316 }, PropertyAnimation {316 }, PropertyAnimation {
317 id: optionCollapse317 id: optionCollapse
318 target: option318 target: option
319 properties: "opacity"319 properties: "opacity"
320 from : 1.0320 from : 1.0
321 to: 0.0321 to: 0.0
322 duration: Toolkit.UbuntuAnimation.SlowDuration322 duration: Toolkit.UbuntuAnimation.SlowDuration
323 }323 }
324 ]324 ]
325325
@@ -349,7 +349,7 @@
349 visible: colourImage349 visible: colourImage
350350
351 fragmentShader: fragColourShader351 fragmentShader: fragColourShader
352 }352 }
353 }353 }
354354
355 Column {355 Column {
@@ -398,6 +398,6 @@
398 height: source.height398 height: source.height
399399
400 fragmentShader: fragColourShader400 fragmentShader: fragColourShader
401 }401 }
402 }402 }
403}403}
404404
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml 2013-08-28 10:43:46 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml 2014-01-30 09:32:49 +0000
@@ -31,5 +31,6 @@
31 width: styledItem.width31 width: styledItem.width
32 height: styledItem.height32 height: styledItem.height
33 radius: "medium"33 radius: "medium"
34 visible: styledItem.contained
34 }35 }
35}36}
3637
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2013-11-08 09:19:02 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-01-30 09:32:49 +0000
@@ -30,11 +30,11 @@
30 self.loadItem(item)30 self.loadItem(item)
31 self.checkPageHeader(item)31 self.checkPageHeader(item)
32 collapsed = self.getObject("optionselector_collapsed")32 collapsed = self.getObject("optionselector_collapsed")
33 styleditem = collapsed.select_single('StyledItem',33 styleditem = collapsed.select_single('Standard',
34 objectName='listContainer')34 objectName='listContainer')
3535
36 self.assertThat(collapsed.selectedIndex, Equals(0))36 self.assertThat(collapsed.selectedIndex, Equals(0))
37 self.pointing_device.click_object(collapsed)37 self.pointing_device.click_object(styleditem)
38 self.assertThat(styleditem.currentlyExpanded, Eventually(Equals(True)))38 self.assertThat(styleditem.currentlyExpanded, Eventually(Equals(True)))
39 #try to search the following list entry few times39 #try to search the following list entry few times
40 #as it may not be available immediately.40 #as it may not be available immediately.

Subscribers

People subscribed via source and target branches

to status/vote changes: