2 * Copyright (C) 2013-2015 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 1.3
19import Ubuntu.Components.ListItems 1.3 as ListItems
20import "Filters" as Filters
25 readonly property real searchesHeight: recentSearchesRepeater.count > 0 ? searchColumn.height + recentSearchesLabels.height + recentSearchesLabels.anchors.margins : 0
27 implicitHeight: searchesHeight + dashNavigation.implicitHeight + dashNavigation.anchors.topMargin + primaryFilter.height + primaryFilter.anchors.topMargin
30 property ListModel searchHistory
31 property var scope: null
32 property real windowHeight
35 readonly property bool hasContents: searchHistory.count > 0 || scope && scope.hasNavigation || scope && scope.primaryNavigationFilter
37 signal historyItemClicked(string text)
38 signal dashNavigationLeafClicked()
40 function resetNavigation() {
41 dashNavigation.resetNavigation();
49 ListItems.ThinDivider {
50 anchors.top: parent.top
54 id: recentSearchesLabels
55 text: i18n.tr("Recent Searches")
56 visible: recentSearchesRepeater.count > 0
65 text: i18n.tr("Clear All")
67 visible: recentSearchesRepeater.count > 0
76 onClicked: searchHistory.clear();
83 top: recentSearchesLabels.bottom
89 id: recentSearchesRepeater
90 objectName: "recentSearchesRepeater"
97 leftMargin: units.gu(2)
98 rightMargin: units.gu(2)
105 verticalCenter: parent.verticalCenter
108 height: units.gu(1.5)
115 verticalCenter: parent.verticalCenter
116 left: searchIcon.right
117 leftMargin: units.gu(1)
124 divider.visible: index != repeater.count - 1 || (scope && scope.hasNavigation) || primaryFilter.active
126 onClicked: root.historyItemClicked(text)
135 top: recentSearchesRepeater.count > 0 ? searchColumn.bottom : parent.top
136 topMargin: implicitHeight && recentSearchesRepeater.count > 0 ? units.gu(2) : 0
140 availableHeight: windowHeight * 4 / 6 - searchesHeight
142 onLeafClicked: root.dashNavigationLeafClicked();
145 Filters.FilterWidgetFactory {
147 active: scope && !scope.hasNavigation
149 property var filter: active ? scope.primaryNavigationFilter : null
152 top: recentSearchesRepeater.count > 0 ? searchColumn.bottom : parent.top
153 topMargin: active && recentSearchesRepeater.count > 0 ? units.gu(2) : 0
158 widgetId: filter ? filter.filterId : ""
159 widgetType: filter ? filter.filterType : -1
163 // This is outside the item
170 fillMode: Image.Stretch
171 source: "graphics/navigation_shadow.png"
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