Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-dont-use-deprecated-shape-properties into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Superseded
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-dont-use-deprecated-shape-properties
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-resolution-independance
Diff against target: 415 lines (+61/-40)
16 files modified
examples/ubuntu-ui-toolkit-gallery/Colors.qml (+7/-7)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+2/-2)
modules/Ubuntu/Components/ListItems/1.3/IconVisual.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml (+3/-3)
modules/Ubuntu/Components/Themes/Ambiance/1.3/ButtonStyle.qml (+10/-8)
modules/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml (+2/-2)
modules/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml (+1/-2)
modules/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml (+2/-2)
modules/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml (+5/-5)
modules/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml (+1/-1)
modules/Ubuntu/Components/plugin/ucubuntushape.cpp (+20/-0)
tests/unit_x11/tst_layouts/Visibility.qml (+3/-3)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-dont-use-deprecated-shape-properties
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Tim Peeters Approve
Zsombor Egri Approve
Review via email: mp+254427@code.launchpad.net

This proposal has been superseded by a proposal from 2015-07-22.

Commit message

Ensured components, styles, examples and tests use the new UbuntuShape properties (not deprecated).

Description of the change

Ensured components, styles, examples and tests use the new UbuntuShape properties (not deprecated).

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

Second nobrainer :)

review: Approve
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 :

1.2.1458+15.04.20150327bzr1354pkg0vivid200/modules/Ubuntu/Components/Themes/Ambiance/ButtonStyle.qml:136:5: QML UbuntuShape: 'borderSource' is deprecated. Use 'aspect' instead.
Layout change should not happen when component is not defined
Layout change should not happen when component is not defined
file:///tmp/buildd/ubuntu-ui-toolkit-1.2.1458+15.04.20150327bzr1354pkg0vivid200/tests/unit_x11/tst_layouts/Visibility.qml:64:29: "UbuntuShape.backgroundColor" is not available in Ubuntu.Components 1.1.
                                 backgroundColor: "red"
                                 ^

The error must be fixed by updating the import version in Visibility.qml

It would be nice to fix the warnings as well.

review: Needs Fixing
Revision history for this message
Tim Peeters (tpeeters) wrote :

Thanks, happroving.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Conflicts!

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Colors.qml'
--- examples/ubuntu-ui-toolkit-gallery/Colors.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Colors.qml 2015-07-22 13:15:37 +0000
@@ -29,43 +29,43 @@
29 TemplateRow {29 TemplateRow {
30 title: i18n.tr("Orange")30 title: i18n.tr("Orange")
31 UbuntuShape {31 UbuntuShape {
32 color: UbuntuColors.orange32 backgroundColor: UbuntuColors.orange
33 }33 }
34 }34 }
35 TemplateRow {35 TemplateRow {
36 title: i18n.tr("Light grey")36 title: i18n.tr("Light grey")
37 UbuntuShape {37 UbuntuShape {
38 color: UbuntuColors.lightGrey38 backgroundColor: UbuntuColors.lightGrey
39 }39 }
40 }40 }
41 TemplateRow {41 TemplateRow {
42 title: i18n.tr("Dark grey")42 title: i18n.tr("Dark grey")
43 UbuntuShape {43 UbuntuShape {
44 color: UbuntuColors.darkGrey44 backgroundColor: UbuntuColors.darkGrey
45 }45 }
46 }46 }
47 TemplateRow {47 TemplateRow {
48 title: i18n.tr("Red")48 title: i18n.tr("Red")
49 UbuntuShape {49 UbuntuShape {
50 color: UbuntuColors.red50 backgroundColor: UbuntuColors.red
51 }51 }
52 }52 }
53 TemplateRow {53 TemplateRow {
54 title: i18n.tr("Green")54 title: i18n.tr("Green")
55 UbuntuShape {55 UbuntuShape {
56 color: UbuntuColors.green56 backgroundColor: UbuntuColors.green
57 }57 }
58 }58 }
59 TemplateRow {59 TemplateRow {
60 title: i18n.tr("Blue")60 title: i18n.tr("Blue")
61 UbuntuShape {61 UbuntuShape {
62 color: UbuntuColors.blue62 backgroundColor: UbuntuColors.blue
63 }63 }
64 }64 }
65 TemplateRow {65 TemplateRow {
66 title: i18n.tr("Purple")66 title: i18n.tr("Purple")
67 UbuntuShape {67 UbuntuShape {
68 color: UbuntuColors.purple68 backgroundColor: UbuntuColors.purple
69 }69 }
70 }70 }
71 }71 }
7272
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2015-04-29 07:21:29 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2015-07-22 13:15:37 +0000
@@ -352,7 +352,7 @@
352 Toolkit.UbuntuShape {352 Toolkit.UbuntuShape {
353 anchors { left: parent.left; right: parent.right }353 anchors { left: parent.left; right: parent.right }
354 height: index % 2 == 0 ? units.gu(6) : units.gu(18)354 height: index % 2 == 0 ? units.gu(6) : units.gu(18)
355 color: "khaki"355 backgroundColor: "khaki"
356 }356 }
357 }357 }
358 }358 }
@@ -393,7 +393,7 @@
393 Toolkit.UbuntuShape {393 Toolkit.UbuntuShape {
394 anchors { left: parent.left; right: parent.right }394 anchors { left: parent.left; right: parent.right }
395 height: index % 2 == 0 ? units.gu(6) : units.gu(18)395 height: index % 2 == 0 ? units.gu(6) : units.gu(18)
396 color: "khaki"396 backgroundColor: "khaki"
397 }397 }
398 }398 }
399 }399 }
400400
=== modified file 'modules/Ubuntu/Components/ListItems/1.3/IconVisual.qml'
--- modules/Ubuntu/Components/ListItems/1.3/IconVisual.qml 2015-04-29 07:21:29 +0000
+++ modules/Ubuntu/Components/ListItems/1.3/IconVisual.qml 2015-07-22 13:15:37 +0000
@@ -53,6 +53,6 @@
53 id: shape53 id: shape
54 visible: iconVisual.hasFrame54 visible: iconVisual.hasFrame
55 anchors.fill: parent55 anchors.fill: parent
56 image: icon56 source: icon
57 }57 }
58}58}
5959
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml 2015-04-24 14:07:02 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml 2015-07-22 13:15:37 +0000
@@ -110,9 +110,9 @@
110110
111 UbuntuShape {111 UbuntuShape {
112 anchors.fill: parent112 anchors.fill: parent
113 borderSource: "none"113 aspect: UbuntuShape.Flat
114 color: theme.palette.normal.overlay114 backgroundColor: theme.palette.normal.overlay
115 image: bubbleShape.clipContent ? shapeSource : null115 source: bubbleShape.clipContent ? shapeSource : null
116 visible: !square116 visible: !square
117 }117 }
118118
119119
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/ButtonStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/ButtonStyle.qml 2015-04-25 07:36:13 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/ButtonStyle.qml 2015-07-22 13:15:37 +0000
@@ -123,21 +123,23 @@
123 UbuntuShape {123 UbuntuShape {
124 id: background124 id: background
125 anchors.fill: parent125 anchors.fill: parent
126 borderSource: "radius_idle.sci"126 borderSource: "radius_idle.sci" // Deprecated, use a dedicated shape.
127 visible: stroke ? false : ((color.a != 0.0) || backgroundSource)127 visible: stroke ? false : ((backgroundColor.a != 0.0) || backgroundSource)
128 image: backgroundSource128 source: backgroundSource
129129
130 color: stroke ? "" : (backgroundSource ? "#00000000" : (isGradient ? __colorHack(gradientProxy.topColor) : __colorHack(button.color)))130 backgroundColor: backgroundSource ? "#00000000" : (isGradient ? __colorHack(gradientProxy.topColor) : __colorHack(button.color))
131 secondaryBackgroundColor: backgroundSource ? "#00000000" : (isGradient ? __colorHack(gradientProxy.bottomColor) : __colorHack(button.color))
132 backgroundMode: isGradient ? UbuntuShape.VerticalGradient : UbuntuShape.SolidColor
131 opacity: styledItem.enabled ? 1.0 : 0.6133 opacity: styledItem.enabled ? 1.0 : 0.6
132 gradientColor: stroke ? "" : (backgroundSource ? "#00000000" : (isGradient ? __colorHack(gradientProxy.bottomColor) : __colorHack(button.color)))
133 }134 }
134135
135 UbuntuShape {136 UbuntuShape {
136 id: backgroundPressed137 id: backgroundPressed
137 anchors.fill: parent138 anchors.fill: parent
138 color: stroke ? button.strokeColor : background.color139 backgroundColor: stroke ? button.strokeColor : background.backgroundColor
139 gradientColor: stroke ? button.strokeColor : background.gradientColor140 secondaryBackgroundColor: background.secondaryBackgroundColor
140 borderSource: "radius_pressed.sci"141 backgroundMode: stroke ? UbuntuShape.SolidColor : UbuntuShape.VerticalGradient
142 borderSource: "radius_pressed.sci" // Deprecated, use a dedicated shape.
141 opacity: button.pressed ? 1.0 : 0.0143 opacity: button.pressed ? 1.0 : 0.0
142 Behavior on opacity {144 Behavior on opacity {
143 NumberAnimation {145 NumberAnimation {
144146
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml 2015-04-24 14:07:02 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml 2015-07-22 13:15:37 +0000
@@ -86,7 +86,7 @@
86 }86 }
87 PropertyChanges {87 PropertyChanges {
88 target: background88 target: background
89 color: checkBoxStyle.checkedBackgroundColor89 backgroundColor: checkBoxStyle.checkedBackgroundColor
90 }90 }
91 },91 },
92 State {92 State {
@@ -97,7 +97,7 @@
97 }97 }
98 PropertyChanges {98 PropertyChanges {
99 target: background99 target: background
100 color: checkBoxStyle.uncheckedBackgroundColor100 backgroundColor: checkBoxStyle.uncheckedBackgroundColor
101 }101 }
102 }102 }
103 ]103 ]
104104
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml 2015-04-25 07:36:13 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/ComboButtonStyle.qml 2015-07-22 13:15:37 +0000
@@ -165,8 +165,7 @@
165 topMargin: comboListMargin165 topMargin: comboListMargin
166 }166 }
167 visible: true167 visible: true
168 borderSource: "radius_idle.sci"168 source: listContent
169 image: listContent
170 }169 }
171170
172 Image {171 Image {
173172
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml 2015-04-29 07:21:29 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml 2015-07-22 13:15:37 +0000
@@ -61,7 +61,7 @@
61 UbuntuShape {61 UbuntuShape {
62 anchors.fill: parent62 anchors.fill: parent
63 radius: "medium"63 radius: "medium"
64 image: shapeSource64 source: shapeSource
65 }65 }
6666
67 ShaderEffectSource {67 ShaderEffectSource {
6868
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml 2015-04-25 07:36:13 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml 2015-07-22 13:15:37 +0000
@@ -23,6 +23,6 @@
23 UbuntuShape {23 UbuntuShape {
24 id: background24 id: background
25 anchors.fill: parent25 anchors.fill: parent
26 color: "white"26 backgroundColor: "white"
27 }27 }
28}28}
2929
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-04-25 07:36:13 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-07-22 13:15:37 +0000
@@ -32,6 +32,6 @@
32 height: styledItem.height32 height: styledItem.height
33 radius: "medium"33 radius: "medium"
3434
35 color: Qt.rgba(0, 0, 0, 0.05)35 backgroundColor: Qt.rgba(0, 0, 0, 0.05)
36 }36 }
37}37}
3838
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml 2015-04-29 07:21:29 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml 2015-07-22 13:15:37 +0000
@@ -59,8 +59,8 @@
59 UbuntuShape {59 UbuntuShape {
60 anchors.fill: parent60 anchors.fill: parent
61 radius: "medium"61 radius: "medium"
62 color: theme.palette.normal.overlay62 backgroundColor: theme.palette.normal.overlay
63 image: shapeSource63 source: shapeSource
64 }64 }
6565
66 ShaderEffectSource {66 ShaderEffectSource {
6767
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml 2015-04-24 14:07:02 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml 2015-07-22 13:15:37 +0000
@@ -81,7 +81,7 @@
81 width: units.gu(2)81 width: units.gu(2)
82 height: units.gu(2)82 height: units.gu(2)
83 opacity: 0.9783 opacity: 0.97
84 color: theme.palette.normal.overlay84 backgroundColor: theme.palette.normal.overlay
85 }85 }
8686
87 BubbleShape {87 BubbleShape {
8888
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml 2015-04-24 14:07:02 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml 2015-07-22 13:15:37 +0000
@@ -74,7 +74,7 @@
74 UbuntuShape {74 UbuntuShape {
75 id: background75 id: background
76 anchors.fill: parent76 anchors.fill: parent
77 color: switchStyle.backgroundColor77 backgroundColor: switchStyle.backgroundColor
78 clip: true78 clip: true
7979
80 UbuntuShape {80 UbuntuShape {
@@ -86,7 +86,7 @@
86 PropertyChanges {86 PropertyChanges {
87 target: thumb87 target: thumb
88 x: rightThumbPosition.x88 x: rightThumbPosition.x
89 color: switchStyle.checkedThumbColor89 backgroundColor: switchStyle.checkedThumbColor
90 }90 }
91 },91 },
92 State {92 State {
@@ -95,7 +95,7 @@
95 PropertyChanges {95 PropertyChanges {
96 target: thumb96 target: thumb
97 x: leftThumbPosition.x97 x: leftThumbPosition.x
98 color: switchStyle.uncheckedThumbColor98 backgroundColor: switchStyle.uncheckedThumbColor
99 }99 }
100 }100 }
101 ]101 ]
@@ -114,7 +114,7 @@
114 }114 }
115 ColorAnimation {115 ColorAnimation {
116 target: thumb116 target: thumb
117 properties: "color"117 properties: "backgroundColor"
118 duration: UbuntuAnimation.FastDuration118 duration: UbuntuAnimation.FastDuration
119 easing: UbuntuAnimation.StandardEasing119 easing: UbuntuAnimation.StandardEasing
120 }120 }
@@ -130,7 +130,7 @@
130 }130 }
131 ColorAnimation {131 ColorAnimation {
132 target: thumb132 target: thumb
133 properties: "color"133 properties: "backgroundColor"
134 duration: UbuntuAnimation.FastDuration134 duration: UbuntuAnimation.FastDuration
135 easing: UbuntuAnimation.StandardEasing135 easing: UbuntuAnimation.StandardEasing
136 }136 }
137137
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2015-04-24 14:07:02 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2015-07-22 13:15:37 +0000
@@ -53,7 +53,7 @@
53 property Component background: UbuntuShape {53 property Component background: UbuntuShape {
54 property bool error: (styledItem.hasOwnProperty("errorHighlight") && styledItem.errorHighlight && !styledItem.acceptableInput)54 property bool error: (styledItem.hasOwnProperty("errorHighlight") && styledItem.errorHighlight && !styledItem.acceptableInput)
55 onErrorChanged: (error) ? visuals.errorColor : visuals.backgroundColor;55 onErrorChanged: (error) ? visuals.errorColor : visuals.backgroundColor;
56 color: visuals.backgroundColor;56 backgroundColor: visuals.backgroundColor
57 anchors.fill: parent57 anchors.fill: parent
58 visible: !styledItem.readOnly58 visible: !styledItem.readOnly
59 }59 }
6060
=== modified file 'modules/Ubuntu/Components/plugin/ucubuntushape.cpp'
--- modules/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-06-02 13:37:30 +0000
+++ modules/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-07-22 13:15:37 +0000
@@ -35,6 +35,7 @@
35#include <QtQuick/QSGTextureProvider>35#include <QtQuick/QSGTextureProvider>
36#include <QtQuick/private/qquickimage_p.h>36#include <QtQuick/private/qquickimage_p.h>
37#include <QtQuick/private/qsgadaptationlayer_p.h>37#include <QtQuick/private/qsgadaptationlayer_p.h>
38#include <QtQml/qqmlinfo.h>
38#include <math.h>39#include <math.h>
3940
40// Anti-aliasing distance of the contour in pixels.41// Anti-aliasing distance of the contour in pixels.
@@ -751,6 +752,11 @@
751*/752*/
752void UCUbuntuShape::setBorderSource(const QString& borderSource)753void UCUbuntuShape::setBorderSource(const QString& borderSource)
753{754{
755 // FIXME(loicm) Commented for now since even if it's deprecated, buttons have to use it in order
756 // to get a pressed aspect. This is a temporary solution before using a dedicated button
757 // shape.
758 // qmlInfo(this) << "'borderSource' is deprecated. Use 'aspect' instead.";
759
754 if (!(m_flags & AspectSet)) {760 if (!(m_flags & AspectSet)) {
755 quint8 aspect;761 quint8 aspect;
756 if (borderSource.endsWith(QString("radius_idle.sci"))) {762 if (borderSource.endsWith(QString("radius_idle.sci"))) {
@@ -779,6 +785,9 @@
779*/785*/
780void UCUbuntuShape::setColor(const QColor& color)786void UCUbuntuShape::setColor(const QColor& color)
781{787{
788 qmlInfo(this) << "'color' is deprecated. Use 'backgroundColor', 'secondaryBackgroundColor' and "
789 "'backgroundMode' instead.";
790
782 if (!(m_flags & BackgroundApiSet)) {791 if (!(m_flags & BackgroundApiSet)) {
783 const QRgb colorRgb = qRgba(color.red(), color.green(), color.blue(), color.alpha());792 const QRgb colorRgb = qRgba(color.red(), color.green(), color.blue(), color.alpha());
784 if (m_backgroundColor != colorRgb) {793 if (m_backgroundColor != colorRgb) {
@@ -805,6 +814,9 @@
805*/814*/
806void UCUbuntuShape::setGradientColor(const QColor& gradientColor)815void UCUbuntuShape::setGradientColor(const QColor& gradientColor)
807{816{
817 qmlInfo(this) << "'gradientColor' is deprecated. Use 'backgroundColor', "
818 "'secondaryBackgroundColor' and 'backgroundMode' instead.";
819
808 if (!(m_flags & BackgroundApiSet)) {820 if (!(m_flags & BackgroundApiSet)) {
809 m_flags |= GradientColorSet;821 m_flags |= GradientColorSet;
810 const QRgb gradientColorRgb = qRgba(822 const QRgb gradientColorRgb = qRgba(
@@ -829,6 +841,8 @@
829*/841*/
830void UCUbuntuShape::setImage(const QVariant& image)842void UCUbuntuShape::setImage(const QVariant& image)
831{843{
844 qmlInfo(this) << "'image' is deprecated. Use 'source' instead.";
845
832 if (!(m_flags & SourceApiSet)) {846 if (!(m_flags & SourceApiSet)) {
833 QQuickItem* newImage = qobject_cast<QQuickItem*>(qvariant_cast<QObject*>(image));847 QQuickItem* newImage = qobject_cast<QQuickItem*>(qvariant_cast<QObject*>(image));
834 if (m_source != newImage) {848 if (m_source != newImage) {
@@ -856,6 +870,8 @@
856// maintain it for a while for compatibility reasons.870// maintain it for a while for compatibility reasons.
857void UCUbuntuShape::setStretched(bool stretched)871void UCUbuntuShape::setStretched(bool stretched)
858{872{
873 qmlInfo(this) << "'stretched' is deprecated. Use 'sourceFillMode' instead";
874
859 if (!(m_flags & SourceApiSet)) {875 if (!(m_flags & SourceApiSet)) {
860 if (!!(m_flags & Stretched) != stretched) {876 if (!!(m_flags & Stretched) != stretched) {
861 if (stretched) {877 if (stretched) {
@@ -873,6 +889,8 @@
873// Deprecation layer. Same comment as setStretched().889// Deprecation layer. Same comment as setStretched().
874void UCUbuntuShape::setHorizontalAlignment(HAlignment horizontalAlignment)890void UCUbuntuShape::setHorizontalAlignment(HAlignment horizontalAlignment)
875{891{
892 qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceHorizontalAlignment' instead";
893
876 if (!(m_flags & SourceApiSet)) {894 if (!(m_flags & SourceApiSet)) {
877 if (m_imageHorizontalAlignment != horizontalAlignment) {895 if (m_imageHorizontalAlignment != horizontalAlignment) {
878 m_imageHorizontalAlignment = horizontalAlignment;896 m_imageHorizontalAlignment = horizontalAlignment;
@@ -886,6 +904,8 @@
886// Deprecation layer. Same comment as setStretched().904// Deprecation layer. Same comment as setStretched().
887void UCUbuntuShape::setVerticalAlignment(VAlignment verticalAlignment)905void UCUbuntuShape::setVerticalAlignment(VAlignment verticalAlignment)
888{906{
907 qmlInfo(this) << "'horizontalAlignment' is deprecated. Use 'sourceVerticalAlignment' instead";
908
889 if (!(m_flags & SourceApiSet)) {909 if (!(m_flags & SourceApiSet)) {
890 if (m_imageVerticalAlignment != verticalAlignment) {910 if (m_imageVerticalAlignment != verticalAlignment) {
891 m_imageVerticalAlignment = verticalAlignment;911 m_imageVerticalAlignment = verticalAlignment;
892912
=== modified file 'tests/unit_x11/tst_layouts/Visibility.qml'
--- tests/unit_x11/tst_layouts/Visibility.qml 2015-03-03 13:20:06 +0000
+++ tests/unit_x11/tst_layouts/Visibility.qml 2015-07-22 13:15:37 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Ubuntu.Layouts 1.019import Ubuntu.Layouts 1.0
2020
21MainView {21MainView {
@@ -61,7 +61,7 @@
61 UbuntuShape {61 UbuntuShape {
62 width: units.gu(20)62 width: units.gu(20)
63 height: units.gu(20)63 height: units.gu(20)
64 color: "red"64 backgroundColor: "red"
65 Label { text: "wide" }65 Label { text: "wide" }
66 }66 }
67 }67 }
@@ -74,7 +74,7 @@
74 objectName: "DefaultLayout"74 objectName: "DefaultLayout"
75 width: units.gu(20)75 width: units.gu(20)
76 height: units.gu(20)76 height: units.gu(20)
77 color: "green"77 backgroundColor: "green"
78 visible: main.boundValue78 visible: main.boundValue
79 Label { text: "default" }79 Label { text: "default" }
80 }80 }

Subscribers

People subscribed via source and target branches