on xenial help sign in
Changed UbuntuShape APIs for files in qml/ dir
commit2bd22f506612de054289438d10ba1db74f3e5876 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateWed 15 Jul 2015, 17:58 (11 years ago) parent4f6f48c
10 files changed+38−41
qml/Components/LazyImage.qml+5−6 qml/Dash/Previews/PreviewAudioPlayback.qml+1−1 qml/Dash/Previews/PreviewHeader.qml+4−4 qml/Dash/ScopesListCategoryItem.qml+2−2 qml/Launcher/LauncherDelegate.qml+5−6 qml/Launcher/LauncherPanel.qml+2−2 qml/Notifications/Notification.qml+6−6 qml/Notifications/OptionToggle.qml+2−2 qml/Notifications/SwipeToAct.qml+8−8 qml/Stages/Splash.qml+3−4
qml/Components/LazyImage.qml+5−6
@@ -53,7 +53,7 @@ Item {
5353 UbuntuShape {
5454 id: placeholder
5555 objectName: "placeholder"
56− color: "#22FFFFFF"
56+ backgroundColor: "#22FFFFFF"
5757 anchors.fill: shape
5858 visible: opacity != 0
5959
@@ -87,19 +87,18 @@ Item {
8787
8888 opacity: 0
8989 visible: opacity != 0
90−
91− image: Image {
90+ sourceFillMode: UbuntuShape.PreserveAspectFit
91+ sourceHorizontalAlignment: UbuntuShape.AlignHCenter
92+ sourceVerticalAlignment: UbuntuShape.AlignVCenter
93+ source: Image {
9294 id: image
9395 objectName: "image"
9496
9597 property url nextSource
9698 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
9799
98− fillMode: Image.PreserveAspectFit
99100 asynchronous: true
100101 cache: false
101− horizontalAlignment: Image.AlignHCenter
102− verticalAlignment: Image.AlignVCenter
103102 sourceSize.width: root.scaleTo == "width" ? root.width
104103 : root.scaleTo == "fit" && root.width <= root.height ? root.width
105104 : 0
qml/Dash/Previews/PreviewAudioPlayback.qml+1−1
@@ -175,7 +175,7 @@ PreviewWidget {
175175 }
176176 height: units.dp(2)
177177 visible: progressBarImage.visible
178− color: UbuntuColors.orange
178+ backgroundColor: UbuntuColors.orange
179179 }
180180
181181 Image {
qml/Dash/Previews/PreviewHeader.qml+4−4
@@ -78,15 +78,15 @@ PreviewWidget {
7878 sourceComponent: UbuntuShape {
7979 objectName: "mascotShape"
8080 visible: image.status === Image.Ready
81− image: Image {
81+ sourceFillMode: UbuntuShape.PreserveAspectCrop
82+ sourceHorizontalAlignment: UbuntuShape.AlignHCenter
83+ sourceVerticalAlignment: UbuntuShape.AlignVCenter
84+ source: Image {
8285 source: headerRoot.mascot
8386 width: source ? mascotShapeLoader.width : 0
8487 height: mascotShapeLoader.height
8588
8689 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
87− fillMode: Image.PreserveAspectCrop
88− horizontalAlignment: Image.AlignHCenter
89− verticalAlignment: Image.AlignVCenter
9090 onStatusChanged: if (status === Image.Error) source = headerRoot.fallback;
9191 }
9292 }
qml/Dash/ScopesListCategoryItem.qml+2−2
@@ -49,10 +49,10 @@ MouseArea {
4949 width: units.gu(5)
5050 height: units.gu(5)
5151 visible: !hideChildren
52− image: Image {
52+ sourceFillMode: UbuntuShape.PreserveAspectCrop
53+ source: Image {
5354 id: shapeImage
5455 cache: true
55− fillMode: Image.PreserveAspectCrop
5656 sourceSize { width: shape.width; height: shape.height }
5757 }
5858 }
qml/Launcher/LauncherDelegate.qml+5−6
@@ -51,13 +51,12 @@ Item {
5151 anchors.fill: parent
5252 anchors.margins: units.gu(1)
5353 radius: "medium"
54− borderSource: "none"
55−
56− image: Image {
54+ aspect: UbuntuShape.Flat
55+ sourceFillMode: UbuntuShape.PreserveAspectCrop
56+ source: Image {
5757 id: iconImage
5858 sourceSize.width: iconShape.width
5959 sourceSize.height: iconShape.height
60− fillMode: Image.PreserveAspectCrop
6160 source: root.iconName
6261 }
6362 }
@@ -80,9 +79,9 @@ Item {
8079 }
8180 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
8281 height: units.gu(2)
83− color: UbuntuColors.orange
82+ backgroundColor: UbuntuColors.orange
8483 visible: root.countVisible
85− borderSource: "none"
84+ aspect: UbuntuShape.Flat
8685
8786 Label {
8887 id: countLabel
qml/Launcher/LauncherPanel.qml+2−2
@@ -61,8 +61,8 @@ Rectangle {
6161 fill: parent
6262 topMargin: -units.gu(2)
6363 }
64− borderSource: "none"
65− color: UbuntuColors.orange
64+ aspect: UbuntuShape.Flat
65+ backgroundColor: UbuntuColors.orange
6666 }
6767
6868 Image {
qml/Notifications/Notification.qml+6−6
@@ -142,10 +142,10 @@ Item {
142142 rightMargin: notification.margins
143143 topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
144144 }
145− color: parent.color
145+ backgroundColor: parent.color
146146 opacity: parent.opacity
147147 radius: "medium"
148− borderSource: "none"
148+ aspect: UbuntuShape.Flat
149149 }
150150
151151 Rectangle {
@@ -345,8 +345,8 @@ Item {
345345 }
346346
347347 height: units.gu(1)
348− color: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
349− borderSource: "none"
348+ backgroundColor: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
349+ aspect: UbuntuShape.Flat
350350 radius: "small"
351351
352352 UbuntuShape {
@@ -354,8 +354,8 @@ Item {
354354 objectName: "innerBar"
355355 width: valueIndicator.width * valueIndicator.value / 100
356356 height: units.gu(1)
357− color: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
358− borderSource: "none"
357+ backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
358+ aspect: UbuntuShape.Flat
359359 radius: "small"
360360 }
361361 }
qml/Notifications/OptionToggle.qml+2−2
@@ -29,8 +29,8 @@ UbuntuShape {
2929
3030 signal triggered(string id)
3131
32− color: theme.palette.normal.base
33− borderSource: "none"
32+ backgroundColor: theme.palette.normal.base
33+ aspect: UbuntuShape.Flat
3434 height: expanded ? (optionToggleRepeater.count - startIndex) * itemHeight : itemHeight
3535 width: parent.width
3636 radius: "medium"
qml/Notifications/SwipeToAct.qml+8−8
@@ -68,16 +68,16 @@ Item {
6868 id: row
6969 width: parent.width
7070 height: priv.sliderHeight
71− color: priv.sliderBGColor
72− borderSource: "none"
71+ backgroundColor: priv.sliderBGColor
72+ aspect: UbuntuShape.Flat
7373
7474 UbuntuShape {
7575 id: leftShape
7676 anchors.top: parent.top
7777 anchors.left: parent.left
7878 anchors.margins: priv.gap
79− color: UbuntuColors.red
80− borderSource: "none"
79+ backgroundColor: UbuntuColors.red
80+ aspect: UbuntuShape.Flat
8181
8282 state: "normal"
8383 height: units.gu(6)
@@ -155,10 +155,10 @@ Item {
155155 }
156156
157157 z: 1
158− color: priv.sliderMainColor
158+ backgroundColor: priv.sliderMainColor
159159 height: units.gu(6)
160160 width: units.gu(6)
161− borderSource: "none"
161+ aspect: UbuntuShape.Flat
162162 radius: "medium"
163163 Icon {
164164 anchors.fill: parent
@@ -192,8 +192,8 @@ Item {
192192 anchors.top: parent.top
193193 anchors.right: parent.right
194194 anchors.margins: priv.gap
195− color: UbuntuColors.green
196− borderSource: "none"
195+ backgroundColor: UbuntuColors.green
196+ aspect: UbuntuShape.Flat
197197
198198 state: "normal"
199199 height: units.gu(6)
qml/Stages/Splash.qml+3−4
@@ -121,14 +121,13 @@ Item {
121121 visible: d.showIcon
122122
123123 radius: "medium"
124− borderSource: "none"
125−
126− image: Image {
124+ aspect: UbuntuShape.Flat
125+ sourceFillMode: Image.PreserveAspectCrop
126+ source: Image {
127127 id: iconImage
128128 sourceSize.width: iconShape.width
129129 sourceSize.height: iconShape.height
130130 source: d.showIcon ? root.icon : ""
131− fillMode: Image.PreserveAspectCrop
132131 }
133132 }
134133