on xenial help sign in
Changed UbuntuShape APIs for files in qml/ dir
2bd22f5Andrea Cimitan
qml/Components/LazyImage.qml+5−6
@@ -53,7 +53,7 @@ Item {
53 UbuntuShape {
53 UbuntuShape {
54 id: placeholder
54 id: placeholder
55 objectName: "placeholder"
55 objectName: "placeholder"
56− color: "#22FFFFFF"
56+ backgroundColor: "#22FFFFFF"
57 anchors.fill: shape
57 anchors.fill: shape
58 visible: opacity != 0
58 visible: opacity != 0
59
59
@@ -87,19 +87,18 @@ Item {
87
87
88 opacity: 0
88 opacity: 0
89 visible: opacity != 0
89 visible: opacity != 0
90−
90+ sourceFillMode: UbuntuShape.PreserveAspectFit
91+ sourceHorizontalAlignment: UbuntuShape.AlignHCenter
92+ sourceVerticalAlignment: UbuntuShape.AlignVCenter
91− image: Image {
93+ source: Image {
92 id: image
94 id: image
93 objectName: "image"
95 objectName: "image"
94
96
95 property url nextSource
97 property url nextSource
96 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
98 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
97
99
98− fillMode: Image.PreserveAspectFit
99 asynchronous: true
100 asynchronous: true
100 cache: false
101 cache: false
101− horizontalAlignment: Image.AlignHCenter
102− verticalAlignment: Image.AlignVCenter
103 sourceSize.width: root.scaleTo == "width" ? root.width
102 sourceSize.width: root.scaleTo == "width" ? root.width
104 : root.scaleTo == "fit" && root.width <= root.height ? root.width
103 : root.scaleTo == "fit" && root.width <= root.height ? root.width
105 : 0
104 : 0
qml/Dash/Previews/PreviewAudioPlayback.qml+1−1
@@ -175,7 +175,7 @@ PreviewWidget {
175 }
175 }
176 height: units.dp(2)
176 height: units.dp(2)
177 visible: progressBarImage.visible
177 visible: progressBarImage.visible
178− color: UbuntuColors.orange
178+ backgroundColor: UbuntuColors.orange
179 }
179 }
180
180
181 Image {
181 Image {
qml/Dash/Previews/PreviewHeader.qml+4−4
@@ -78,15 +78,15 @@ PreviewWidget {
78 sourceComponent: UbuntuShape {
78 sourceComponent: UbuntuShape {
79 objectName: "mascotShape"
79 objectName: "mascotShape"
80 visible: image.status === Image.Ready
80 visible: image.status === Image.Ready
81+ sourceFillMode: UbuntuShape.PreserveAspectCrop
82+ sourceHorizontalAlignment: UbuntuShape.AlignHCenter
83+ sourceVerticalAlignment: UbuntuShape.AlignVCenter
81− image: Image {
84+ source: Image {
82 source: headerRoot.mascot
85 source: headerRoot.mascot
83 width: source ? mascotShapeLoader.width : 0
86 width: source ? mascotShapeLoader.width : 0
84 height: mascotShapeLoader.height
87 height: mascotShapeLoader.height
85
88
86 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
89 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
87− fillMode: Image.PreserveAspectCrop
88− horizontalAlignment: Image.AlignHCenter
89− verticalAlignment: Image.AlignVCenter
90 onStatusChanged: if (status === Image.Error) source = headerRoot.fallback;
90 onStatusChanged: if (status === Image.Error) source = headerRoot.fallback;
91 }
91 }
92 }
92 }
qml/Dash/ScopesListCategoryItem.qml+2−2
@@ -49,10 +49,10 @@ MouseArea {
49 width: units.gu(5)
49 width: units.gu(5)
50 height: units.gu(5)
50 height: units.gu(5)
51 visible: !hideChildren
51 visible: !hideChildren
52+ sourceFillMode: UbuntuShape.PreserveAspectCrop
52− image: Image {
53+ source: Image {
53 id: shapeImage
54 id: shapeImage
54 cache: true
55 cache: true
55− fillMode: Image.PreserveAspectCrop
56 sourceSize { width: shape.width; height: shape.height }
56 sourceSize { width: shape.width; height: shape.height }
57 }
57 }
58 }
58 }
qml/Launcher/LauncherDelegate.qml+5−6
@@ -51,13 +51,12 @@ Item {
51 anchors.fill: parent
51 anchors.fill: parent
52 anchors.margins: units.gu(1)
52 anchors.margins: units.gu(1)
53 radius: "medium"
53 radius: "medium"
54− borderSource: "none"
54+ aspect: UbuntuShape.Flat
55−
55+ sourceFillMode: UbuntuShape.PreserveAspectCrop
56− image: Image {
56+ source: Image {
57 id: iconImage
57 id: iconImage
58 sourceSize.width: iconShape.width
58 sourceSize.width: iconShape.width
59 sourceSize.height: iconShape.height
59 sourceSize.height: iconShape.height
60− fillMode: Image.PreserveAspectCrop
61 source: root.iconName
60 source: root.iconName
62 }
61 }
63 }
62 }
@@ -80,9 +79,9 @@ Item {
80 }
79 }
81 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
80 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
82 height: units.gu(2)
81 height: units.gu(2)
83− color: UbuntuColors.orange
82+ backgroundColor: UbuntuColors.orange
84 visible: root.countVisible
83 visible: root.countVisible
85− borderSource: "none"
84+ aspect: UbuntuShape.Flat
86
85
87 Label {
86 Label {
88 id: countLabel
87 id: countLabel
qml/Launcher/LauncherPanel.qml+2−2
@@ -61,8 +61,8 @@ Rectangle {
61 fill: parent
61 fill: parent
62 topMargin: -units.gu(2)
62 topMargin: -units.gu(2)
63 }
63 }
64− borderSource: "none"
64+ aspect: UbuntuShape.Flat
65− color: UbuntuColors.orange
65+ backgroundColor: UbuntuColors.orange
66 }
66 }
67
67
68 Image {
68 Image {
qml/Notifications/Notification.qml+6−6
@@ -142,10 +142,10 @@ Item {
142 rightMargin: notification.margins
142 rightMargin: notification.margins
143 topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
143 topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
144 }
144 }
145− color: parent.color
145+ backgroundColor: parent.color
146 opacity: parent.opacity
146 opacity: parent.opacity
147 radius: "medium"
147 radius: "medium"
148− borderSource: "none"
148+ aspect: UbuntuShape.Flat
149 }
149 }
150
150
151 Rectangle {
151 Rectangle {
@@ -345,8 +345,8 @@ Item {
345 }
345 }
346
346
347 height: units.gu(1)
347 height: units.gu(1)
348− color: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
348+ backgroundColor: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
349− borderSource: "none"
349+ aspect: UbuntuShape.Flat
350 radius: "small"
350 radius: "small"
351
351
352 UbuntuShape {
352 UbuntuShape {
@@ -354,8 +354,8 @@ Item {
354 objectName: "innerBar"
354 objectName: "innerBar"
355 width: valueIndicator.width * valueIndicator.value / 100
355 width: valueIndicator.width * valueIndicator.value / 100
356 height: units.gu(1)
356 height: units.gu(1)
357− color: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
357+ backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
358− borderSource: "none"
358+ aspect: UbuntuShape.Flat
359 radius: "small"
359 radius: "small"
360 }
360 }
361 }
361 }
qml/Notifications/OptionToggle.qml+2−2
@@ -29,8 +29,8 @@ UbuntuShape {
29
29
30 signal triggered(string id)
30 signal triggered(string id)
31
31
32− color: theme.palette.normal.base
32+ backgroundColor: theme.palette.normal.base
33− borderSource: "none"
33+ aspect: UbuntuShape.Flat
34 height: expanded ? (optionToggleRepeater.count - startIndex) * itemHeight : itemHeight
34 height: expanded ? (optionToggleRepeater.count - startIndex) * itemHeight : itemHeight
35 width: parent.width
35 width: parent.width
36 radius: "medium"
36 radius: "medium"
qml/Notifications/SwipeToAct.qml+8−8
@@ -68,16 +68,16 @@ Item {
68 id: row
68 id: row
69 width: parent.width
69 width: parent.width
70 height: priv.sliderHeight
70 height: priv.sliderHeight
71− color: priv.sliderBGColor
71+ backgroundColor: priv.sliderBGColor
72− borderSource: "none"
72+ aspect: UbuntuShape.Flat
73
73
74 UbuntuShape {
74 UbuntuShape {
75 id: leftShape
75 id: leftShape
76 anchors.top: parent.top
76 anchors.top: parent.top
77 anchors.left: parent.left
77 anchors.left: parent.left
78 anchors.margins: priv.gap
78 anchors.margins: priv.gap
79− color: UbuntuColors.red
79+ backgroundColor: UbuntuColors.red
80− borderSource: "none"
80+ aspect: UbuntuShape.Flat
81
81
82 state: "normal"
82 state: "normal"
83 height: units.gu(6)
83 height: units.gu(6)
@@ -155,10 +155,10 @@ Item {
155 }
155 }
156
156
157 z: 1
157 z: 1
158− color: priv.sliderMainColor
158+ backgroundColor: priv.sliderMainColor
159 height: units.gu(6)
159 height: units.gu(6)
160 width: units.gu(6)
160 width: units.gu(6)
161− borderSource: "none"
161+ aspect: UbuntuShape.Flat
162 radius: "medium"
162 radius: "medium"
163 Icon {
163 Icon {
164 anchors.fill: parent
164 anchors.fill: parent
@@ -192,8 +192,8 @@ Item {
192 anchors.top: parent.top
192 anchors.top: parent.top
193 anchors.right: parent.right
193 anchors.right: parent.right
194 anchors.margins: priv.gap
194 anchors.margins: priv.gap
195− color: UbuntuColors.green
195+ backgroundColor: UbuntuColors.green
196− borderSource: "none"
196+ aspect: UbuntuShape.Flat
197
197
198 state: "normal"
198 state: "normal"
199 height: units.gu(6)
199 height: units.gu(6)
qml/Stages/Splash.qml+3−4
@@ -121,14 +121,13 @@ Item {
121 visible: d.showIcon
121 visible: d.showIcon
122
122
123 radius: "medium"
123 radius: "medium"
124− borderSource: "none"
124+ aspect: UbuntuShape.Flat
125−
125+ sourceFillMode: Image.PreserveAspectCrop
126− image: Image {
126+ source: Image {
127 id: iconImage
127 id: iconImage
128 sourceSize.width: iconShape.width
128 sourceSize.width: iconShape.width
129 sourceSize.height: iconShape.height
129 sourceSize.height: iconShape.height
130 source: d.showIcon ? root.icon : ""
130 source: d.showIcon ? root.icon : ""
131− fillMode: Image.PreserveAspectCrop
132 }
131 }
133 }
132 }
134
133