Merge lp:~zsombi/ubuntu-ui-toolkit/fix-1217650 into lp:ubuntu-ui-toolkit

Proposed by Zsombor Egri on 2013-08-28
Status: Merged
Approved by: Timo Jyrinki on 2013-08-28
Approved revision: 717
Merged at revision: 716
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/fix-1217650
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 1036 lines (+59/-802)
16 files modified
CHANGES (+1/-1)
components.api (+0/-17)
debian/changelog (+0/-16)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+12/-0)
examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml (+0/-73)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+0/-5)
modules/Ubuntu/Components/ListItems/Empty.qml (+44/-9)
modules/Ubuntu/Components/OptionSelector.qml (+0/-188)
modules/Ubuntu/Components/OptionSelectorDelegate.qml (+0/-295)
modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml (+0/-35)
modules/Ubuntu/Components/Themes/Ambiance/qmldir (+1/-2)
modules/Ubuntu/Components/Themes/SuruDark/OptionSelectorStyle.qml (+0/-23)
modules/Ubuntu/Components/Themes/SuruGradient/OptionSelectorStyle.qml (+0/-27)
modules/Ubuntu/Components/qmldir (+0/-2)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py (+1/-2)
tests/unit/tst_components/tst_optionselector.qml (+0/-107)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/fix-1217650
Reviewer Review Type Date Requested Status
Timo Jyrinki (community) 2013-08-28 Approve on 2013-08-28
Review via email: mp+182558@code.launchpad.net

Commit message

Fixing Unity8 crash with the latest SDK release. SDK reverted to revision 713.

To post a comment you must log in.
Timo Jyrinki (timo-jyrinki) wrote :

Approving, it's a revert of commit 714.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES'
2--- CHANGES 2013-08-23 10:54:28 +0000
3+++ CHANGES 2013-08-28 08:10:15 +0000
4@@ -9,7 +9,7 @@
5
6 API Changes
7 ***********
8-* ADDED IN: Empty: property alias divider
9+
10 * REMOVED IN ALL: attached property ItemStyle
11 * ADDED IN OrientationHelper: property alias rotating
12 * ADDED IN OrientationHelper: property alias __orientationHelper
13
14=== modified file 'components.api'
15--- components.api 2013-08-27 14:53:35 +0000
16+++ components.api 2013-08-28 08:10:15 +0000
17@@ -99,23 +99,6 @@
18 modules/Ubuntu/Components/Object.qml
19 QtObject
20 default property internal children
21-modules/Ubuntu/Components/OptionSelector.qml
22-ListItem.Empty
23- property var model
24- property bool expanded
25- property bool colourImage
26- readonly property int selectedIndex
27- property real containerHeight
28- signal scroll()
29-modules/Ubuntu/Components/OptionSelectorDelegate.qml
30-ListItem.Standard
31- property string text
32- property string subText
33- property url icon
34- property ListView listView
35- property color assetColour
36- property bool colourImage
37- property string fragColourShader
38 modules/Ubuntu/Components/OrientationHelper.qml
39 Item
40 property bool automaticOrientation
41
42=== modified file 'debian/changelog'
43--- debian/changelog 2013-08-27 19:11:59 +0000
44+++ debian/changelog 2013-08-28 08:10:15 +0000
45@@ -1,19 +1,3 @@
46-ubuntu-ui-toolkit (0.1.46+13.10.20130827-0ubuntu1) saucy; urgency=low
47-
48- [ Michael Zanetti ]
49- * Themed UbuntuShape OptionSelector. (LP: #1202170)
50-
51- [ Omer Akram ]
52- * Themed UbuntuShape OptionSelector. (LP: #1202170)
53-
54- [ Nicolas d'Offay ]
55- * Themed UbuntuShape OptionSelector. (LP: #1202170)
56-
57- [ Ubuntu daily release ]
58- * Automatic snapshot from revision 714
59-
60- -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 27 Aug 2013 19:11:59 +0000
61-
62 ubuntu-ui-toolkit (0.1.46+13.10.20130826.1-0ubuntu1) saucy; urgency=low
63
64 [ Zsombor Egri ]
65
66=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
67--- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2013-07-15 11:05:38 +0000
68+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2013-08-28 08:10:15 +0000
69@@ -77,6 +77,18 @@
70 }
71
72 ListItemsSection {
73+ title: i18n.tr("Value selector")
74+ className: "ValueSelector"
75+ delegate: ListItem.ValueSelector {
76+ text: i18n.tr("Label")
77+ values: [i18n.tr("Value 1"),
78+ i18n.tr("Value 2"),
79+ i18n.tr("Value 3"),
80+ i18n.tr("Value 4")]
81+ }
82+ }
83+
84+ ListItemsSection {
85 title: i18n.tr("Control")
86 className: "Standard"
87 delegate: ListItem.Standard {
88
89=== removed file 'examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml'
90--- examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2013-08-27 12:06:42 +0000
91+++ examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 1970-01-01 00:00:00 +0000
92@@ -1,73 +0,0 @@
93-/*
94- * Copyright 2013 Canonical Ltd.
95- *
96- * This program is free software; you can redistribute it and/or modify
97- * it under the terms of the GNU Lesser General Public License as published by
98- * the Free Software Foundation; version 3.
99- *
100- * This program is distributed in the hope that it will be useful,
101- * but WITHOUT ANY WARRANTY; without even the implied warranty of
102- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103- * GNU Lesser General Public License for more details.
104- *
105- * You should have received a copy of the GNU Lesser General Public License
106- * along with this program. If not, see <http://www.gnu.org/licenses/>.
107- */
108-
109-import QtQuick 2.0
110-import Ubuntu.Components 0.1
111-
112-Template {
113- TemplateSection {
114- id: section
115-
116- title: i18n.tr("Option Selector")
117- className: "Option Selector"
118-
119- Column {
120- id: column
121- anchors.left: parent.left
122- anchors.right: parent.right
123- spacing: units.gu(3)
124-
125- OptionSelector {
126- text: i18n.tr("Label")
127- model: [i18n.tr("Value 1"),
128- i18n.tr("Value 2"),
129- i18n.tr("Value 3"),
130- i18n.tr("Value 4")]
131- }
132-
133- OptionSelector {
134- text: i18n.tr("Label")
135- expanded: true
136- model: [i18n.tr("Value 1"),
137- i18n.tr("Value 2"),
138- i18n.tr("Value 3"),
139- i18n.tr("Value 4")]
140- }
141-
142- OptionSelector {
143- text: i18n.tr("Label")
144- model: customModel
145- expanded: true
146- colourImage: true
147- delegate: selectorDelegate
148- }
149-
150- Component {
151- id: selectorDelegate
152-
153- OptionSelectorDelegate { text: name; subText: description; icon: image }
154- }
155-
156- ListModel {
157- id: customModel
158- ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
159- ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
160- ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
161- ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
162- }
163- }
164- }
165-}
166
167=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
168--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2013-08-07 14:09:38 +0000
169+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2013-08-28 08:10:15 +0000
170@@ -40,11 +40,6 @@
171 source: "TextInputs.qml"
172 }
173
174- ListElement {
175- label: "Option Selector"
176- source: "OptionSelectors.qml"
177- }
178-
179 // Not in design guidelines yet
180 ListElement {
181 label: "Progress and activity"
182
183=== removed file 'examples/ubuntu-ui-toolkit-gallery/images.png'
184Binary files examples/ubuntu-ui-toolkit-gallery/images.png 2013-08-23 12:24:39 +0000 and examples/ubuntu-ui-toolkit-gallery/images.png 1970-01-01 00:00:00 +0000 differ
185=== modified file 'modules/Ubuntu/Components/ListItems/Empty.qml'
186--- modules/Ubuntu/Components/ListItems/Empty.qml 2013-08-13 14:02:22 +0000
187+++ modules/Ubuntu/Components/ListItems/Empty.qml 2013-08-28 08:10:15 +0000
188@@ -120,7 +120,34 @@
189 Set to show or hide the thin bottom divider line (drawn by the \l ThinDivider component).
190 This line is shown by default except in cases where this item is the delegate of a ListView.
191 */
192- property bool showDivider: true
193+ property bool showDivider: __showDivider()
194+
195+ /*!
196+ \internal
197+ Method to automatically determine if the bottom divider line should be drawn.
198+ This always returns true, unless item is a delegate in a ListView. If in a ListView
199+ it will return false only when:
200+ + if there is a section.delegate below this item (as thin divider line and section
201+ delegate should not both appear)
202+ + if this is the final item in the list, and ListView.footer is set (again as thin
203+ divider line won't look well with footer below it)
204+ */
205+ // FIXME: The new design shows dividers everywhere, so if it does not change anymore,
206+ // the __showDivider() function may be removed.
207+ function __showDivider() {
208+ // if we're not in ListView, always show a thin dividing line at the bottom
209+ //if (ListView.view !== null) {
210+
211+ // if we're last item in ListView, show divider if no footer is defined
212+ // and hide it if footer defined
213+ //if (index === ListView.view.model.count - 1) return !ListView.footer;
214+
215+ // if section.delegate is positioned between this item and the next
216+ //else if (ListView.section !== ListView.nextSection) return true;
217+ //else return false;
218+ //}
219+ return true;
220+ }
221
222 /*!
223 \internal
224@@ -142,13 +169,6 @@
225 */
226 property alias backgroundIndicator: backgroundIndicator.children
227
228- /*!
229- \preliminary
230- \qmlproperty ThinDivider bottomDividerLine
231- Exposes our the bottom line divider.
232- */
233- property alias divider: bottomDividerLine
234-
235 /*! \internal
236 The spacing inside the list item.
237 */
238@@ -252,6 +272,21 @@
239 }
240 }
241
242+ Rectangle {
243+ id: highlight
244+
245+ z: -1
246+ visible: !priv.removed && emptyListItem.swipingState === "" ? emptyListItem.selected || (emptyListItem.highlightWhenPressed && emptyListItem.pressed) : false
247+ anchors {
248+ left: parent.left
249+ right: parent.right
250+ top: parent.top
251+ }
252+ height: emptyListItem.height - bottomDividerLine.height
253+ color: Theme.palette.selected.background
254+ }
255+
256+
257 ThinDivider {
258 id: bottomDividerLine
259 anchors.bottom: parent.bottom
260@@ -267,7 +302,7 @@
261 left: parent.left
262 right: parent.right
263 top: parent.top
264- bottom: parent.bottom
265+ bottom: bottomDividerLine.top
266 }
267
268 Item {
269
270=== removed file 'modules/Ubuntu/Components/OptionSelector.qml'
271--- modules/Ubuntu/Components/OptionSelector.qml 2013-08-27 12:06:42 +0000
272+++ modules/Ubuntu/Components/OptionSelector.qml 1970-01-01 00:00:00 +0000
273@@ -1,188 +0,0 @@
274-/*
275- * Copyright 2012 Canonical Ltd.
276- *
277- * This program is free software; you can redistribute it and/or modify
278- * it under the terms of the GNU Lesser General Public License as published by
279- * the Free Software Foundation; version 3.
280- *
281- * This program is distributed in the hope that it will be useful,
282- * but WITHOUT ANY WARRANTY; without even the implied warranty of
283- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
284- * GNU Lesser General Public License for more details.
285- *
286- * You should have received a copy of the GNU Lesser General Public License
287- * along with this program. If not, see <http://www.gnu.org/licenses/>.
288- */
289-
290-import QtQuick 2.0
291-import "ListItems" as ListItem
292-import Ubuntu.Components 0.1 as Components
293-
294-/*!
295- \qmltype OptionSelector
296- \inqmlmodule Components.Components.ListItems 0.1
297- \ingroup ubuntu-listitems
298- \brief List item displaying single selected value when not expanded,
299- where expanding it opens a listing of all the possible values for selection
300- with an additional option of always being expanded.
301-
302- \b{This component is under heavy development.}
303-
304- Examples:
305- \qml
306- import Components.Components 0.1
307- Column {
308- width: 250
309- OptionSelector {
310- text: "Standard"
311- values: ["Value 1", "Value 2", "Value 3", "Value 4"]
312- }
313- OptionSelector {
314- text: "Disabled"
315- values: ["Value 1", "Value 2", "Value 3", "Value 4"]
316- enabled: false
317- }
318- OptionSelector {
319- text: "Expanded"
320- values: ["Value 1", "Value 2", "Value 3", "Value 4"]
321- expanded: true
322- }
323- OptionSelector {
324- text: "Icon"
325- icon: Qt.resolvedUrl("icon.png")
326- values: ["Value 1", "Value 2", "Value 3", "Value 4"]
327- selectedIndex: 2
328- }
329- }
330- \endqml
331-*/
332-
333-/*FIXME:
334-There is a bug with UbuntuShape background which should be fixed once the new UbuntuShape changes land.*/
335-
336-ListItem.Empty {
337- id: optionSelector
338- __height: column.height
339-
340- /*!
341- \preliminary
342- The list of values that will be shown under the label text. This is a model.
343- */
344- property var model
345-
346- /*!
347- \preliminary
348- Specifies whether the list is always expanded.
349- */
350- property bool expanded: false
351-
352- /*!
353- \preliminary
354- Colours image according to the fieldText colour of the theme, otherwise source colour is maintained.
355- */
356- property bool colourImage: false
357-
358- /*!
359- \preliminary
360- ListView delegate.
361- */
362- property Component delegate: OptionSelectorDelegate {}
363-
364- /*!
365- \qmlproperty int selectedIndex
366- The index of the currently selected element in our list.
367- */
368- readonly property alias selectedIndex: list.currentIndex
369-
370- /*!
371- \qmlproperty real containerHeight
372- Custom height for list container which allows scrolling inside the selector.
373- */
374- property real containerHeight: list.contentHeight
375-
376- /*!
377- Called when the optionSelector is either expanded or collapsed.
378- */
379- signal scroll()
380-
381- showDivider: false
382-
383- Column {
384- id: column
385-
386- spacing: units.gu(2)
387- anchors {
388- left: parent.left
389- right: parent.right
390- }
391-
392- Label {
393- text: optionSelector.text
394- height: units.gu(2)
395- }
396-
397- StyledItem {
398- id: listContainer
399- objectName: "listContainer"
400-
401- readonly property url chevron: __styleInstance.chevron
402- readonly property url tick: __styleInstance.tick
403- readonly property color themeColour: Theme.palette.selected.fieldText
404- property bool isExpanded: expanded
405- property bool isFullyExpanded: expanded
406- property bool colourImage: optionSelector.colourImage
407-
408- anchors {
409- left: parent.left
410- right: parent.right
411- }
412- state: optionSelector.expanded ? state = "expanded" : state = "collapsed"
413- style: Theme.createStyleComponent("OptionSelectorStyle.qml", listContainer)
414-
415- onHeightChanged: scroll()
416-
417- states: [ State {
418- name: "expanded"
419- when: listContainer.isExpanded
420- PropertyChanges {
421- target: listContainer
422- height: containerHeight
423- }
424- }, State {
425- name: "collapsed"
426- when: !listContainer.isExpanded
427- PropertyChanges {
428- target: listContainer
429- height: list.itemHeight
430- }
431- }
432- ]
433-
434- transitions: [ Transition {
435- UbuntuNumberAnimation {
436- properties: "height"
437- duration: Components.UbuntuAnimation.BriskDuration
438- }
439- }
440- ]
441-
442- ListView {
443- id: list
444-
445- property int previousIndex: -1
446- readonly property alias expanded: optionSelector.expanded
447- readonly property alias container: listContainer
448- property real itemHeight
449-
450- boundsBehavior: Flickable.StopAtBounds
451- interactive: listContainer.height !== list.contentHeight && listContainer.isExpanded ? true : false
452- clip: true
453- currentIndex: 0
454- model: optionSelector.model
455- anchors.fill: parent
456-
457- delegate: optionSelector.delegate
458- }
459- }
460- }
461-}
462
463=== removed file 'modules/Ubuntu/Components/OptionSelectorDelegate.qml'
464--- modules/Ubuntu/Components/OptionSelectorDelegate.qml 2013-08-27 12:06:42 +0000
465+++ modules/Ubuntu/Components/OptionSelectorDelegate.qml 1970-01-01 00:00:00 +0000
466@@ -1,295 +0,0 @@
467-/*
468- * Copyright 2012 Canonical Ltd.
469- *
470- * This program is free software; you can redistribute it and/or modify
471- * it under the terms of the GNU Lesser General Public License as published by
472- * the Free Software Foundation; version 3.
473- *
474- * This program is distributed in the hope that it will be useful,
475- * but WITHOUT ANY WARRANTY; without even the implied warranty of
476- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477- * GNU Lesser General Public License for more details.
478- *
479- * You should have received a copy of the GNU Lesser General Public License
480- * along with this program. If not, see <http://www.gnu.org/licenses/>.
481- */
482-
483-import QtQuick 2.0
484-import "ListItems" as ListItem
485-import Ubuntu.Components 0.1 as Components
486-
487-ListItem.Standard {
488- id: option
489-
490- property string text
491- property string subText
492- property url icon
493- property ListView listView: ListView.view
494- property color assetColour: listView.container.themeColour
495- property bool colourImage: listView.container.colourImage
496- property string fragColourShader:
497- "varying highp vec2 qt_TexCoord0;
498- uniform sampler2D source;
499- uniform lowp vec4 colour;
500- uniform lowp float qt_Opacity;
501-
502- void main() {
503- lowp vec4 sourceColour = texture2D(source, qt_TexCoord0);
504- gl_FragColor = colour * sourceColour.a * qt_Opacity;
505- }"
506-
507- width: parent.width + units.gu(2)
508- showDivider: index !== listView.count - 1 ? 1 : 0
509- highlightWhenPressed: false
510- selected: ListView.isCurrentItem
511- anchors {
512- left: parent.left
513- leftMargin: units.gu(-2)
514- }
515- onClicked: {
516- if (listView.container.isExpanded) {
517- listView.previousIndex = listView.currentIndex;
518- listView.currentIndex = index;
519- }
520-
521- if (!listView.expanded) {
522- listView.container.isExpanded = !listView.container.isExpanded;
523- }
524- }
525-
526- Component.onCompleted: {
527- height = listView.itemHeight = childrenRect.height;
528- }
529-
530- //Since we don't want to add states to our divider, we use the exposed alias provided in Empty to access it and alter it's opacity from here.
531- states: [ State {
532- name: "dividerExpanded"
533- when: listView.container.state === "expanded" && index === listView.currentIndex
534- PropertyChanges {
535- target: option.divider
536- opacity: 1
537- }
538- }, State {
539- name: "dividerCollapsed"
540- when: listView.container.state === "collapsed" && index === listView.currentIndex
541- PropertyChanges {
542- target: option.divider
543- opacity: 0
544- }
545- }
546- ]
547-
548- //As with our states, we apply the transition with our divider as the target.
549- transitions: [ Transition {
550- from: "dividerExpanded"
551- to: "dividerCollapsed"
552- UbuntuNumberAnimation {
553- target: option.divider
554- properties: "opacity"
555- duration: Components.UbuntuAnimation.SlowDuration
556- }
557- }
558- ]
559-
560- resources: [
561- Connections {
562- target: listView.container
563- onIsExpandedChanged: {
564- optionExpansion.stop();
565- imageExpansion.stop();
566- optionCollapse.stop();
567- selectedImageCollapse.stop();
568- deselectedImageCollapse.stop();
569-
570- if (listView.container.isExpanded === true) {
571- if (!option.selected) {
572- optionExpansion.start();
573-
574- //Ensure a source change. This solves a bug which happens occasionaly when source is switched correctly. Probably related to the image.source binding.
575- image.source = listView.container.tick
576- } else {
577- imageExpansion.start();
578- }
579- } else {
580- if (!option.selected) {
581- optionCollapse.start();
582- } else {
583- if (listView.previousIndex !== listView.currentIndex)
584- selectedImageCollapse.start();
585- else {
586- deselectedImageCollapse.start();
587- }
588- }
589- }
590- }
591- }, SequentialAnimation {
592- id: imageExpansion
593-
594- PropertyAnimation {
595- target: image
596- properties: "opacity"
597- from : 1.0
598- to: 0.0
599- duration: Components.UbuntuAnimation.FastDuration
600- }
601- PauseAnimation { duration: Components.UbuntuAnimation.BriskDuration - Components.UbuntuAnimation.FastDuration }
602- PropertyAction {
603- target: image
604- property: "source"
605- value: listView.container.tick
606- }
607- PropertyAnimation {
608- target: image
609- properties: "opacity"
610- from : 0.0
611- to: 1.0
612- duration: Components.UbuntuAnimation.FastDuration
613- }
614- }, PropertyAnimation {
615- id: optionExpansion
616-
617- target: option
618- properties: "opacity"
619- from : 0.0
620- to: 1.0
621- duration: Components.UbuntuAnimation.SlowDuration
622- }, SequentialAnimation {
623- id: deselectedImageCollapse
624-
625- PauseAnimation { duration: Components.UbuntuAnimation.BriskDuration }
626- PropertyAnimation {
627- target: image
628- properties: "opacity"
629- from : 1.0
630- to: 0.0
631- duration: Components.UbuntuAnimation.FastDuration
632- }
633- PauseAnimation { duration: Components.UbuntuAnimation.FastDuration }
634- PropertyAction {
635- target: image
636- property: "source"
637- value: listView.container.chevron
638- }
639- PropertyAnimation {
640- target: image
641- properties: "opacity"
642- from : 0.0
643- to: 1.0
644- duration: Components.UbuntuAnimation.FastDuration
645- }
646- }, SequentialAnimation {
647- id: selectedImageCollapse
648-
649- PropertyAnimation {
650- target: image
651- properties: "opacity"
652- from : 0.0
653- to: 1.0
654- duration: Components.UbuntuAnimation.FastDuration
655- }
656- PauseAnimation { duration: Components.UbuntuAnimation.BriskDuration - Components.UbuntuAnimation.FastDuration }
657- PropertyAnimation {
658- target: image
659- properties: "opacity"
660- from : 1.0
661- to: 0.0
662- duration: Components.UbuntuAnimation.FastDuration
663- }
664- PauseAnimation { duration: Components.UbuntuAnimation.FastDuration }
665- PropertyAction {
666- target: image
667- property: "source"
668- value: listView.container.chevron
669- }
670- PropertyAnimation {
671- target: image
672- properties: "opacity"
673- from : 0.0
674- to: 1.0
675- duration: Components.UbuntuAnimation.FastDuration
676- }
677- }, PropertyAnimation {
678- id: optionCollapse
679- target: option
680- properties: "opacity"
681- from : 1.0
682- to: 0.0
683- duration: Components.UbuntuAnimation.SlowDuration
684- }
685- ]
686-
687- Row {
688- spacing: units.gu(1)
689-
690- anchors {
691- left: parent.left
692- leftMargin: units.gu(3)
693- verticalCenter: parent.verticalCenter
694- }
695-
696- Image {
697- id: leftIcon
698-
699- source: icon
700-
701- ShaderEffect {
702- property color colour: assetColour
703- property Image source: parent
704-
705- width: source.width
706- height: source.height
707- visible: colourImage
708-
709- fragmentShader: fragColourShader
710- }
711- }
712-
713- Column {
714- anchors {
715- verticalCenter: parent.verticalCenter
716- }
717- Label {
718- text: option.text === "" ? modelData : option.text
719- }
720- Label {
721- text: option.subText
722- visible: option.subText !== "" ? true : false
723- fontSize: "small"
724- }
725- }
726- }
727-
728- Image {
729- id: image
730-
731- width: units.gu(2)
732- height: units.gu(2)
733- source: listView.expanded ? listView.container.tick : listView.container.chevron
734- opacity: option.selected ? 1.0 : 0.0
735- anchors {
736- right: parent.right
737- rightMargin: units.gu(2)
738- verticalCenter: parent.verticalCenter
739- }
740-
741- //Our behaviour is only enabled for our expanded list due to flickering bugs in relation to all this other animations running on the expanding version.
742- Behavior on opacity {
743- enabled: listView.expanded
744-
745- UbuntuNumberAnimation {
746- properties: "opacity"
747- duration: Components.UbuntuAnimation.FastDuration
748- }
749- }
750-
751- ShaderEffect {
752- property color colour: assetColour
753- property Image source: parent
754-
755- width: source.width
756- height: source.height
757-
758- fragmentShader: fragColourShader
759- }
760- }
761-}
762
763=== removed file 'modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml'
764--- modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml 2013-07-17 10:10:37 +0000
765+++ modules/Ubuntu/Components/Themes/Ambiance/OptionSelectorStyle.qml 1970-01-01 00:00:00 +0000
766@@ -1,35 +0,0 @@
767-/*
768- * Copyright 2013 Canonical Ltd.
769- *
770- * This program is free software; you can redistribute it and/or modify
771- * it under the terms of the GNU Lesser General Public License as published by
772- * the Free Software Foundation; version 3.
773- *
774- * This program is distributed in the hope that it will be useful,
775- * but WITHOUT ANY WARRANTY; without even the implied warranty of
776- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
777- * GNU Lesser General Public License for more details.
778- *
779- * You should have received a copy of the GNU Lesser General Public License
780- * along with this program. If not, see <http://www.gnu.org/licenses/>.
781- *
782- */
783-
784-import QtQuick 2.0
785-import Ubuntu.Components 0.1
786-
787-Item {
788- id: ambianceStyle
789-
790- property url chevron: "../../artwork/chevron_down@30.png"
791- property url tick: "../../artwork/tick@30.png"
792- property bool colourComponent: true
793-
794- UbuntuShape {
795- id: background
796-
797- width: styledItem.width
798- height: styledItem.height
799- radius: "medium"
800- }
801-}
802
803=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/tick@30.png'
804Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/tick@30.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/tick@30.png 2013-08-28 08:10:15 +0000 differ
805=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/qmldir'
806--- modules/Ubuntu/Components/Themes/Ambiance/qmldir 2013-08-22 09:03:17 +0000
807+++ modules/Ubuntu/Components/Themes/Ambiance/qmldir 2013-08-28 08:10:15 +0000
808@@ -5,8 +5,7 @@
809 internal DialogForegroundStyle DialogForegroundStyle.qml
810 internal HeaderStyle HeaderStyle.qml
811 MainViewStyle 0.1 MainViewStyle.qml
812-OptionSelectorStyle 0.1 OptionSelectorStyle.qml
813-internal PopoverForegroundStyle PopoverForegroundStyle.qml
814+PopoverForegroundStyle 0.1 PopoverForegroundStyle.qml
815 internal ScrollbarStyle ScrollbarStyle.qml
816 internal SelectionCursorStyle SelectionCursorStyle.qml
817 internal SheetForegroundStyle SheetForegroundStyle.qml
818
819=== removed file 'modules/Ubuntu/Components/Themes/SuruDark/OptionSelectorStyle.qml'
820--- modules/Ubuntu/Components/Themes/SuruDark/OptionSelectorStyle.qml 2013-07-17 10:10:37 +0000
821+++ modules/Ubuntu/Components/Themes/SuruDark/OptionSelectorStyle.qml 1970-01-01 00:00:00 +0000
822@@ -1,23 +0,0 @@
823-/*
824- * Copyright 2013 Canonical Ltd.
825- *
826- * This program is free software; you can redistribute it and/or modify
827- * it under the terms of the GNU Lesser General Public License as published by
828- * the Free Software Foundation; version 3.
829- *
830- * This program is distributed in the hope that it will be useful,
831- * but WITHOUT ANY WARRANTY; without even the implied warranty of
832- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
833- * GNU Lesser General Public License for more details.
834- *
835- * You should have received a copy of the GNU Lesser General Public License
836- * along with this program. If not, see <http://www.gnu.org/licenses/>.
837- *
838- */
839-
840-import QtQuick 2.0
841-import Ubuntu.Components.Themes.Ambiance 0.1
842-
843-OptionSelectorStyle {
844- id: suruDarkStyle
845-}
846
847=== removed file 'modules/Ubuntu/Components/Themes/SuruGradient/OptionSelectorStyle.qml'
848--- modules/Ubuntu/Components/Themes/SuruGradient/OptionSelectorStyle.qml 2013-07-17 10:10:37 +0000
849+++ modules/Ubuntu/Components/Themes/SuruGradient/OptionSelectorStyle.qml 1970-01-01 00:00:00 +0000
850@@ -1,27 +0,0 @@
851-/*
852- * Copyright 2013 Canonical Ltd.
853- *
854- * This program is free software; you can redistribute it and/or modify
855- * it under the terms of the GNU Lesser General Public License as published by
856- * the Free Software Foundation; version 3.
857- *
858- * This program is distributed in the hope that it will be useful,
859- * but WITHOUT ANY WARRANTY; without even the implied warranty of
860- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
861- * GNU Lesser General Public License for more details.
862- *
863- * You should have received a copy of the GNU Lesser General Public License
864- * along with this program. If not, see <http://www.gnu.org/licenses/>.
865- *
866- */
867-
868-import QtQuick 2.0
869-import Ubuntu.Components.Themes.Ambiance 0.1
870-
871-OptionSelectorStyle {
872- id: suruGradientStyle
873-
874- chevron: "artwork/chevron_down@30.png"
875- tick: "artwork/tick@30.png"
876- colourComponent: false
877-}
878
879=== removed directory 'modules/Ubuntu/Components/Themes/SuruGradient/artwork'
880=== removed file 'modules/Ubuntu/Components/Themes/SuruGradient/artwork/chevron_down@30.png'
881Binary files modules/Ubuntu/Components/Themes/SuruGradient/artwork/chevron_down@30.png 2013-07-25 16:50:54 +0000 and modules/Ubuntu/Components/Themes/SuruGradient/artwork/chevron_down@30.png 1970-01-01 00:00:00 +0000 differ
882=== removed file 'modules/Ubuntu/Components/Themes/SuruGradient/artwork/tick@30.png'
883Binary files modules/Ubuntu/Components/Themes/SuruGradient/artwork/tick@30.png 2013-07-25 16:57:07 +0000 and modules/Ubuntu/Components/Themes/SuruGradient/artwork/tick@30.png 1970-01-01 00:00:00 +0000 differ
884=== removed file 'modules/Ubuntu/Components/artwork/chevron_down@30.png'
885Binary files modules/Ubuntu/Components/artwork/chevron_down@30.png 2013-07-17 10:10:37 +0000 and modules/Ubuntu/Components/artwork/chevron_down@30.png 1970-01-01 00:00:00 +0000 differ
886=== removed file 'modules/Ubuntu/Components/artwork/tick@30.png'
887Binary files modules/Ubuntu/Components/artwork/tick@30.png 2013-08-07 13:52:14 +0000 and modules/Ubuntu/Components/artwork/tick@30.png 1970-01-01 00:00:00 +0000 differ
888=== modified file 'modules/Ubuntu/Components/qmldir'
889--- modules/Ubuntu/Components/qmldir 2013-08-22 09:03:17 +0000
890+++ modules/Ubuntu/Components/qmldir 2013-08-28 08:10:15 +0000
891@@ -25,8 +25,6 @@
892 Scrollbar 0.1 Scrollbar.qml
893 internal ModelSectionCounter ModelSectionCounter.qml
894 Object 0.1 Object.qml
895-OptionSelector 0.1 OptionSelector.qml
896-OptionSelectorDelegate 0.1 OptionSelectorDelegate.qml
897 Page 0.1 Page.qml
898 internal PageTreeNode PageTreeNode.qml
899 PageStack 0.1 PageStack.qml
900
901=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py'
902--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2013-08-23 11:39:27 +0000
903+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2013-08-28 08:10:15 +0000
904@@ -69,11 +69,11 @@
905 "Buttons",
906 "Slider",
907 "Text Field",
908- "Option Selector",
909 "Progress and activity",
910 "Ubuntu Shape",
911 "Icons",
912 "Label",
913+ "List Items",
914 ]
915
916 for item in items:
917@@ -91,7 +91,6 @@
918
919 # now that we have more items, lets continue
920 items = [
921- "List Items",
922 "Dialog",
923 "Popover",
924 "Sheet",
925
926=== removed file 'tests/unit/tst_components/tst_optionselector.qml'
927--- tests/unit/tst_components/tst_optionselector.qml 2013-08-23 10:32:49 +0000
928+++ tests/unit/tst_components/tst_optionselector.qml 1970-01-01 00:00:00 +0000
929@@ -1,107 +0,0 @@
930-/*
931- * Copyright 2012 Canonical Ltd.
932- *
933- * This program is free software; you can redistribute it and/or modify
934- * it under the terms of the GNU Lesser General Public License as published by
935- * the Free Software Foundation; version 3.
936- *
937- * This program is distributed in the hope that it will be useful,
938- * but WITHOUT ANY WARRANTY; without even the implied warranty of
939- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
940- * GNU Lesser General Public License for more details.
941- *
942- * You should have received a copy of the GNU Lesser General Public License
943- * along with this program. If not, see <http://www.gnu.org/licenses/>.
944- */
945-
946-import QtQuick 2.0
947-import QtTest 1.0
948-import Ubuntu.Components 0.1
949-import Ubuntu.Test 0.1
950-
951-UbuntuTestCase {
952- name: "OptionSelectorAPI"
953-
954- function test_expanded() {
955- var listContainer = findChild(optionSelector, "listContainer");
956-
957- optionSelector.expanded = false;
958- compare(listContainer.isExpanded, false, "isExpanded should be true if list is an expanded one");
959-
960- optionSelector.expanded = true;
961- compare(listContainer.isExpanded, true, "isExpanded should be false if list is an expanded one");
962- }
963-
964- function test_states_and_signal() {
965- var listContainer = findChild(optionSelector, "listContainer");
966-
967- signalSpy.signalName = "scroll";
968- compare(signalSpy.count, 0);
969-
970- optionSelector.expanded = false;
971- compare(listContainer.state, "collapsed", "state should be collapsed");
972-
973- optionSelector.expanded = true;
974- compare(listContainer.state, "expanded", "state should be expanded");
975-
976- //Check if scroll signal was fired after expansion.
977- compare(signalSpy.count, 2);
978- }
979-
980- function test_text() {
981- compare(optionSelector.text,"","text is '' by default")
982- var newText = "Hello World!";
983- optionSelector.text = newText;
984- compare(optionSelector.text, newText, "set/get");
985- }
986-
987- function test_selectedIndex() {
988- compare(optionSelector.selectedIndex, 0, "selectedIndex is 0 by default");
989- }
990-
991- function test_values() {
992- compare(optionSelector.values,undefined,"values is undefined by default")
993- var newValues = ["value1","value2","value3"];
994- optionSelector.model = newValues;
995- compare(optionSelector.model, newValues, "set/get");
996- }
997-
998- function test_custom_model_delegate() {
999- compare(optionSelector.model, undefined, "model is undefined by default");
1000- optionSelector.model = customModel;
1001- optionSelector.delegate = selectorDelegate;
1002- compare(optionSelector.model, customModel, "Model wasn't set correctly.");
1003- compare(optionSelector.delegate, selectorDelegate, "Delegate hasn't been set correctly");
1004- }
1005-
1006- Rectangle {
1007- id: testItem
1008- }
1009-
1010- OptionSelector {
1011- id: optionSelector
1012-
1013- SignalSpy {
1014- id: signalSpy
1015- target: optionSelector
1016- }
1017- }
1018-
1019- OptionSelector {
1020- id: optionSelectorCustomModel
1021- }
1022-
1023- Component {
1024- id: selectorDelegate
1025-
1026- OptionSelectorDelegate { text: name; subText: description }
1027- }
1028-
1029- ListModel {
1030- id: customModel
1031- ListElement { name: "Name 1"; description: "Description 1" }
1032- ListElement { name: "Name 2"; description: "Description 2" }
1033- ListElement { name: "Name 3"; description: "Description 3" }
1034- ListElement { name: "Name 4"; description: "Description 4" }
1035- }
1036-}

Subscribers

People subscribed via source and target branches

to status/vote changes: