on xenial help sign in
Updated all 1.3 UbuntuShape to use new APIs where possible
59eee29Andrea Cimitan
plugins/Dash/CardCreator.js+20−46
@@ -28,11 +28,12 @@ var kBackgroundLoaderCode = 'Loader {\n\
28 sourceComponent: UbuntuShape { \n\
28 sourceComponent: UbuntuShape { \n\
29 objectName: "background"; \n\
29 objectName: "background"; \n\
30 radius: "medium"; \n\
30 radius: "medium"; \n\
31− color: getColor(0) || "white"; \n\
31+ backgroundColor: getColor(0) || "white"; \n\
32− gradientColor: getColor(1) || color; \n\
32+ secondaryBackgroundColor: getColor(1) || backgroundColor; \n\
33+ backgroundMode: UbuntuShape.VerticalGradient; \n\
33 anchors.fill: parent; \n\
34 anchors.fill: parent; \n\
34− image: backgroundImage.source ? backgroundImage : null; \n\
35+ source: backgroundImage.source ? backgroundImage : null; \n\
35− property real luminance: Style.luminance(color); \n\
36+ property real luminance: Style.luminance(backgroundColor); \n\
36 property Image backgroundImage: Image { \n\
37 property Image backgroundImage: Image { \n\
37 objectName: "backgroundImage"; \n\
38 objectName: "backgroundImage"; \n\
38 source: { \n\
39 source: { \n\
@@ -52,7 +53,7 @@ var kBackgroundLoaderCode = 'Loader {\n\
52// %1 is used as anchors of artShapeHolder
53// %1 is used as anchors of artShapeHolder
53// %2 is used as image width
54// %2 is used as image width
54// %3 is used as image height
55// %3 is used as image height
55−var kArtShapeHolderCode = 'Item { \n\
56+var kArtShapeHolderCode = 'Item { \n\
56 id: artShapeHolder; \n\
57 id: artShapeHolder; \n\
57 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
58 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
58 width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width; \n\
59 width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width; \n\
@@ -66,10 +67,9 @@ var kArtShapeHolderCode = 'Item { \n\
66 sourceComponent: Item { \n\
67 sourceComponent: Item { \n\
67 id: artShape; \n\
68 id: artShape; \n\
68 objectName: "artShape"; \n\
69 objectName: "artShape"; \n\
69− property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
70+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
70 visible: image.status == Image.Ready; \n\
71 visible: image.status == Image.Ready; \n\
71 readonly property alias image: artImage; \n\
72 readonly property alias image: artImage; \n\
72− property alias borderSource: artShapeShape.borderSource; \n\
73 ShaderEffectSource { \n\
73 ShaderEffectSource { \n\
74 id: artShapeSource; \n\
74 id: artShapeSource; \n\
75 sourceItem: artImage; \n\
75 sourceItem: artImage; \n\
@@ -78,16 +78,17 @@ var kArtShapeHolderCode = 'Item { \n\
78 height: 1; \n\
78 height: 1; \n\
79 hideSource: doShapeItem; \n\
79 hideSource: doShapeItem; \n\
80 } \n\
80 } \n\
81− Shape { \n\
81+ UbuntuShape { \n\
82 id: artShapeShape; \n\
82 id: artShapeShape; \n\
83− image: artShapeSource; \n\
83+ source: artShapeSource; \n\
84 anchors.fill: parent; \n\
84 anchors.fill: parent; \n\
85 visible: doShapeItem; \n\
85 visible: doShapeItem; \n\
86 radius: "medium"; \n\
86 radius: "medium"; \n\
87+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat; \n\
87 } \n\
88 } \n\
88 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
89 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
89 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
90 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
90− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
91+ Component.onCompleted: { updateWidthHeightBindings(); } \n\
91 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
92 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
92 function updateWidthHeightBindings() { \n\
93 function updateWidthHeightBindings() { \n\
93 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\
94 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\
@@ -112,44 +113,18 @@ var kArtShapeHolderCode = 'Item { \n\
112
113
113var kOverlayLoaderCode = 'Loader { \n\
114var kOverlayLoaderCode = 'Loader { \n\
114 id: overlayLoader; \n\
115 id: overlayLoader; \n\
115− anchors { \n\
116+ readonly property real overlayHeight: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\
116− left: artShapeHolder.left; \n\
117− right: artShapeHolder.right; \n\
117+ anchors.fill: artShapeHolder; \n\
118− bottom: artShapeHolder.bottom; \n\
119− } \n\
120 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
118 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
121 asynchronous: root.asynchronous; \n\
119 asynchronous: root.asynchronous; \n\
122 visible: showHeader && status == Loader.Ready; \n\
120 visible: showHeader && status == Loader.Ready; \n\
123− sourceComponent: ShaderEffect { \n\
121+ sourceComponent: UbuntuShapeOverlay { \n\
124 id: overlay; \n\
122 id: overlay; \n\
125− height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\
126 property real luminance: Style.luminance(overlayColor); \n\
123 property real luminance: Style.luminance(overlayColor); \n\
124+ aspect: UbuntuShape.Flat; \n\
125+ radius: "medium"; \n\
127− property color overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\
126+ overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\
128− property var source: ShaderEffectSource { \n\
127+ overlayRect: Qt.rect(0, 1 - overlayLoader.overlayHeight / height, 1, 1); \n\
129− id: shaderSource; \n\
130− sourceItem: artShapeLoader.item; \n\
131− onVisibleChanged: if (visible) scheduleUpdate(); \n\
132− live: false; \n\
133− sourceRect: Qt.rect(0, artShapeLoader.height - overlay.height, artShapeLoader.width, overlay.height); \n\
134− } \n\
135− vertexShader: " \n\
136− uniform highp mat4 qt_Matrix; \n\
137− attribute highp vec4 qt_Vertex; \n\
138− attribute highp vec2 qt_MultiTexCoord0; \n\
139− varying highp vec2 coord; \n\
140− void main() { \n\
141− coord = qt_MultiTexCoord0; \n\
142− gl_Position = qt_Matrix * qt_Vertex; \n\
143− }"; \n\
144− fragmentShader: " \n\
145− varying highp vec2 coord; \n\
146− uniform sampler2D source; \n\
147− uniform lowp float qt_Opacity; \n\
148− uniform highp vec4 overlayColor; \n\
149− void main() { \n\
150− lowp vec4 tex = texture2D(source, coord); \n\
151− gl_FragColor = vec4(overlayColor.r, overlayColor.g, overlayColor.b, 1) * qt_Opacity * overlayColor.a * tex.a; \n\
152− }"; \n\
153 } \n\
128 } \n\
154 }\n';
129 }\n';
155
130
@@ -325,7 +300,7 @@ function cardString(template, components) {
325 id: root; \n\
300 id: root; \n\
326 property var components; \n\
301 property var components; \n\
327 property var cardData; \n\
302 property var cardData; \n\
328− property var artShapeBorderSource: undefined; \n\
303+ property string artShapeStyle: "inset"; \n\
329 property real fontScale: 1.0; \n\
304 property real fontScale: 1.0; \n\
330 property var scopeStyle: null; \n\
305 property var scopeStyle: null; \n\
331 property int titleAlignment: Text.AlignLeft; \n\
306 property int titleAlignment: Text.AlignLeft; \n\
@@ -368,7 +343,6 @@ function cardString(template, components) {
368 }
343 }
369
344
370 if (hasArt) {
345 if (hasArt) {
371− code += 'onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } \n';
372 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
346 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
373
347
374 var widthCode, heightCode;
348 var widthCode, heightCode;
@@ -555,7 +529,7 @@ function cardString(template, components) {
555 titleAnchors += 'left: parent.left; \n\
529 titleAnchors += 'left: parent.left; \n\
556 leftMargin: units.gu(1); \n\
530 leftMargin: units.gu(1); \n\
557 top: overlayLoader.top; \n\
531 top: overlayLoader.top; \n\
558− topMargin: units.gu(1);\n';
532+ topMargin: units.gu(1) + overlayLoader.height - overlayLoader.overlayHeight; \n';
559 } else {
533 } else {
560 // Using anchors to the mascot/parent
534 // Using anchors to the mascot/parent
561 titleAnchors = titleRightAnchor;
535 titleAnchors = titleRightAnchor;
qml/Components/LazyImage.qml+9−11
@@ -31,13 +31,10 @@ Item {
31 property real initialHeight: scaleTo == "height" || scaleTo == "fit" ? height : units.gu(10)
31 property real initialHeight: scaleTo == "height" || scaleTo == "fit" ? height : units.gu(10)
32
32
33 property alias sourceSize: image.sourceSize
33 property alias sourceSize: image.sourceSize
34− property alias fillMode: image.fillMode
35 property alias asynchronous: image.asynchronous
34 property alias asynchronous: image.asynchronous
36 property alias cache: image.cache
35 property alias cache: image.cache
37− property alias horizontalAlignment: image.horizontalAlignment
38− property alias verticalAlignment: image.verticalAlignment
39 property alias sourceImage: image
36 property alias sourceImage: image
40− property alias borderSource: shape.borderSource
37+ property bool pressed: false
41
38
42 state: "default"
39 state: "default"
43
40
@@ -53,7 +50,7 @@ Item {
53 UbuntuShape {
50 UbuntuShape {
54 id: placeholder
51 id: placeholder
55 objectName: "placeholder"
52 objectName: "placeholder"
56− color: "#22FFFFFF"
53+ backgroundColor: "#22FFFFFF"
57 anchors.fill: shape
54 anchors.fill: shape
58 visible: opacity != 0
55 visible: opacity != 0
59
56
@@ -78,7 +75,7 @@ Item {
78 }
75 }
79 }
76 }
80
77
81− UbuntuShape {
78+ UbuntuShapeOverlay {
82 id: shape
79 id: shape
83 objectName: "shape"
80 objectName: "shape"
84 height: root.initialHeight
81 height: root.initialHeight
@@ -87,19 +84,20 @@ Item {
87
84
88 opacity: 0
85 opacity: 0
89 visible: opacity != 0
86 visible: opacity != 0
90−
87+ overlayColor: Qt.rgba(0, 0, 0, root.pressed ? 0.1 : 0)
88+ overlayRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
89+ sourceFillMode: UbuntuShape.PreserveAspectCrop
90+ sourceHorizontalAlignment: UbuntuShape.AlignHCenter
91+ sourceVerticalAlignment: UbuntuShape.AlignVCenter
91− image: Image {
92+ source: Image {
92 id: image
93 id: image
93 objectName: "image"
94 objectName: "image"
94
95
95 property url nextSource
96 property url nextSource
96 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
97 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
97
98
98− fillMode: Image.PreserveAspectFit
99 asynchronous: true
99 asynchronous: true
100 cache: false
100 cache: false
101− horizontalAlignment: Image.AlignHCenter
102− verticalAlignment: Image.AlignVCenter
103 sourceSize.width: root.scaleTo == "width" ? root.width
101 sourceSize.width: root.scaleTo == "width" ? root.width
104 : root.scaleTo == "fit" && root.width <= root.height ? root.width
102 : root.scaleTo == "fit" && root.width <= root.height ? root.width
105 : 0
103 : 0
qml/Dash/CardCarousel.qml+1−1
@@ -68,7 +68,7 @@ DashRenderer {
68 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
68 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
69 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
69 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
70 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
70 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
71− item.artShapeBorderSource = "none";
71+ item.artShapeStyle = "flat";
72 item.scopeStyle = cardCarousel.scopeStyle;
72 item.scopeStyle = cardCarousel.scopeStyle;
73 }
73 }
74
74
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+6−6
@@ -43,7 +43,7 @@ PreviewWidget {
43 readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
43 readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
44
44
45 // Rewire the source since we may have unwired it on onStatusChanged
45 // Rewire the source since we may have unwired it on onStatusChanged
46− onMascotChanged: if (mascotShapeLoader.item) mascotShapeLoader.item.image.source = mascot;
46+ onMascotChanged: if (mascotShapeLoader.item) mascotShapeLoader.item.source.source = mascot;
47
47
48 implicitHeight: row.height + row.margins * 2
48 implicitHeight: row.height + row.margins * 2
49 width: parent.width
49 width: parent.width
@@ -77,16 +77,16 @@ PreviewWidget {
77
77
78 sourceComponent: UbuntuShape {
78 sourceComponent: UbuntuShape {
79 objectName: "mascotShape"
79 objectName: "mascotShape"
80− visible: image.status === Image.Ready
80+ visible: source.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/Previews/PreviewImageGallery.qml+1−1
@@ -62,7 +62,7 @@ PreviewWidget {
62 source: modelData ? modelData : ""
62 source: modelData ? modelData : ""
63 scaleTo: "height"
63 scaleTo: "height"
64 initialWidth: units.gu(13)
64 initialWidth: units.gu(13)
65− borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
65+ pressed: mouseArea.pressed
66
66
67 MouseArea {
67 MouseArea {
68 id: mouseArea
68 id: mouseArea
qml/Dash/Previews/PreviewZoomableImage.qml+1−1
@@ -43,7 +43,7 @@ PreviewWidget {
43 source: widgetData["source"]
43 source: widgetData["source"]
44 asynchronous: true
44 asynchronous: true
45
45
46− borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
46+ pressed: mouseArea.pressed
47
47
48 MouseArea {
48 MouseArea {
49 id: mouseArea
49 id: mouseArea
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
@@ -130,13 +130,12 @@ Item {
130 anchors.fill: parent
130 anchors.fill: parent
131 anchors.margins: units.gu(1)
131 anchors.margins: units.gu(1)
132 radius: "medium"
132 radius: "medium"
133− borderSource: "none"
133+ aspect: UbuntuShape.Flat
134−
134+ sourceFillMode: UbuntuShape.PreserveAspectCrop
135− image: Image {
135+ source: Image {
136 id: iconImage
136 id: iconImage
137 sourceSize.width: iconShape.width
137 sourceSize.width: iconShape.width
138 sourceSize.height: iconShape.height
138 sourceSize.height: iconShape.height
139− fillMode: Image.PreserveAspectCrop
140 source: root.iconName
139 source: root.iconName
141 }
140 }
142 }
141 }
@@ -159,9 +158,9 @@ Item {
159 }
158 }
160 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
159 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
161 height: units.gu(2)
160 height: units.gu(2)
162− color: UbuntuColors.orange
161+ backgroundColor: UbuntuColors.orange
163 visible: root.countVisible
162 visible: root.countVisible
164− borderSource: "none"
163+ aspect: UbuntuShape.Flat
165
164
166 Label {
165 Label {
167 id: countLabel
166 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
@@ -153,10 +153,10 @@ Item {
153 rightMargin: notification.margins
153 rightMargin: notification.margins
154 topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
154 topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
155 }
155 }
156− color: parent.color
156+ backgroundColor: parent.color
157 opacity: parent.opacity
157 opacity: parent.opacity
158 radius: "medium"
158 radius: "medium"
159− borderSource: "none"
159+ aspect: UbuntuShape.Flat
160 }
160 }
161
161
162 Rectangle {
162 Rectangle {
@@ -358,8 +358,8 @@ Item {
358 }
358 }
359
359
360 height: units.gu(1)
360 height: units.gu(1)
361− color: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
361+ backgroundColor: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
362− borderSource: "none"
362+ aspect: UbuntuShape.Flat
363 radius: "small"
363 radius: "small"
364
364
365 UbuntuShape {
365 UbuntuShape {
@@ -367,8 +367,8 @@ Item {
367 objectName: "innerBar"
367 objectName: "innerBar"
368 width: valueIndicator.width * valueIndicator.value / 100
368 width: valueIndicator.width * valueIndicator.value / 100
369 height: units.gu(1)
369 height: units.gu(1)
370− color: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
370+ backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
371− borderSource: "none"
371+ aspect: UbuntuShape.Flat
372 radius: "small"
372 radius: "small"
373 }
373 }
374 }
374 }
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
@@ -98,8 +98,8 @@ Item {
98 id: row
98 id: row
99 width: parent.width
99 width: parent.width
100 height: priv.sliderHeight
100 height: priv.sliderHeight
101− color: priv.sliderBGColor
101+ backgroundColor: priv.sliderBGColor
102− borderSource: "none"
102+ aspect: UbuntuShape.Flat
103 visible: !clickToAct
103 visible: !clickToAct
104
104
105 UbuntuShape {
105 UbuntuShape {
@@ -108,8 +108,8 @@ Item {
108 anchors.top: parent.top
108 anchors.top: parent.top
109 anchors.left: parent.left
109 anchors.left: parent.left
110 anchors.margins: priv.gap
110 anchors.margins: priv.gap
111− color: UbuntuColors.red
111+ backgroundColor: UbuntuColors.red
112− borderSource: "none"
112+ aspect: UbuntuShape.Flat
113
113
114 state: "normal"
114 state: "normal"
115 height: units.gu(6)
115 height: units.gu(6)
@@ -187,10 +187,10 @@ Item {
187 }
187 }
188
188
189 z: 1
189 z: 1
190− color: priv.sliderMainColor
190+ backgroundColor: priv.sliderMainColor
191 height: units.gu(6)
191 height: units.gu(6)
192 width: units.gu(6)
192 width: units.gu(6)
193− borderSource: "none"
193+ aspect: UbuntuShape.Flat
194 radius: "medium"
194 radius: "medium"
195 Icon {
195 Icon {
196 anchors.fill: parent
196 anchors.fill: parent
@@ -226,8 +226,8 @@ Item {
226 anchors.top: parent.top
226 anchors.top: parent.top
227 anchors.right: parent.right
227 anchors.right: parent.right
228 anchors.margins: priv.gap
228 anchors.margins: priv.gap
229− color: UbuntuColors.green
229+ backgroundColor: UbuntuColors.green
230− borderSource: "none"
230+ aspect: UbuntuShape.Flat
231
231
232 state: "normal"
232 state: "normal"
233 height: units.gu(6)
233 height: units.gu(6)
qml/Stages/Splash.qml+3−4
@@ -117,14 +117,13 @@ Item {
117 visible: d.showIcon
117 visible: d.showIcon
118
118
119 radius: "medium"
119 radius: "medium"
120− borderSource: "none"
120+ aspect: UbuntuShape.Flat
121−
121+ sourceFillMode: Image.PreserveAspectCrop
122− image: Image {
122+ source: Image {
123 id: iconImage
123 id: iconImage
124 sourceSize.width: iconShape.width
124 sourceSize.width: iconShape.width
125 sourceSize.height: iconShape.height
125 sourceSize.height: iconShape.height
126 source: d.showIcon ? root.icon : ""
126 source: d.showIcon ? root.icon : ""
127− fillMode: Image.PreserveAspectCrop
128 }
127 }
129 }
128 }
130
129
tests/plugins/Dash/cardcreator/1.res+6−7
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -14,7 +14,6 @@ AbstractButton {
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15 enabled: true;
15 enabled: true;
16
16
17−onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
17readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19Item {
18Item {
20 id: artShapeHolder;
19 id: artShapeHolder;
@@ -30,10 +29,9 @@ Item {
30 sourceComponent: Item {
29 sourceComponent: Item {
31 id: artShape;
30 id: artShape;
32 objectName: "artShape";
31 objectName: "artShape";
33− property bool doShapeItem: components["art"]["conciergeMode"] !== true;
32+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
33 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
34 readonly property alias image: artImage;
36− property alias borderSource: artShapeShape.borderSource;
37 ShaderEffectSource {
35 ShaderEffectSource {
38 id: artShapeSource;
36 id: artShapeSource;
39 sourceItem: artImage;
37 sourceItem: artImage;
@@ -42,16 +40,17 @@ Item {
42 height: 1;
40 height: 1;
43 hideSource: doShapeItem;
41 hideSource: doShapeItem;
44 }
42 }
45− Shape {
43+ UbuntuShape {
46 id: artShapeShape;
44 id: artShapeShape;
47− image: artShapeSource;
45+ source: artShapeSource;
48 anchors.fill: parent;
46 anchors.fill: parent;
49 visible: doShapeItem;
47 visible: doShapeItem;
50 radius: "medium";
48 radius: "medium";
49+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
51 }
50 }
52 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
51 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
53 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
54− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); }
55 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
54 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
56 function updateWidthHeightBindings() {
55 function updateWidthHeightBindings() {
57 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
56 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
tests/plugins/Dash/cardcreator/2.res+7−6
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
23 sourceComponent: UbuntuShape {
23 sourceComponent: UbuntuShape {
24 objectName: "background";
24 objectName: "background";
25 radius: "medium";
25 radius: "medium";
26− color: getColor(0) || "white";
26+ backgroundColor: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
28− anchors.fill: parent;
29+ anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30+ source: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
31+ property real luminance: Style.luminance(backgroundColor);
31 property Image backgroundImage: Image {
32 property Image backgroundImage: Image {
32 objectName: "backgroundImage";
33 objectName: "backgroundImage";
33 source: {
34 source: {
tests/plugins/Dash/cardcreator/3.res+6−7
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -14,7 +14,6 @@ AbstractButton {
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15 enabled: true;
15 enabled: true;
16
16
17−onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
17readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19Item {
18Item {
20 id: artShapeHolder;
19 id: artShapeHolder;
@@ -30,10 +29,9 @@ Item {
30 sourceComponent: Item {
29 sourceComponent: Item {
31 id: artShape;
30 id: artShape;
32 objectName: "artShape";
31 objectName: "artShape";
33− property bool doShapeItem: components["art"]["conciergeMode"] !== true;
32+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
33 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
34 readonly property alias image: artImage;
36− property alias borderSource: artShapeShape.borderSource;
37 ShaderEffectSource {
35 ShaderEffectSource {
38 id: artShapeSource;
36 id: artShapeSource;
39 sourceItem: artImage;
37 sourceItem: artImage;
@@ -42,16 +40,17 @@ Item {
42 height: 1;
40 height: 1;
43 hideSource: doShapeItem;
41 hideSource: doShapeItem;
44 }
42 }
45− Shape {
43+ UbuntuShape {
46 id: artShapeShape;
44 id: artShapeShape;
47− image: artShapeSource;
45+ source: artShapeSource;
48 anchors.fill: parent;
46 anchors.fill: parent;
49 visible: doShapeItem;
47 visible: doShapeItem;
50 radius: "medium";
48 radius: "medium";
49+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
51 }
50 }
52 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
51 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
53 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
54− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); }
55 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
54 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
56 function updateWidthHeightBindings() {
55 function updateWidthHeightBindings() {
57 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
56 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
tests/plugins/Dash/cardcreator/4.res+1−1
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/5.res+16−43
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -14,7 +14,6 @@ AbstractButton {
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15 enabled: false;
15 enabled: false;
16
16
17−onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
17readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19Item {
18Item {
20 id: artShapeHolder;
19 id: artShapeHolder;
@@ -30,10 +29,9 @@ Item {
30 sourceComponent: Item {
29 sourceComponent: Item {
31 id: artShape;
30 id: artShape;
32 objectName: "artShape";
31 objectName: "artShape";
33− property bool doShapeItem: components["art"]["conciergeMode"] !== true;
32+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
33 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
34 readonly property alias image: artImage;
36− property alias borderSource: artShapeShape.borderSource;
37 ShaderEffectSource {
35 ShaderEffectSource {
38 id: artShapeSource;
36 id: artShapeSource;
39 sourceItem: artImage;
37 sourceItem: artImage;
@@ -42,16 +40,17 @@ Item {
42 height: 1;
40 height: 1;
43 hideSource: doShapeItem;
41 hideSource: doShapeItem;
44 }
42 }
45− Shape {
43+ UbuntuShape {
46 id: artShapeShape;
44 id: artShapeShape;
47− image: artShapeSource;
45+ source: artShapeSource;
48 anchors.fill: parent;
46 anchors.fill: parent;
49 visible: doShapeItem;
47 visible: doShapeItem;
50 radius: "medium";
48 radius: "medium";
49+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
51 }
50 }
52 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
51 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
53 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
54− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); }
55 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
54 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
56 function updateWidthHeightBindings() {
55 function updateWidthHeightBindings() {
57 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
56 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
@@ -75,44 +74,18 @@ Item {
75 }
74 }
76Loader {
75Loader {
77 id: overlayLoader;
76 id: overlayLoader;
78− anchors {
77+ readonly property real overlayHeight: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2);
79− left: artShapeHolder.left;
80− right: artShapeHolder.right;
78+ anchors.fill: artShapeHolder;
81− bottom: artShapeHolder.bottom;
82− }
83− active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
79+ active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
84 asynchronous: root.asynchronous;
80 asynchronous: root.asynchronous;
85 visible: showHeader && status == Loader.Ready;
81 visible: showHeader && status == Loader.Ready;
86− sourceComponent: ShaderEffect {
82+ sourceComponent: UbuntuShapeOverlay {
87 id: overlay;
83 id: overlay;
88− height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2);
89− property real luminance: Style.luminance(overlayColor);
84+ property real luminance: Style.luminance(overlayColor);
85+ aspect: UbuntuShape.Flat;
86+ radius: "medium";
90− property color overlayColor: cardData && cardData["overlayColor"] || "#99000000";
87+ overlayColor: cardData && cardData["overlayColor"] || "#99000000";
91− property var source: ShaderEffectSource {
88+ overlayRect: Qt.rect(0, 1 - overlayLoader.overlayHeight / height, 1, 1);
92− id: shaderSource;
93− sourceItem: artShapeLoader.item;
94− onVisibleChanged: if (visible) scheduleUpdate();
95− live: false;
96− sourceRect: Qt.rect(0, artShapeLoader.height - overlay.height, artShapeLoader.width, overlay.height);
97− }
98− vertexShader: "
99− uniform highp mat4 qt_Matrix;
100− attribute highp vec4 qt_Vertex;
101− attribute highp vec2 qt_MultiTexCoord0;
102− varying highp vec2 coord;
103− void main() {
104− coord = qt_MultiTexCoord0;
105− gl_Position = qt_Matrix * qt_Vertex;
106− }";
107− fragmentShader: "
108− varying highp vec2 coord;
109− uniform sampler2D source;
110− uniform lowp float qt_Opacity;
111− uniform highp vec4 overlayColor;
112− void main() {
113− lowp vec4 tex = texture2D(source, coord);
114− gl_FragColor = vec4(overlayColor.r, overlayColor.g, overlayColor.b, 1) * qt_Opacity * overlayColor.a * tex.a;
115− }";
116 }
89 }
117 }
90 }
118readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
91readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
@@ -124,7 +97,7 @@ Label {
124 left: parent.left;
97 left: parent.left;
125 leftMargin: units.gu(1);
98 leftMargin: units.gu(1);
126 top: overlayLoader.top;
99 top: overlayLoader.top;
127− topMargin: units.gu(1);
100+ topMargin: units.gu(1) + overlayLoader.height - overlayLoader.overlayHeight;
128 }
101 }
129 elide: Text.ElideRight;
102 elide: Text.ElideRight;
130 fontSize: "small";
103 fontSize: "small";
tests/plugins/Dash/cardcreator/6.res+7−6
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
23 sourceComponent: UbuntuShape {
23 sourceComponent: UbuntuShape {
24 objectName: "background";
24 objectName: "background";
25 radius: "medium";
25 radius: "medium";
26− color: getColor(0) || "white";
26+ backgroundColor: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
28− anchors.fill: parent;
29+ anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30+ source: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
31+ property real luminance: Style.luminance(backgroundColor);
31 property Image backgroundImage: Image {
32 property Image backgroundImage: Image {
32 objectName: "backgroundImage";
33 objectName: "backgroundImage";
33 source: {
34 source: {
tests/plugins/Dash/cardcreator/7.res+7−6
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
23 sourceComponent: UbuntuShape {
23 sourceComponent: UbuntuShape {
24 objectName: "background";
24 objectName: "background";
25 radius: "medium";
25 radius: "medium";
26− color: getColor(0) || "white";
26+ backgroundColor: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
28− anchors.fill: parent;
29+ anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30+ source: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
31+ property real luminance: Style.luminance(backgroundColor);
31 property Image backgroundImage: Image {
32 property Image backgroundImage: Image {
32 objectName: "backgroundImage";
33 objectName: "backgroundImage";
33 source: {
34 source: {
tests/plugins/Dash/cardcreator/8.res+6−5
@@ -2,7 +2,7 @@ AbstractButton {
2 id: root;
2 id: root;
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
23 sourceComponent: UbuntuShape {
23 sourceComponent: UbuntuShape {
24 objectName: "background";
24 objectName: "background";
25 radius: "medium";
25 radius: "medium";
26− color: getColor(0) || "white";
26+ backgroundColor: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
28 anchors.fill: parent;
29 anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30+ source: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
31+ property real luminance: Style.luminance(backgroundColor);
31 property Image backgroundImage: Image {
32 property Image backgroundImage: Image {
32 objectName: "backgroundImage";
33 objectName: "backgroundImage";
33 source: {
34 source: {
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+1−1
@@ -149,7 +149,7 @@ Rectangle {
149 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
149 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
150 var mascot = findChild(previewHeader, "mascotShape");
150 var mascot = findChild(previewHeader, "mascotShape");
151 tryCompare(mascot, "visible", true);
151 tryCompare(mascot, "visible", true);
152− tryCompare(mascot.image, "status", Image.Ready);
152+ tryCompare(mascot.source, "status", Image.Ready);
153 }
153 }
154 }
154 }
155}
155}
tests/qmltests/Dash/tst_Card.qml+3−3
@@ -443,11 +443,11 @@ Rectangle {
443 }
443 }
444
444
445 if (data.hasOwnProperty("color")) {
445 if (data.hasOwnProperty("color")) {
446− tryCompare(background, "color", data.color);
446+ tryCompare(background, "backgroundColor", data.color);
447 }
447 }
448
448
449 if (data.hasOwnProperty("gradientColor")) {
449 if (data.hasOwnProperty("gradientColor")) {
450− tryCompare(background, "gradientColor", data.gradientColor);
450+ tryCompare(background, "secondaryBackgroundColor", data.gradientColor);
451 }
451 }
452
452
453 if (data.hasOwnProperty("image")) {
453 if (data.hasOwnProperty("image")) {
@@ -520,7 +520,7 @@ Rectangle {
520 waitForRendering(selector);
520 waitForRendering(selector);
521 waitForRendering(card);
521 waitForRendering(card);
522
522
523− background.color = data.tag;
523+ background.backgroundColor = data.tag;
524
524
525 var fontColor = data.dark ? theme.palette.normal.baseText : "white";
525 var fontColor = data.dark ? theme.palette.normal.baseText : "white";
526
526