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
23import Unity.Indicators 0.1 as Indicators
29 property alias emptyText: emptyLabel.text
30 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
32 Indicators.UnityMenuModelStack {
39 model: menuStack.tail ? menuStack.tail : null
43 bottomMargin: Qt.inputMethod.visible ? (Qt.inputMethod.keyboardRectangle.height - main.anchors.bottomMargin) : 0
45 Behavior on bottomMargin {
48 easing.type: Easing.OutQuad
51 // TODO - does ever frame.
52 onBottomMarginChanged: {
53 mainMenu.positionViewAtIndex(mainMenu.currentIndex, ListView.End)
57 // Ensure all delegates are cached in order to improve smoothness of scrolling
60 // Only allow flicking if the content doesn't fit on the page
61 interactive: contentHeight > height
78 property int modelIndex: index
85 sourceComponent: factory.load(model)
88 if (model.type === rootMenuType) {
89 menuStack.push(mainMenu.model.submenu(index));
92 if (item.hasOwnProperty("menuActivated")) {
93 item.menuActivated = Qt.binding(function() { return ListView.isCurrentItem; });
94 item.selectMenu.connect(function() { ListView.view.currentIndex = index });
95 item.deselectMenu.connect(function() { ListView.view.currentIndex = -1 });
97 if (item.hasOwnProperty("menu")) {
98 item.menu = Qt.binding(function() { return model; });
100 item.activate.connect(onActivateMenu);
101 item.changeState.connect(onChangeState);
105 function onActivateMenu(value) {
106 mainMenu.model.activate(index, value);
109 function onChangeState(value) {
110 mainMenu.model.changeState(index, value);
118 model: mainMenu.model
123 visible: mainMenu.count == 0
128 topMargin: units.gu(2)
130 wrapMode: Text.WordWrap
131 horizontalAlignment: Text.AlignHCenter
157 mainMenu.currentIndex = -1;
158 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