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 components
26 implicitWidth: childrenRect.width
27 implicitHeight: childrenRect.height
32 objectName: "artShape"
34 if (!visible) return 0
35 return image.fillMode === Image.PreserveAspectCrop || aspect < image.aspect ? image.width : height * image.aspect
38 if (!visible) return 0
39 return image.fillMode === Image.PreserveAspectCrop || aspect > image.aspect ? image.height : width / image.aspect
41 anchors.horizontalCenter: template && template["card-layout"] === "horizontal" ? undefined : parent.horizontalCenter
42 anchors.left: template && template["card-layout"] === "horizontal" ? parent.left : undefined
43 visible: cardData && cardData["art"] || false
45 property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1
48 width: template && template["card-layout"] === "horizontal" ? height * artShape.aspect : root.width
49 height: template && template["card-layout"] === "horizontal" ? header.height : width / artShape.aspect
50 objectName: "artImage"
51 source: cardData && cardData["art"] || ""
52 // FIXME uncomment when having investigated / fixed the crash
53 //sourceSize.width: width > height ? width : 0
54 //sourceSize.height: height > width ? height : 0
55 fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop
57 property real aspect: implicitWidth / implicitHeight
63 objectName: "cardHeader"
65 top: template && template["card-layout"] === "horizontal" ? artShape.top : artShape.bottom
66 left: template && template["card-layout"] === "horizontal" ? artShape.right : parent.left
70 mascot: cardData && cardData["mascot"] || ""
71 title: cardData && cardData["title"] || ""
72 subtitle: cardData && cardData["subtitle"] || ""
76 objectName: "summaryLabel"
77 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
80 elide: Text.ElideRight
81 text: cardData && cardData["summary"] || ""
82 height: text ? implicitHeight : 0
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