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
21import "Previews" as Previews
26 property var scope: null
27 property var scopeStyle: null
29 property alias open: previewListView.open
30 property alias model: previewListView.model
31 property alias currentIndex: previewListView.currentIndex
32 property alias currentItem: previewListView.currentItem
33 property alias count: previewListView.count
37 objectName: "pageHeader"
39 title: scope ? scope.name : ""
41 searchEntryEnabled: false
42 scopeStyle: root.scopeStyle
44 onBackClicked: root.open = false
49 objectName: "listView"
56 orientation: ListView.Horizontal
57 highlightRangeMode: ListView.StrictlyEnforceRange
58 snapMode: ListView.SnapOneItem
59 boundsBehavior: Flickable.DragAndOvershootBounds
60 highlightMoveDuration: 250
61 flickDeceleration: units.gu(625)
62 maximumFlickVelocity: width * 5
65 // To be set before opening the preview
66 property string categoryId: ""
68 // because the ListView is built asynchronous, setting the
69 // currentIndex directly won't work. We need to refresh it
70 // when the first preview is ready to be displayed.
71 property bool init: true
73 property bool open: false
79 // Cancel any pending preview requests or actions
80 if (previewListView.currentItem && previewListView.currentItem.previewData !== undefined) {
81 previewListView.currentItem.previewData.cancelAction();
83 scope.cancelActivation();
89 objectName: "previewItem" + index
90 height: previewListView.height
91 width: previewListView.width
93 readonly property bool ready: preview.previewModel.loaded
97 objectName: "preview" + index
100 isCurrent: parent.ListView.isCurrentItem
103 var previewStack = root.scope.preview(result);
104 return previewStack.getPreviewModel(0);
106 scopeStyle: root.scopeStyle
110 id: processingMouseArea
111 objectName: "processingMouseArea"
113 enabled: !preview.previewModel.loaded || preview.previewModel.processingAction
116 anchors.centerIn: parent
117 visible: root.open && parent.enabled
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