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
110 visible: iconSource !== undefined && iconSource != ""
114 fillMode: Image.PreserveAspectCrop
121 objectName: "secondaryIcon"
124 visible: source !== undefined && source != ""
125 fillMode: Image.PreserveAspectCrop
130 width: parent.width - x
132 anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
137 objectName: "summaryLabel"
144 color: Theme.palette.selected.backgroundText
145 elide: Text.ElideRight
151 objectName: "bodyLabel"
158 color: Theme.palette.selected.backgroundText
160 wrapMode: Text.WordWrap
162 elide: Text.ElideRight
168 objectName: "dialogListView"
173 anchors.left: parent.left; anchors.right: parent.right
176 model: unityMenuModel
178 NotificationMenuItemFactory {
179 anchors.left: parent.left; anchors.right: parent.right
181 menuModel: unityMenuModel
191 objectName: "buttonRow"
196 visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
199 property real buttonWidth: (width - contentColumn.spacing) / 2
200 property bool expanded
205 objectName: "button1"
206 width: parent.expanded ? parent.width : parent.buttonWidth
209 bottom: parent.bottom
211 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
212 gradient: UbuntuColors.greyGradient
214 if (actionRepeater.count > 2) {
215 buttonRow.expanded = !buttonRow.expanded
217 notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
222 UbuntuNumberAnimation {
223 duration: UbuntuAnimation.SnapDuration
231 objectName: "button0"
233 left: leftButton.right
234 leftMargin: contentColumn.spacing
237 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
240 bottom: parent.bottom
242 gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
244 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
249 objectName: "buttonColumn"
250 spacing: contentColumn.spacing
256 // calculate initial position before Column takes over
257 y: buttonRow.y + buttonRow.height + contentColumn.spacing
259 visible: notification.type == Notification.SnapDecision
260 height: buttonRow.expanded ? implicitHeight : 0
265 model: notification.actions
269 property string actionId: id
270 property string actionLabel: label
281 objectName: "button" + index
287 text: loader.actionLabel
289 gradient: UbuntuColors.greyGradient
290 onClicked: notification.notification.invokeAction(loader.actionId)
293 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