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
24 property alias iconSource: avatarIcon.source
25 property alias secondaryIconSource: secondaryIcon.source
26 property alias summary: summaryLabel.text
27 property alias body: bodyLabel.text
29 property var notificationId
32 property var notification
34 objectName: "background"
35 implicitHeight: contentColumn.height + contentColumn.spacing * 2
36 color: Qt.rgba(0, 0, 0, 0.85)
41 Behavior on implicitHeight {
45 UbuntuNumberAnimation {
46 duration: UbuntuAnimation.SnapDuration
50 // delay enabling height behavior until the add transition is complete
51 onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
56 anchors.fill: contentColumn
57 objectName: "interactiveArea"
58 enabled: notification.type == Notification.Interactive
59 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
77 spacing: contentColumn.spacing
89 visible: iconSource !== undefined && iconSource != ""
93 fillMode: Image.PreserveAspectCrop
100 objectName: "secondaryIcon"
103 visible: source !== undefined && source != ""
104 fillMode: Image.PreserveAspectCrop
109 width: parent.width - x
114 objectName: "summaryLabel"
121 color: Theme.palette.selected.backgroundText
122 elide: Text.ElideRight
128 objectName: "bodyLabel"
135 color: Theme.palette.selected.backgroundText
137 wrapMode: Text.WordWrap
139 elide: Text.ElideRight
147 objectName: "buttonRow"
152 visible: notification.type == Notification.SnapDecision
155 property real buttonWidth: (width - contentColumn.spacing) / 2
156 property bool expanded
161 objectName: "button1"
162 width: parent.expanded ? parent.width : parent.buttonWidth
165 bottom: parent.bottom
167 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
168 gradient: UbuntuColors.greyGradient
170 if (actionRepeater.count > 2) {
171 buttonRow.expanded = !buttonRow.expanded
173 notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
178 UbuntuNumberAnimation {
179 duration: UbuntuAnimation.SnapDuration
187 objectName: "button0"
189 left: leftButton.right
190 leftMargin: contentColumn.spacing
193 text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
196 bottom: parent.bottom
198 gradient: notification.hints == Notification.ButtonTint ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
200 onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
205 objectName: "buttonColumn"
206 spacing: contentColumn.spacing
212 // calculate initial position before Column takes over
213 y: buttonRow.y + buttonRow.height + contentColumn.spacing
215 visible: notification.type == Notification.SnapDecision
216 height: buttonRow.expanded ? implicitHeight : 0
221 model: notification.actions
225 property string actionId: id
226 property string actionLabel: label
237 objectName: "button" + index
243 text: loader.actionLabel
245 gradient: UbuntuColors.greyGradient
246 onClicked: notification.notification.invokeAction(loader.actionId)
249 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