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 Ubuntu.Components.ListItems 0.1 as ListItem
20import Ubuntu.DownloadDaemonListener 0.1
22import "../../Components"
23import "../../Components/IconUtil.js" as IconUtil
28 signal sendUserReview(string review)
30 title: root.previewData.title
34 orientation: ListView.Horizontal
41 model: previewData.infoMap["more-screenshots"] != null ? previewData.infoMap["more-screenshots"].value : [previewData.image]
43 delegate: UbuntuShape {
54 sourceSize { width: shape.width; height: shape.height }
55 source: modelData ? modelData : ""
56 fillMode: Image.PreserveAspectCrop
66 objectName: "gridButtons"
68 property int numOfRows: (count + 1) / 2
69 property int spacing: units.gu(1)
70 height: Math.max(units.gu(5), units.gu(5)*numOfRows + spacing*(numOfRows - 1))
73 cellWidth: Math.max(units.gu(9), width / 2)
74 cellHeight: buttonHeight + spacing
75 property int buttonWidth: count > 1 ? Math.max(0, width / 2 - spacing) : width
76 property int buttonHeight: units.gu(5)
79 width: Math.max(units.gu(4), buttonsGrid.buttonWidth)
80 height: buttonsGrid.buttonHeight
81 color: Theme.palette.selected.foreground
82 text: modelData.displayName
83 iconSource: modelData.iconHint
85 onClicked: root.previewData.execute(modelData.id, { })
95 objectName: "progressBar"
103 service: "com.canonical.applications.Downloader"
104 dbusPath: root.previewData.infoMap["progressbar_source"] ? root.previewData.infoMap["progressbar_source"].value : ""
107 var percentage = parseInt(received * 100 / total);
108 progressBar.value = percentage;
112 root.previewData.execute(progressBar.model[0].id, { })
125 sourceComponent: root.previewData.infoMap["show_progressbar"] ? progressComponent : buttonsComponent
128 item.model = root.previewData.actions;
136 objectName: "appInfo"
137 anchors { left: parent.left; right: parent.right }
139 appName: root.previewData.title
140 icon: IconUtil.from_gicon(root.previewData.appIcon)
141 rating: Math.round(root.previewData.rating * 10)
142 reviews: root.previewData.numRatings
143 rated: root.previewData.infoMap["rated"] ? root.previewData.infoMap["rated"].value : 0
147 anchors { left: parent.left; right: parent.right }
148 text: root.previewData.description
150 color: Theme.palette.selected.backgroundText
152 wrapMode: Text.WordWrap
158 visible: root.previewData.rating >= 0
159 anchors { left: parent.left; right: parent.right }
160 spacing: parent.spacing
162 ListItem.ThinDivider { }
165 anchors { left: parent.left; right: parent.right }
166 height: rateLabel.height
175 text: i18n.tr("Rate this")
177 anchors.left: parent.left
178 anchors.verticalCenter: parent.verticalCenter
181 // FIXME these need to be made interactive and connected to the scope
183 anchors.right: parent.right
184 anchors.verticalCenter: parent.verticalCenter
188 ListItem.ThinDivider { }
191 objectName: "appReviews"
192 anchors { left: parent.left; right: parent.right }
194 model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
196 onSendReview: root.sendUserReview(review);
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