2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import Ubuntu.Components 0.1
19import Unity.Notifications 1.0
26 property alias iconSource: avatarIcon.source
27 property alias secondaryIconSource: secondaryIcon.source
28 property alias summary: summaryLabel.text
29 property alias body: bodyLabel.text
31 property var notificationId
34 property var notification
36 objectName: "background"
37 implicitHeight: contentColumn.height + contentColumn.spacing * 2
38 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
47 source: hints["x-canonical-private-menu-model"]
49 busNameHint: "busName"
50 actionsHint: "actions"
51 menuObjectPathHint: "menuPath"
57 busName: paths.busName
58 actions: paths.actions
59 menuObjectPath: paths.menuObjectPath
62 Behavior on implicitHeight {
66 UbuntuNumberAnimation {
67 duration: UbuntuAnimation.SnapDuration
71 // delay enabling height behavior until the add transition is complete
72 onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
77 anchors.fill: contentColumn
78 objectName: "interactiveArea"
79 enabled: notification.type == Notification.Interactive
80 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
98 spacing: contentColumn.spacing
107 fillMode: Image.PreserveAspectCrop
108 objectName: "noShapeIcon"
112 visible: iconSource !== undefined && iconSource !== "" && notification.hints["x-canonical-noshape-icon"] == "true"
121 visible: iconSource !== undefined && iconSource !== "" && notification.hints["x-canonical-noshape-icon"] !== "true"
125 fillMode: Image.PreserveAspectCrop
132 objectName: "secondaryIcon"
135 visible: source !== undefined && source != ""
136 fillMode: Image.PreserveAspectCrop
141 width: parent.width - x
143 anchors.verticalCenter: ((icon.visible || noShapeIcon.visible) && !bodyLabel.visible) ? (icon.visible ? icon.verticalCenter : noShapeIcon.verticalCenter) : undefined
148 objectName: "summaryLabel"
155 color: Theme.palette.selected.backgroundText
156 elide: Text.ElideRight
162 objectName: "bodyLabel"
169 color: Theme.palette.selected.backgroundText
171 wrapMode: Text.WordWrap
173 elide: Text.ElideRight
179 objectName: "dialogListView"
184 anchors.left: parent.left; anchors.right: parent.right
187 model: unityMenuModel
189 NotificationMenuItemFactory {
190 anchors.left: parent.left; anchors.right: parent.right
192 menuModel: unityMenuModel
202 objectName: "buttonRow"
207 visible: notification.type == Notification.SnapDecision
210 property real buttonWidth: (width - contentColumn.spacing) / 2
211 property bool expanded
216 objectName: "button1"
217 width: parent.expanded ? parent.width : parent.buttonWidth
220 bottom: parent.bottom
222 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
223 gradient: UbuntuColors.greyGradient
225 if (actionRepeater.count > 2) {
226 buttonRow.expanded = !buttonRow.expanded
228 notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
233 UbuntuNumberAnimation {
234 duration: UbuntuAnimation.SnapDuration
242 objectName: "button0"
244 left: leftButton.right
245 leftMargin: contentColumn.spacing
248 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
251 bottom: parent.bottom
253 gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
255 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
260 objectName: "buttonColumn"
261 spacing: contentColumn.spacing
267 // calculate initial position before Column takes over
268 y: buttonRow.y + buttonRow.height + contentColumn.spacing
270 visible: notification.type == Notification.SnapDecision
271 height: buttonRow.expanded ? implicitHeight : 0
276 model: notification.actions
280 property string actionId: id
281 property string actionLabel: label
292 objectName: "button" + index
298 text: loader.actionLabel
300 gradient: UbuntuColors.greyGradient
301 onClicked: notification.notification.invokeAction(loader.actionId)
304 sourceComponent: (index == 0 || index == 1) ? undefined : actionButton
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list