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 "../../Components"
20import "../../Components/ListItems" as ListItems
21import "../../Components/IconUtil.js" as IconUtil
27 title: previewData.title
28 previewWidthRatio: 0.6
30 property url url: IconUtil.from_gicon(previewData.image)
32 // TODO: replace this UbuntuShape with the Video component once that lands
36 anchors.left: parent.left
37 anchors.right: parent.right
38 height: width * previewImage.sourceSize.height / previewImage.sourceSize.width
43 source: genericPreview.url
44 fillMode: Image.PreserveAspectCrop
48 id: previewImageMouseArea
50 onClicked: genericPreview.previewImageClicked()
56 model: genericPreview.previewData.actions
58 property int numOfRows: (count + 1) / 2
59 property int spacing: units.gu(1)
60 height: Math.max(units.gu(4), units.gu(4)*numOfRows + spacing*(numOfRows - 1))
62 cellWidth: Math.max(units.gu(9), width / 2)
63 cellHeight: buttonHeight + spacing
64 property int buttonWidth: Math.max(0, width / 2 - spacing)
65 property int buttonHeight: units.gu(4)
68 width: Math.max(units.gu(4), buttons.buttonWidth)
69 height: buttons.buttonHeight
71 text: modelData.displayName
72 iconSource: modelData.iconHint
76 genericPreview.previewData.execute(modelData.id, { })
89 text: previewData.subtitle
92 wrapMode: Text.WordWrap
100 text: previewData.description
103 wrapMode: Text.WordWrap
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