2 * Copyright 2013 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Nick Dedekind <nick.dedekind@canonical.com>
22import Ubuntu.Components 0.1 as Components
28 property alias emptyText: emptyLabel.text
29 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
30 property bool __active: false
35 property int visibleItems: 0
40 bottomMargin: Qt.inputMethod.visible ? (Qt.inputMethod.keyboardRectangle.height - main.anchors.bottomMargin) : 0
42 Behavior on bottomMargin {
45 easing.type: Easing.OutQuad
48 // TODO - does ever frame.
49 onBottomMarginChanged: {
50 mainMenu.positionViewAtIndex(mainMenu.currentIndex, ListView.End)
54 // Ensure all delegates are cached in order to improve smoothness of scrolling
57 // Only allow flicking if the content doesn't fit on the page
58 interactive: contentHeight > height
63 property bool ready: false
64 property alias empty: factory.empty
70 height: div.height + factory.implicitHeight
73 Component.onCompleted: {
75 mainMenu.visibleItems += 1;
79 Component.onDestruction: {
81 mainMenu.visibleItems -= 1;
91 mainMenu.visibleItems -= 1;
93 mainMenu.visibleItems += 1;
98 if (!highlightFollowsCurrentItem) {
99 mainMenu.currentIndex = -1;
111 anchors.left: parent.left
112 anchors.right: parent.right
113 // only visible if is a root or a section header element and the factory is visible
119 if (hasSection || ((depth == 0) && (!factory.empty))) {
120 return implicitHeight;
130 actionGroup: main.actionGroup
131 isCurrentItem: item.ListView.isCurrentItem
140 onActivated: item.ListView.view.currentIndex = index
141 onDeactivated: item.ListView.view.currentIndex = -1
150 visible: (mainMenu.visibleItems === 0)
155 topMargin: units.gu(2)
157 wrapMode: Text.WordWrap
158 horizontalAlignment: Text.AlignHCenter
188 mainMenu.currentIndex = -1;
189 mainMenu.positionViewAtBeginning();
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