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: icon.fileSource
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 property bool fullscreen
39 objectName: "background"
40 implicitHeight: type != Notification.PlaceHolder ? (fullscreen ? notificationList.fullHeight : contentColumn.height + contentColumn.spacing * 4) : 0
42 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
45 clip: fullscreen ? false : true
46 visible: type != Notification.PlaceHolder
53 anchors.margins: notificationList.margin
55 opacity: parent.opacity
65 opacity: parent.opacity
70 anchors.fill: fullscreen ? nonShapedBack : shapedBack
75 source: hints["x-canonical-private-menu-model"]
77 busNameHint: "busName"
78 actionsHint: "actions"
79 menuObjectPathHint: "menuPath"
85 busName: paths.busName
86 actions: paths.actions
87 menuObjectPath: paths.menuObjectPath
90 Behavior on implicitHeight {
94 UbuntuNumberAnimation {
95 duration: UbuntuAnimation.SnapDuration
99 // delay enabling height behavior until the add transition is complete
100 onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
105 anchors.fill: contentColumn
106 objectName: "interactiveArea"
107 enabled: notification.type == Notification.Interactive
108 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
118 margins: fullscreen ? 0 : spacing
126 spacing: contentColumn.spacing
138 shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
139 visible: iconSource !== undefined && iconSource != ""
145 objectName: "secondaryIcon"
148 visible: source !== undefined && source != ""
149 fillMode: Image.PreserveAspectCrop
154 width: parent.width - x
156 anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
161 objectName: "summaryLabel"
168 color: Theme.palette.selected.backgroundText
169 elide: Text.ElideRight
175 objectName: "bodyLabel"
182 color: Theme.palette.selected.backgroundText
184 wrapMode: Text.WordWrap
186 elide: Text.ElideRight
192 objectName: "dialogListView"
197 anchors.left: parent.left; anchors.right: parent.right
198 anchors.top: fullscreen ? parent.top : undefined
199 anchors.bottom: fullscreen ? parent.bottom : undefined
202 model: unityMenuModel
204 NotificationMenuItemFactory {
205 anchors.left: parent.left; anchors.right: parent.right
207 menuModel: unityMenuModel
217 objectName: "buttonRow"
222 visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
225 property real buttonWidth: (width - contentColumn.spacing) / 2
226 property bool expanded
231 objectName: "button1"
232 width: parent.expanded ? parent.width : parent.buttonWidth
235 bottom: parent.bottom
237 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
238 gradient: UbuntuColors.greyGradient
240 if (actionRepeater.count > 2) {
241 buttonRow.expanded = !buttonRow.expanded
243 notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
248 UbuntuNumberAnimation {
249 duration: UbuntuAnimation.SnapDuration
257 objectName: "button0"
259 left: leftButton.right
260 leftMargin: contentColumn.spacing
263 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
266 bottom: parent.bottom
268 gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
270 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
275 objectName: "buttonColumn"
276 spacing: contentColumn.spacing
282 // calculate initial position before Column takes over
283 y: buttonRow.y + buttonRow.height + contentColumn.spacing
285 visible: notification.type == Notification.SnapDecision && buttonRow.expanded
286 height: buttonRow.expanded ? implicitHeight : 0
291 model: notification.actions
295 property string actionId: id
296 property string actionLabel: label
307 objectName: "button" + index
313 text: loader.actionLabel
315 gradient: UbuntuColors.greyGradient
316 onClicked: notification.notification.invokeAction(loader.actionId)
319 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