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: type != Notification.PlaceHolder ? contentColumn.height + contentColumn.spacing * 2 : 0
38 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
43 visible: type != Notification.PlaceHolder
48 source: hints["x-canonical-private-menu-model"]
50 busNameHint: "busName"
51 actionsHint: "actions"
52 menuObjectPathHint: "menuPath"
58 busName: paths.busName
59 actions: paths.actions
60 menuObjectPath: paths.menuObjectPath
63 Behavior on implicitHeight {
67 UbuntuNumberAnimation {
68 duration: UbuntuAnimation.SnapDuration
72 // delay enabling height behavior until the add transition is complete
73 onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
78 anchors.fill: contentColumn
79 objectName: "interactiveArea"
80 enabled: notification.type == Notification.Interactive
81 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
99 spacing: contentColumn.spacing
111 visible: iconSource !== undefined && iconSource != ""
115 fillMode: Image.PreserveAspectCrop
122 objectName: "secondaryIcon"
125 visible: source !== undefined && source != ""
126 fillMode: Image.PreserveAspectCrop
131 width: parent.width - x
133 anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
138 objectName: "summaryLabel"
145 color: Theme.palette.selected.backgroundText
146 elide: Text.ElideRight
152 objectName: "bodyLabel"
159 color: Theme.palette.selected.backgroundText
161 wrapMode: Text.WordWrap
163 elide: Text.ElideRight
169 objectName: "dialogListView"
174 anchors.left: parent.left; anchors.right: parent.right
177 model: unityMenuModel
179 NotificationMenuItemFactory {
180 anchors.left: parent.left; anchors.right: parent.right
182 menuModel: unityMenuModel
192 objectName: "buttonRow"
197 visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
200 property real buttonWidth: (width - contentColumn.spacing) / 2
201 property bool expanded
206 objectName: "button1"
207 width: parent.expanded ? parent.width : parent.buttonWidth
210 bottom: parent.bottom
212 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
213 gradient: UbuntuColors.greyGradient
215 if (actionRepeater.count > 2) {
216 buttonRow.expanded = !buttonRow.expanded
218 notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
223 UbuntuNumberAnimation {
224 duration: UbuntuAnimation.SnapDuration
232 objectName: "button0"
234 left: leftButton.right
235 leftMargin: contentColumn.spacing
238 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
241 bottom: parent.bottom
243 gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
245 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
250 objectName: "buttonColumn"
251 spacing: contentColumn.spacing
257 // calculate initial position before Column takes over
258 y: buttonRow.y + buttonRow.height + contentColumn.spacing
260 visible: notification.type == Notification.SnapDecision
261 height: buttonRow.expanded ? implicitHeight : 0
266 model: notification.actions
270 property string actionId: id
271 property string actionLabel: label
282 objectName: "button" + index
288 text: loader.actionLabel
290 gradient: UbuntuColors.greyGradient
291 onClicked: notification.notification.invokeAction(loader.actionId)
294 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