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
23 property var previewData
25 property string title: ""
26 property real previewWidthRatio: 0.5
28 property Component header
29 property Component buttons
30 property Component body
32 readonly property bool narrowMode: width <= height
33 readonly property int contentSpacing: units.gu(3)
36 signal previewImageClicked()
38 color: Qt.rgba(0, 0, 0, .3)
42 target: shell.applicationManager
43 onMainStageFocusedApplicationChanged: {
46 onSideStageFocusedApplicationChanged: {
62 margins: root.contentSpacing
68 leftMargin: -root.contentSpacing
69 rightMargin: -root.contentSpacing
70 topMargin: -root.contentSpacing
73 onClicked: root.close();
80 rightMargin: closePreviewImage.width + spacing
83 property int spacing: units.gu(2)
87 objectName: "titleLabel"
93 elide: Text.ElideRight
95 font.weight: Font.Light
96 color: Theme.palette.selected.backgroundText
103 id: closePreviewImage
104 source: "graphics/tablet/icon_close_preview.png"
106 height: units.gu(1.5)
109 bottomMargin: units.dp(7)
111 leftMargin: title.paintedWidth + labelItem.spacing
122 top: headerRow.bottom
123 bottom: parent.bottom
124 margins: root.contentSpacing
131 anchors.top: parent.top
132 anchors.bottom: parent.bottom
133 width: root.narrowMode ? contentRow.width : contentRow.width * root.previewWidthRatio
134 contentHeight: leftColumn.height
139 objectName: "leftColumn"
144 height: childrenRect.height
149 anchors.left: parent.left
150 anchors.right: parent.right
151 sourceComponent: root.header
155 anchors.left: parent.left
156 anchors.right: parent.right
157 sourceComponent: root.buttons
164 anchors.top: parent.top
165 anchors.bottom: parent.bottom
166 width: narrowMode ? 0 : (contentRow.width - leftColumn.width - contentRow.spacing)
167 contentHeight: rightColumn.height
172 objectName: "rightColumn"
173 height: childrenRect.height
183 parent: root.narrowMode ? leftColumn : rightColumn
184 anchors.left: parent.left
185 anchors.right: parent.right
186 sourceComponent: root.body
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