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
22 property alias mascot: mascotImage.source
23 property alias title: titleLabel.text
24 property alias subtitle: subtitleLabel.text
25 property alias price: priceLabel.text
26 property alias oldPrice: oldPriceLabel.text
27 property alias altPrice: altPriceLabel.text
29 visible: mascotImage.status === Image.Ready || title || price
30 height: row.height > 0 ? row.height + row.margins * 2 : 0
34 objectName: "outerRow"
36 property real margins: units.gu(1)
39 top: parent.top; left: parent.left; right: parent.right
44 spacing: mascotShape.visible ? margins : 0
48 objectName: "mascotShape"
50 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
52 height: units.gu(5.625)
53 visible: image.status === Image.Ready
54 readonly property int maxSize: Math.max(width, height)
59 sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
60 fillMode: Image.PreserveAspectCrop
61 horizontalAlignment: Image.AlignHCenter
62 verticalAlignment: Image.AlignVCenter
68 width: parent.width - x
69 spacing: units.gu(0.5)
73 objectName: "titleLabel"
74 anchors { left: parent.left; right: parent.right }
75 elide: Text.ElideRight
76 font.weight: Font.DemiBold
84 objectName: "subtitleLabel"
85 anchors { left: parent.left; right: parent.right }
86 elide: Text.ElideRight
87 font.weight: Font.Light
88 visible: titleLabel.text && text
95 anchors { left: parent.left; right: parent.right }
97 property int labels: {
98 var labels = 1; // price always visible
99 if (oldPriceLabel.text !== "") labels += 1;
100 if (altPriceLabel.text !== "") labels += 1;
103 property real labelWidth: width / labels
107 width: parent.labelWidth
108 elide: Text.ElideRight
109 font.weight: Font.DemiBold
110 color: Theme.palette.selected.foreground
116 objectName: "oldPriceLabel"
117 width: parent.labelWidth
118 elide: Text.ElideRight
119 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
125 width: parent.labelWidth
126 elide: Text.ElideRight
127 horizontalAlignment: Text.AlignRight
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