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
20import "../Components/ListItems" as ListItems
21import "../Components/IconUtil.js" as IconUtil
25 property alias previewShown: previewLoader.onScreen
28 pageHeader.resetSearch();
31 onMovementStarted: categoryView.showHeader()
34 target: scopeView.scope
35 property: "searchQuery"
36 value: pageHeader.searchQuery
41 onSearchClicked: if (isCurrent) {
42 pageHeader.triggerSearch()
43 categoryView.showHeader()
50 model: scopeView.categories
51 forceNoClip: previewLoader.onScreen
53 onAtYEndChanged: if (atYEnd) endReached()
54 onMovingChanged: if (moving && atYEnd) endReached()
56 delegate: ListItems.Base {
57 highlightWhenPressed: false
67 source: getRenderer(model.renderer, model.contentType)
74 target: rendererLoader.item
76 effect.positionPx = mapToItem(categoryView, 0, itemY).y
77 scopeView.scope.activate(delegateItem.model.uri,
78 delegateItem.model.icon,
79 delegateItem.model.category,
81 delegateItem.model.mimetype,
82 delegateItem.model.title,
83 delegateItem.model.comment,
84 delegateItem.model.dndUri,
85 delegateItem.model.metadata)
88 effect.positionPx = mapToItem(categoryView, 0, itemY).y
89 scopeView.scope.preview( delegateItem.model.uri,
90 delegateItem.model.icon,
91 delegateItem.model.category,
93 delegateItem.model.mimetype,
94 delegateItem.model.title,
95 delegateItem.model.comment,
96 delegateItem.model.dndUri,
97 delegateItem.model.metadata)
103 sectionProperty: "name"
104 sectionDelegate: ListItems.Header {
105 width: categoryView.width
108 pageHeader: PageHeader {
110 objectName: "pageHeader"
111 width: categoryView.width
112 text: scopeView.scope.name
113 searchEntryEnabled: true
117 function getRenderer(rendererId, contentType) {
118 switch (rendererId) {
120 switch (contentType) {
121 case "video": return "Generic/GenericFilterGridPotrait.qml";
122 default: return "Generic/GenericFilterGrid.qml";
125 case "carousel": return "Generic/GenericCarousel.qml";
126 default: return "Generic/GenericFilterGrid.qml";
134 bottomMargin: -bottomOverflow
136 sourceItem: categoryView
140 topGapPx: (1 - gap) * positionPx
141 topOpacity: (1 - gap * 1.2)
142 bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx)
143 bottomOverflow: units.gu(20)
144 bottomOpacity: 1 - (gap * 0.8)
146 property int targetBottomGapPx: height - units.gu(8) - bottomOverflow
147 property real gap: previewLoader.open ? 1.0 : 0.0
152 easing.type: Easing.InOutQuad
154 if (!previewLoader.open && !running) {
155 previewLoader.onScreen = false
163 target: scopeView.scope
165 previewLoader.previewData = preview
166 previewLoader.open = true
170 PreviewDelegateMapper {
171 id: previewDelegateMapper
175 ignoreUnknownSignals: true
176 target: previewLoader.valid ? previewLoader.item : null
178 previewLoader.open = false
184 property var previewData
185 height: effect.bottomGapPx - effect.topGapPx
188 topMargin: effect.topGapPx
192 source: onScreen ? previewDelegateMapper.map(previewLoader.previewData.rendererName) : ""
194 property bool open: false
195 property bool onScreen: false
196 property bool valid: item !== null
205 item.previewData = previewLoader.previewData
209 // TODO: Move as InverseMouseArea to DashPreview
211 enabled: previewLoader.onScreen
214 topMargin: effect.bottomGapPx
217 previewLoader.open = false;
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