on xenial help sign in
add a shadow, use a standard ProgressBar for the value indicator
commit5461b3ea4806615595b2a00b53e7e6c15e7d321d authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 5 Apr 2016, 23:34 (11 years ago) parent26cc550
2 files changed+19−28
qml/Notifications/Notification.qml+15−22 qml/Notifications/SwipeToAct.qml+4−6
qml/Notifications/Notification.qml+15−22
@@ -36,7 +36,7 @@ StyledItem {
3636 property var type
3737 property var hints
3838 property var notification
39− property color color: UbuntuColors.silk // TODO theme.palette.normal.overlay
39+ property color color: theme.palette.normal.overlay
4040 property bool fullscreen: false
4141 property int maxHeight
4242 property int margins: units.gu(1)
@@ -129,10 +129,18 @@ StyledItem {
129129 }
130130 ]
131131
132− clip: fullscreen ? false : true
133−
134132 visible: type !== Notification.PlaceHolder
135133
134+ BorderImage {
135+ anchors {
136+ fill: contents
137+ margins: shapedBack.visible ? -units.gu(1) : -units.gu(1.5)
138+ }
139+ source: "../Stages/graphics/dropshadow2gu.sci"
140+ opacity: notification.opacity * 0.5
141+ enabled: !fullscreen
142+ }
143+
136144 UbuntuShape {
137145 id: shapedBack
138146
@@ -141,7 +149,6 @@ StyledItem {
141149 fill: parent
142150 }
143151 backgroundColor: parent.color
144− opacity: parent.opacity
145152 radius: "medium"
146153 aspect: UbuntuShape.Flat
147154 }
@@ -152,7 +159,6 @@ StyledItem {
152159 visible: fullscreen
153160 anchors.fill: parent
154161 color: parent.color
155− opacity: parent.opacity
156162 }
157163
158164 onXChanged: {
@@ -333,31 +339,18 @@ StyledItem {
333339 textFormat: Text.PlainText
334340 }
335341
336− UbuntuShape {
342+ ProgressBar {
337343 id: valueIndicator
338344 objectName: "valueIndicator"
339345 visible: type === Notification.Confirmation
340− property double value
341−
346+ showProgressPercentage: false
347+ minimumValue: 0
348+ maximumValue: 100
342349 anchors {
343350 left: parent.left
344351 right: parent.right
345352 }
346−
347353 height: units.gu(1)
348− backgroundColor: theme.palette.normal.background
349− aspect: UbuntuShape.Flat
350− radius: "small"
351−
352− UbuntuShape {
353− id: innerBar
354− objectName: "innerBar"
355− width: valueIndicator.width * valueIndicator.value / 100
356− height: units.gu(1)
357− backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? theme.palette.highlighted.activity : theme.palette.normal.activity
358− aspect: UbuntuShape.Flat
359− radius: "small"
360− }
361354 }
362355
363356 Column {
qml/Notifications/SwipeToAct.qml+4−6
@@ -20,7 +20,7 @@ import Ubuntu.Components 1.3
2020Item {
2121 id: swipeToAct
2222
23− height: clickToAct ? leftButton.height : childrenRect.height
23+ height: clickToAct ? leftButton.height : row.height
2424
2525 signal leftTriggered()
2626 signal rightTriggered()
@@ -35,7 +35,7 @@ Item {
3535
3636 property double opacityDelta
3737 readonly property double sliderHeight: units.gu(8)
38− readonly property double gap: units.gu(0.5)
38+ readonly property double gap: units.gu(1)
3939 readonly property color sliderMainColor: theme.palette.normal.base
4040 readonly property color sliderBGColor: theme.palette.normal.foreground
4141 readonly property double halfWay: mouseArea.drag.maximumX / 2
@@ -73,7 +73,7 @@ Item {
7373 anchors.left: parent.left
7474 iconName: leftIconName
7575 visible: clickToAct
76− width: (parent.width / 2) - priv.gap
76+ width: (parent.width / 2) - priv.gap / 2
7777 color: theme.palette.normal.negative
7878 onClicked: {
7979 leftTriggered()
@@ -87,7 +87,7 @@ Item {
8787 anchors.right: parent.right
8888 iconName: rightIconName
8989 visible: clickToAct
90− width: (parent.width / 2) - priv.gap
90+ width: (parent.width / 2) - priv.gap / 2
9191 color: theme.palette.normal.positive
9292 onClicked: {
9393 rightTriggered()
@@ -111,7 +111,6 @@ Item {
111111 backgroundColor: theme.palette.normal.negative
112112 aspect: UbuntuShape.Flat
113113
114− state: "normal"
115114 height: units.gu(6)
116115 width: units.gu(6)
117116 radius: "medium"
@@ -229,7 +228,6 @@ Item {
229228 backgroundColor: theme.palette.normal.positive
230229 aspect: UbuntuShape.Flat
231230
232− state: "normal"
233231 height: units.gu(6)
234232 width: units.gu(6)
235233 radius: "medium"