@@ -15,11 +15,13 @@
17import QtQuick 2.0
17import QtQuick 2.0
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.1
19import Unity.Notifications 1.0
19import Unity.Notifications 1.0
20import QMenuModel 0.1
20import QMenuModel 0.1
21import Utils 0.1
21import Utils 0.1
23+import Ubuntu.Components.ListItems 0.1 as ListItem
24 id: notification
26 id: notification
@@ -36,6 +38,14 @@ Item {
36 property bool fullscreen
38 property bool fullscreen
37 property int maxHeight
39 property int maxHeight
38 property int margins
40 property int margins
41+ property Gradient greenGradient : Gradient {
42+ GradientStop { position: 0.0; color: "#39b44a" }
43+ GradientStop { position: 1.0; color: "#50be61" }
45+ property Gradient darkgreyGradient: Gradient {
46+ GradientStop { position: 0.0; color: "#534e4b" }
47+ GradientStop { position: 1.0; color: "#5d5856" }
40 fullscreen: false
50 fullscreen: false
41 objectName: "background"
51 objectName: "background"
@@ -278,7 +288,7 @@ Item {
282 id: buttonRow
292 id: buttonRow
284 objectName: "buttonRow"
294 objectName: "buttonRow"
@@ -287,70 +297,8 @@ Item {
287 right: parent.right
297 right: parent.right
289 visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
299 visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
290− height: units.gu(5)
300+ spacing: units.gu(1)
291−
301+ layoutDirection: Qt.RightToLeft
292− property real buttonWidth: (width - contentColumn.spacing) / 2
293− property bool expanded
298− objectName: "button1"
299− width: parent.expanded ? parent.width : parent.buttonWidth
302− bottom: parent.bottom
304− text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
305− gradient: UbuntuColors.greyGradient
307− if (actionRepeater.count > 2) {
308− buttonRow.expanded = !buttonRow.expanded
310− notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
315− UbuntuNumberAnimation {
316− duration: UbuntuAnimation.SnapDuration
324− objectName: "button0"
326− left: leftButton.right
327− leftMargin: contentColumn.spacing
330− text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
333− bottom: parent.bottom
335− gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
337− onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
342− objectName: "buttonColumn"
343− spacing: contentColumn.spacing
349− // calculate initial position before Column takes over
350− y: buttonRow.y + buttonRow.height + contentColumn.spacing
352− visible: notification.type == Notification.SnapDecision && buttonRow.expanded
353− height: buttonRow.expanded ? implicitHeight : 0
355 Repeater {
303 Repeater {
356 id: actionRepeater
304 id: actionRepeater
@@ -362,28 +310,85 @@ Item {
362 property string actionId: id
310 property string actionId: id
363 property string actionLabel: label
311 property string actionLabel: label
370 Component {
313 Component {
371 id: actionButton
314 id: actionButton
374 objectName: "button" + index
317 objectName: "button" + index
375− anchors {
318+ width: buttonRow.width / 2 - spacing
380 text: loader.actionLabel
319 text: loader.actionLabel
381− height: units.gu(5)
320+ gradient: notification.hints["x-canonical-private-button-tint"] == "true" && index == 0 ? greenGradient : darkgreyGradient
382− gradient: UbuntuColors.greyGradient
383 onClicked: notification.notification.invokeAction(loader.actionId)
321 onClicked: notification.notification.invokeAction(loader.actionId)
386− sourceComponent: (index == 0 || index == 1) ? undefined : actionButton
324+ sourceComponent: (index == 0 || index == 1) ? actionButton : undefined
332+ visible: notification.type == Notification.SnapDecision && actionRepeater.count > 2
333+ gradient: darkgreyGradient
334+ onClicked: print ("Clicked on " + text)
336+ expandedHeight: (actionRepeater.count - 2) * units.gu(4) + units.gu(4.5)
337+ comboList: ListView {
343+ model: notification.actions
349+ ListItem.ThinDivider {
356+ width: delegateRow.width
357+ height: delegateRow.height
360+ print ("Clicked on: " + label)
368+ color: Qt.rgba(0.0, 0.0, 0.0, 0.0)
369+ width: myDelegate.height
373+ anchors.fill: parent
374+ anchors.margins: units.gu(1)
383+ //height: frame.height
385+ verticalAlignment: Text.AlignVCenter