2 * Copyright 2016 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/>.
20 property Item itemView: null
22 signal select(int index)
24 function selectNext(currentIndex) {
27 if (currentIndex === -1 && itemView.count > 0) {
28 while (itemView.count > newIndex) {
29 menu = itemView.itemAt(newIndex);
30 if (!!menu["enabled"]) {
36 } else if (currentIndex !== -1 && itemView.count > 1) {
37 var startIndex = (currentIndex + 1) % itemView.count;
38 newIndex = startIndex;
40 menu = itemView.itemAt(newIndex);
41 if (!!menu["enabled"]) {
45 newIndex = (newIndex + 1) % itemView.count;
46 } while (newIndex !== startIndex)
50 function selectPrevious(currentIndex) {
52 var newIndex = itemView.count-1;
53 if (currentIndex === -1 && itemView.count > 0) {
54 while (itemView.count > newIndex) {
55 menu = itemView.itemAt(newIndex);
56 if (!!menu["enabled"]) {
62 } else if (currentIndex !== -1 && itemView.count > 1) {
63 var startIndex = currentIndex - 1;
64 newIndex = startIndex;
67 newIndex = itemView.count - 1;
69 menu = itemView.itemAt(newIndex);
70 if (!!menu["enabled"]) {
75 } while (newIndex !== startIndex)
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