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
70 minimumHorizontalSpacing: units.gu(0.5)
71 delegateWidth: units.gu(11)
72 delegateHeight: units.gu(18)
73 verticalSpacing: units.gu(2)
76 width: filtergrid.cellWidth
77 height: filtergrid.cellHeight
79 imageWidth: units.gu(11)
80 imageHeight: units.gu(16)
82 source: IconUtil.from_gicon(icon)
90 effect.positionPx = mapToItem(categoryView, 0, 0).y
91 scopeView.scope.activate(uri, icon,
99 effect.positionPx = mapToItem(categoryView, 0, 0).y
100 scopeView.scope.preview(uri, icon,
111 sectionProperty: "name"
112 sectionDelegate: ListItems.Header {
113 width: categoryView.width
116 pageHeader: PageHeader {
118 objectName: "pageHeader"
119 width: categoryView.width
120 text: scopeView.scope.name
121 searchEntryEnabled: true
129 bottomMargin: -bottomOverflow
131 sourceItem: categoryView
135 topGapPx: (1 - gap) * positionPx
136 topOpacity: (1 - gap * 1.2)
137 bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx)
138 bottomOverflow: units.gu(20)
139 bottomOpacity: 1 - (gap * 0.8)
141 property int targetBottomGapPx: height - units.gu(8) - bottomOverflow
142 property real gap: previewLoader.open ? 1.0 : 0.0
147 easing.type: Easing.InOutQuad
149 if (!previewLoader.open && !running) {
150 previewLoader.onScreen = false
158 target: scopeView.scope
160 previewLoader.previewData = preview
161 previewLoader.open = true
165 PreviewDelegateMapper {
166 id: previewDelegateMapper
170 ignoreUnknownSignals: true
171 target: previewLoader.valid ? previewLoader.item : null
173 previewLoader.open = false
179 property var previewData
180 height: effect.bottomGapPx - effect.topGapPx
183 topMargin: effect.topGapPx
187 source: onScreen ? previewDelegateMapper.map(previewLoader.previewData.rendererName) : ""
189 property bool open: false
190 property bool onScreen: false
191 property bool valid: item !== null
200 item.previewData = previewLoader.previewData
204 // TODO: Move as InverseMouseArea to DashPreview
206 enabled: previewLoader.onScreen
209 topMargin: effect.bottomGapPx
212 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