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 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 shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
112 visible: iconSource !== undefined && iconSource != ""
118 objectName: "secondaryIcon"
121 visible: source !== undefined && source != ""
122 fillMode: Image.PreserveAspectCrop
127 width: parent.width - x
129 anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
134 objectName: "summaryLabel"
141 color: Theme.palette.selected.backgroundText
142 elide: Text.ElideRight
148 objectName: "bodyLabel"
155 color: Theme.palette.selected.backgroundText
157 wrapMode: Text.WordWrap
159 elide: Text.ElideRight
165 objectName: "dialogListView"
170 anchors.left: parent.left; anchors.right: parent.right
173 model: unityMenuModel
175 NotificationMenuItemFactory {
176 anchors.left: parent.left; anchors.right: parent.right
178 menuModel: unityMenuModel
188 objectName: "buttonRow"
193 visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
196 property real buttonWidth: (width - contentColumn.spacing) / 2
197 property bool expanded
202 objectName: "button1"
203 width: parent.expanded ? parent.width : parent.buttonWidth
206 bottom: parent.bottom
208 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
209 gradient: UbuntuColors.greyGradient
211 if (actionRepeater.count > 2) {
212 buttonRow.expanded = !buttonRow.expanded
214 notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
219 UbuntuNumberAnimation {
220 duration: UbuntuAnimation.SnapDuration
228 objectName: "button0"
230 left: leftButton.right
231 leftMargin: contentColumn.spacing
234 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
237 bottom: parent.bottom
239 gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
241 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
246 objectName: "buttonColumn"
247 spacing: contentColumn.spacing
253 // calculate initial position before Column takes over
254 y: buttonRow.y + buttonRow.height + contentColumn.spacing
256 visible: notification.type == Notification.SnapDecision
257 height: buttonRow.expanded ? implicitHeight : 0
262 model: notification.actions
266 property string actionId: id
267 property string actionLabel: label
278 objectName: "button" + index
284 text: loader.actionLabel
286 gradient: UbuntuColors.greyGradient
287 onClicked: notification.notification.invokeAction(loader.actionId)
290 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