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
23// FIXME : We dont want to use MainView.
24// Need a regular Item which can have tabs with local header.
25// https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1211704
29 nativeOrientationAngle: 0 // stop contents being re-rotated when shell in landscape
30 property QtObject indicatorsModel: null
31 property bool __contentActive: false
32 readonly property int currentMenuIndex: tabs.selectedTabIndex
33 backgroundColor: "#221e1c" // FIXME not in palette yet
34 property int contentReleaseInterval: 20000
35 property bool activeHeader: false
36 property real headerHeight: tabs.tabBar.height
41 function setCurrentMenuIndex(index, animate) {
42 if (tabs.selectedTabIndex !== index) {
43 if (tabs.selectedTabIndex === -1 || !animate) {
44 tabs.tabBar.animate = false;
46 tabs.selectedTabIndex = index;
47 tabs.tabBar.animate = true;
51 function activateContent() {
52 contentReleaseTimer.stop();
53 __contentActive = true;
56 function releaseContent() {
57 if (__contentActive) {
58 contentReleaseTimer.restart();
62 onActiveHeaderChanged: {
63 tabs.tabBar.selectionMode = activeHeader;
64 tabs.tabBar.alwaysSelectionMode = activeHeader;
74 model: content.indicatorsModel ? content.indicatorsModel : null
75 objectName: "tabsRepeater"
77 // FIXME: This is needed because tabs dont handle repeaters well.
78 // Due to the child ordering happening after child insertion.
81 parent.childrenChanged();
86 objectName: model.identifier
96 readonly property bool indexActive: index >= 0 && index < menuActivator.count && menuActivator.content[index].active
97 readonly property bool contentActive: content.__contentActive && indexActive
99 onContentActiveChanged: {
100 if (contentActive && item) {
102 } else if (!contentActive && item) {
108 // Reset the indicator states
109 if (!visible && item && item["reset"]) {
115 for(var pName in indicatorProperties) {
116 if (item.hasOwnProperty(pName)) {
117 item[pName] = indicatorProperties[pName]
120 if (contentActive && tabs.visible) {
128 value: loader.item && loader.item.hasOwnProperty("title") && loader.item.title !== "" ? loader.item.title : model.identifier
133 property: "objectName"
134 value: identifier + "-page"
143 id: contentReleaseTimer
145 interval: contentReleaseInterval
147 content.__contentActive = false;
148 menuActivator.clear();
152 Indicators.MenuContentActivator {
154 running: content.__contentActive
155 baseIndex: content.currentMenuIndex
156 count: indicatorsModel.count
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