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
1=== modified file 'CHANGES'
2--- CHANGES 2013-12-05 14:54:53 +0000
3+++ CHANGES 2014-01-30 09:32:49 +0000
4@@ -9,7 +9,10 @@
5
6 API Changes
7 ***********
8+* ADDED IN: OptionSelector: property bool contained
9 * ADDED IN: PickerDelegate: readonly property Picker picker
10+* DEPRECATED: ItemSelector
11+* DEPRECATED: ValueSelector
12 * CHANGED IN: OptionSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded
13 * CHANGED IN: ItemSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded
14 * ADDED IN: Action: property string iconName
15
16=== modified file 'components.api'
17--- components.api 2013-12-17 14:05:43 +0000
18+++ components.api 2014-01-30 09:32:49 +0000
19@@ -193,6 +193,7 @@
20 property real containerHeight
21 property int selectedIndex
22 property bool currentlyExpanded
23+ property bool contained
24 readonly property real itemHeight
25 signal delegateClicked(int index)
26 signal expansionCompleted()
27
28=== modified file 'examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml'
29--- examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2013-12-02 14:03:16 +0000
30+++ examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2014-01-30 09:32:49 +0000
31@@ -28,8 +28,8 @@
32 spacing: units.gu(3)
33
34 OptionSelector {
35- objectName: "optionselector_collapsed"
36- text: i18n.tr("Collapsed")
37+ objectName: "optionselector_collapsed"
38+ text: i18n.tr("Collapsed")
39 model: [i18n.tr("Value 1"),
40 i18n.tr("Value 2"),
41 i18n.tr("Value 3"),
42@@ -41,9 +41,9 @@
43 text: i18n.tr("Expanded")
44 expanded: true
45 model: [i18n.tr("Value 1"),
46- i18n.tr("Value 2"),
47- i18n.tr("Value 3"),
48- i18n.tr("Value 4")]
49+ i18n.tr("Value 2"),
50+ i18n.tr("Value 3"),
51+ i18n.tr("Value 4")]
52 }
53
54 OptionSelector {
55@@ -52,16 +52,17 @@
56 expanded: false
57 multiSelection: true
58 model: [i18n.tr("Value 1"),
59- i18n.tr("Value 2"),
60- i18n.tr("Value 3"),
61- i18n.tr("Value 4")]
62+ i18n.tr("Value 2"),
63+ i18n.tr("Value 3"),
64+ i18n.tr("Value 4")]
65 }
66
67 OptionSelector {
68- objectName: "optionselector_custommodel"
69- text: i18n.tr("Custom Model")
70+ objectName: "optionselector_custommodel"
71+ text: i18n.tr("Custom Model")
72 model: customModel
73 expanded: true
74+ contained: false
75 colourImage: true
76 delegate: selectorDelegate
77 }
78@@ -82,14 +83,15 @@
79 OptionSelector {
80 text: i18n.tr("Custom container height")
81 model: [i18n.tr("Value 1"),
82- i18n.tr("Value 2"),
83- i18n.tr("Value 3"),
84- i18n.tr("Value 4"),
85- i18n.tr("Value 5"),
86- i18n.tr("Value 6"),
87- i18n.tr("Value 7"),
88- i18n.tr("Value 8")]
89+ i18n.tr("Value 2"),
90+ i18n.tr("Value 3"),
91+ i18n.tr("Value 4"),
92+ i18n.tr("Value 5"),
93+ i18n.tr("Value 6"),
94+ i18n.tr("Value 7"),
95+ i18n.tr("Value 8")]
96 containerHeight: itemHeight * 4
97+ contained: false
98 }
99
100 OptionSelector {
101@@ -97,14 +99,15 @@
102 expanded: true
103 selectedIndex: -1
104 model: [i18n.tr("Value 1"),
105- i18n.tr("Value 2"),
106- i18n.tr("Value 3"),
107- i18n.tr("Value 4"),
108- i18n.tr("Value 5"),
109- i18n.tr("Value 6"),
110- i18n.tr("Value 7"),
111- i18n.tr("Value 8")]
112+ i18n.tr("Value 2"),
113+ i18n.tr("Value 3"),
114+ i18n.tr("Value 4"),
115+ i18n.tr("Value 5"),
116+ i18n.tr("Value 6"),
117+ i18n.tr("Value 7"),
118+ i18n.tr("Value 8")]
119 containerHeight: itemHeight * 4
120+ contained: false
121 }
122 }
123 }
124
125=== modified file 'modules/Ubuntu/Components/ListItems/ItemSelector.qml'
126--- modules/Ubuntu/Components/ListItems/ItemSelector.qml 2013-12-05 17:00:33 +0000
127+++ modules/Ubuntu/Components/ListItems/ItemSelector.qml 2014-01-30 09:32:49 +0000
128@@ -19,6 +19,7 @@
129 import Ubuntu.Components 0.1
130
131 /*!
132+ ****DEPRECATED! PLEASE THE OPTION SELECTOR WITH CONTAINED PROPERTY TRUE.****
133 \qmltype ItemSelector
134 \inqmlmodule Ubuntu.Components.ListItems 0.1
135 \ingroup ubuntu-listitems
136@@ -194,6 +195,8 @@
137 __height: column.height
138 showDivider: false
139
140+ Component.onCompleted: console.debug("ITEMSELECTOR IS DEPRECATED. PLEASE USE OPTIONSELECTOR WITH contained: true");
141+
142 Column {
143 id: column
144
145
146=== modified file 'modules/Ubuntu/Components/ListItems/ValueSelector.qml'
147--- modules/Ubuntu/Components/ListItems/ValueSelector.qml 2013-11-06 22:52:15 +0000
148+++ modules/Ubuntu/Components/ListItems/ValueSelector.qml 2014-01-30 09:32:49 +0000
149@@ -18,7 +18,7 @@
150 import Ubuntu.Components 0.1
151
152 /*!
153- ****DEPRECATED! PLEASE USE ITEM SELECTOR OR FOR THE UBUNTU SHAPE VERSION THE OPTION SELECTOR.****
154+ ****DEPRECATED! PLEASE USE THE OPTION SELECTOR.****
155
156 \qmltype ValueSelector
157 \inqmlmodule Ubuntu.Components.ListItems 0.1
158@@ -184,6 +184,8 @@
159
160 showDivider: false
161
162+ Component.onCompleted: console.debug("VALUESELECTOR IS DEPRECATED. PLEASE USE OPTIONSELECTOR WITH contained: false");
163+
164 Column {
165 id: column
166 anchors {
167
168=== modified file 'modules/Ubuntu/Components/OptionSelector.qml'
169--- modules/Ubuntu/Components/OptionSelector.qml 2013-12-13 15:50:35 +0000
170+++ modules/Ubuntu/Components/OptionSelector.qml 2014-01-30 09:32:49 +0000
171@@ -175,6 +175,12 @@
172 property alias currentlyExpanded: listContainer.currentlyExpanded
173
174 /*!
175+ \preliminary
176+ Is full width activated or is this a contained selector? The contained selector has an UbuntuShape background.
177+ */
178+ property bool contained: true
179+
180+ /*!
181 \qmlproperty real itemHeight
182 Height of an individual list item.
183 */
184@@ -190,7 +196,7 @@
185 */
186 signal expansionCompleted()
187
188- /*!
189+ /*!
190 \internal
191 Trigger the action, passing the current index.
192 */
193@@ -204,20 +210,20 @@
194 Column {
195 id: column
196
197- spacing: units.gu(2)
198 anchors {
199 left: parent.left
200 right: parent.right
201 }
202
203- Label {
204+ ListItem.Standard {
205 id : label
206
207 text: optionSelector.text
208 visible: optionSelector.text !== "" ? true : false
209+ showDivider: !contained
210 }
211
212- StyledItem {
213+ ListItem.Standard {
214 id: listContainer
215 objectName: "listContainer"
216
217@@ -225,6 +231,7 @@
218 readonly property url tick: __styleInstance.tick
219 readonly property color themeColour: Theme.palette.selected.fieldText
220 readonly property alias colourImage: optionSelector.colourImage
221+ property alias contained: optionSelector.contained
222 property bool currentlyExpanded: expanded || multiSelection
223
224 anchors {
225@@ -233,6 +240,7 @@
226 }
227 state: optionSelector.expanded ? "expanded" : "collapsed"
228 style: Theme.createStyleComponent("OptionSelectorStyle.qml", listContainer)
229+ showDivider: !currentlyExpanded && !contained
230 states: [ State {
231 name: "expanded"
232 when: listContainer.currentlyExpanded
233
234=== modified file 'modules/Ubuntu/Components/OptionSelectorDelegate.qml'
235--- modules/Ubuntu/Components/OptionSelectorDelegate.qml 2013-12-04 15:51:58 +0000
236+++ modules/Ubuntu/Components/OptionSelectorDelegate.qml 2014-01-30 09:32:49 +0000
237@@ -72,7 +72,7 @@
238 property url icon: iconSource
239 onIconChanged: if (icon != iconSource) {
240 console.warn("WARNING: OptionSelectorDelegate.icon is DEPRECATED. " +
241- "Use iconName and iconSource instead.")
242+ "Use iconName and iconSource instead.")
243 }
244
245 /*!
246@@ -140,7 +140,7 @@
247 gl_FragColor = colour * sourceColour.a * qt_Opacity;
248 }"
249
250- showDivider: index !== listView.count - 1 ? 1 : 0
251+ showDivider: index === listView.count - 1 && listView.container.contained ? 0 : 1
252 highlightWhenPressed: false
253 selected: ListView.isCurrentItem
254 anchors {
255@@ -314,12 +314,12 @@
256 duration: Toolkit.UbuntuAnimation.FastDuration
257 }
258 }, PropertyAnimation {
259- id: optionCollapse
260- target: option
261- properties: "opacity"
262- from : 1.0
263- to: 0.0
264- duration: Toolkit.UbuntuAnimation.SlowDuration
265+ id: optionCollapse
266+ target: option
267+ properties: "opacity"
268+ from : 1.0
269+ to: 0.0
270+ duration: Toolkit.UbuntuAnimation.SlowDuration
271 }
272 ]
273
274@@ -349,7 +349,7 @@
275 visible: colourImage
276
277 fragmentShader: fragColourShader
278- }
279+ }
280 }
281
282 Column {
283@@ -398,6 +398,6 @@
284 height: source.height
285
286 fragmentShader: fragColourShader
287- }
288+ }
289 }
290 }
291
292=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml'
293--- modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml 2013-08-28 10:43:46 +0000
294+++ modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml 2014-01-30 09:32:49 +0000
295@@ -31,5 +31,6 @@
296 width: styledItem.width
297 height: styledItem.height
298 radius: "medium"
299+ visible: styledItem.contained
300 }
301 }
302
303=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py'
304--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2013-11-08 09:19:02 +0000
305+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-01-30 09:32:49 +0000
306@@ -30,11 +30,11 @@
307 self.loadItem(item)
308 self.checkPageHeader(item)
309 collapsed = self.getObject("optionselector_collapsed")
310- styleditem = collapsed.select_single('StyledItem',
311+ styleditem = collapsed.select_single('Standard',
312 objectName='listContainer')
313
314 self.assertThat(collapsed.selectedIndex, Equals(0))
315- self.pointing_device.click_object(collapsed)
316+ self.pointing_device.click_object(styleditem)
317 self.assertThat(styleditem.currentlyExpanded, Eventually(Equals(True)))
318 #try to search the following list entry few times
319 #as it may not be available immediately.

Subscribers

People subscribed via source and target branches

to status/vote changes: