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
19import Unity.Indicators 0.1 as Indicators
22// FIXME : We dont want to use MainView.
23// Need a regular Item which can have tabs with local header.
24// https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1211704
28 property QtObject indicatorsModel: null
29 property bool __contentActive: false
30 readonly property int currentMenuIndex : tabs.selectedTabIndex
31 backgroundColor: "#221e1c" // FIXME not in palette yet
32 property int contentReleaseInterval: 20000
33 property bool activeHeader: false
38 function setCurrentMenuIndex(index) {
39 if (currentMenuIndex !== index) {
40 if (currentMenuIndex == -1) {
41 tabs.tabBar.animate = false;
43 tabs.selectedTabIndex = index;
44 tabs.tabBar.animate = true;
48 function activateContent() {
49 contentReleaseTimer.stop();
50 __contentActive = true;
53 function releaseContent() {
54 if (__contentActive) {
55 contentReleaseTimer.restart();
59 onActiveHeaderChanged: {
60 tabs.tabBar.selectionMode = activeHeader;
61 tabs.tabBar.alwaysSelectionMode = activeHeader;
72 model: indicatorsModel
75 // FIXME: This is needed because tabs dont handle repeaters well.
76 // Due to the child ordering happening after child insertion.
79 parent.childrenChanged();
84 objectName: model.identifier
94 property bool contentActive: content.__contentActive
96 onContentActiveChanged: {
97 if (contentActive && item) {
99 } else if (!contentActive && item) {
105 // Reset the indicator states
106 if (!visible && item && item["reset"]) {
112 for(var pName in indicatorProperties) {
113 if (item.hasOwnProperty(pName)) {
114 item[pName] = indicatorProperties[pName]
117 if (contentActive && menus.visible) {
128 id: contentReleaseTimer
130 interval: contentReleaseInterval
131 onTriggered: content.__contentActive = 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