on xenial help sign in
add a shadow, use a standard ProgressBar for the value indicator
5461b3eLukáš Tinkl
qml/Notifications/Notification.qml+15−22
@@ -36,7 +36,7 @@ StyledItem {
36 property var type
36 property var type
37 property var hints
37 property var hints
38 property var notification
38 property var notification
39− property color color: UbuntuColors.silk // TODO theme.palette.normal.overlay
39+ property color color: theme.palette.normal.overlay
40 property bool fullscreen: false
40 property bool fullscreen: false
41 property int maxHeight
41 property int maxHeight
42 property int margins: units.gu(1)
42 property int margins: units.gu(1)
@@ -129,10 +129,18 @@ StyledItem {
129 }
129 }
130 ]
130 ]
131
131
132− clip: fullscreen ? false : true
133−
134 visible: type !== Notification.PlaceHolder
132 visible: type !== Notification.PlaceHolder
135
133
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+
136 UbuntuShape {
144 UbuntuShape {
137 id: shapedBack
145 id: shapedBack
138
146
@@ -141,7 +149,6 @@ StyledItem {
141 fill: parent
149 fill: parent
142 }
150 }
143 backgroundColor: parent.color
151 backgroundColor: parent.color
144− opacity: parent.opacity
145 radius: "medium"
152 radius: "medium"
146 aspect: UbuntuShape.Flat
153 aspect: UbuntuShape.Flat
147 }
154 }
@@ -152,7 +159,6 @@ StyledItem {
152 visible: fullscreen
159 visible: fullscreen
153 anchors.fill: parent
160 anchors.fill: parent
154 color: parent.color
161 color: parent.color
155− opacity: parent.opacity
156 }
162 }
157
163
158 onXChanged: {
164 onXChanged: {
@@ -333,31 +339,18 @@ StyledItem {
333 textFormat: Text.PlainText
339 textFormat: Text.PlainText
334 }
340 }
335
341
336− UbuntuShape {
342+ ProgressBar {
337 id: valueIndicator
343 id: valueIndicator
338 objectName: "valueIndicator"
344 objectName: "valueIndicator"
339 visible: type === Notification.Confirmation
345 visible: type === Notification.Confirmation
340− property double value
346+ showProgressPercentage: false
341−
347+ minimumValue: 0
348+ maximumValue: 100
342 anchors {
349 anchors {
343 left: parent.left
350 left: parent.left
344 right: parent.right
351 right: parent.right
345 }
352 }
346−
347 height: units.gu(1)
353 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− }
361 }
354 }
362
355
363 Column {
356 Column {
qml/Notifications/SwipeToAct.qml+4−6
@@ -20,7 +20,7 @@ import Ubuntu.Components 1.3
20Item {
20Item {
21 id: swipeToAct
21 id: swipeToAct
22
22
23− height: clickToAct ? leftButton.height : childrenRect.height
23+ height: clickToAct ? leftButton.height : row.height
24
24
25 signal leftTriggered()
25 signal leftTriggered()
26 signal rightTriggered()
26 signal rightTriggered()
@@ -35,7 +35,7 @@ Item {
35
35
36 property double opacityDelta
36 property double opacityDelta
37 readonly property double sliderHeight: units.gu(8)
37 readonly property double sliderHeight: units.gu(8)
38− readonly property double gap: units.gu(0.5)
38+ readonly property double gap: units.gu(1)
39 readonly property color sliderMainColor: theme.palette.normal.base
39 readonly property color sliderMainColor: theme.palette.normal.base
40 readonly property color sliderBGColor: theme.palette.normal.foreground
40 readonly property color sliderBGColor: theme.palette.normal.foreground
41 readonly property double halfWay: mouseArea.drag.maximumX / 2
41 readonly property double halfWay: mouseArea.drag.maximumX / 2
@@ -73,7 +73,7 @@ Item {
73 anchors.left: parent.left
73 anchors.left: parent.left
74 iconName: leftIconName
74 iconName: leftIconName
75 visible: clickToAct
75 visible: clickToAct
76− width: (parent.width / 2) - priv.gap
76+ width: (parent.width / 2) - priv.gap / 2
77 color: theme.palette.normal.negative
77 color: theme.palette.normal.negative
78 onClicked: {
78 onClicked: {
79 leftTriggered()
79 leftTriggered()
@@ -87,7 +87,7 @@ Item {
87 anchors.right: parent.right
87 anchors.right: parent.right
88 iconName: rightIconName
88 iconName: rightIconName
89 visible: clickToAct
89 visible: clickToAct
90− width: (parent.width / 2) - priv.gap
90+ width: (parent.width / 2) - priv.gap / 2
91 color: theme.palette.normal.positive
91 color: theme.palette.normal.positive
92 onClicked: {
92 onClicked: {
93 rightTriggered()
93 rightTriggered()
@@ -111,7 +111,6 @@ Item {
111 backgroundColor: theme.palette.normal.negative
111 backgroundColor: theme.palette.normal.negative
112 aspect: UbuntuShape.Flat
112 aspect: UbuntuShape.Flat
113
113
114− state: "normal"
115 height: units.gu(6)
114 height: units.gu(6)
116 width: units.gu(6)
115 width: units.gu(6)
117 radius: "medium"
116 radius: "medium"
@@ -229,7 +228,6 @@ Item {
229 backgroundColor: theme.palette.normal.positive
228 backgroundColor: theme.palette.normal.positive
230 aspect: UbuntuShape.Flat
229 aspect: UbuntuShape.Flat
231
230
232− state: "normal"
233 height: units.gu(6)
231 height: units.gu(6)
234 width: units.gu(6)
232 width: units.gu(6)
235 radius: "medium"
233 radius: "medium"