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 property QtObject indicatorsModel: null
30 property bool __contentActive: false
31 readonly property int currentMenuIndex : filteredIndicators.mapToSource(tabs.selectedTabIndex)
32 backgroundColor: "#221e1c" // FIXME not in palette yet
33 property int contentReleaseInterval: 20000
34 property bool activeHeader: false
35 property alias visibleIndicators: visibleIndicatorsModel.visible
40 function setCurrentMenuIndex(index) {
41 var filteredIndex = filteredIndicators.mapFromSource(index)
43 if (tabs.selectedTabIndex !== filteredIndex) {
44 if (tabs.selectedTabIndex == -1) {
45 tabs.tabBar.animate = false;
47 tabs.selectedTabIndex = filteredIndex;
48 tabs.tabBar.animate = true;
52 function activateContent() {
53 contentReleaseTimer.stop();
54 __contentActive = true;
57 function releaseContent() {
58 if (__contentActive) {
59 contentReleaseTimer.restart();
63 onActiveHeaderChanged: {
64 tabs.tabBar.selectionMode = activeHeader;
65 tabs.tabBar.alwaysSelectionMode = activeHeader;
68 SortFilterProxyModel {
69 id: filteredIndicators
70 model: visibleIndicatorsModel
71 dynamicSortFilter: true
73 filterRole: Indicators.IndicatorsModelRole.IsVisible
74 filterRegExp: RegExp("^true$")
77 Indicators.VisibleIndicatorsModel {
78 id: visibleIndicatorsModel
79 model: indicatorsModel
90 model: filteredIndicators
91 objectName: "tabsRepeater"
93 // FIXME: This is needed because tabs dont handle repeaters well.
94 // Due to the child ordering happening after child insertion.
97 parent.childrenChanged();
102 objectName: model.identifier
112 property bool contentActive: content.__contentActive && menuActivator.content[index].active
114 onContentActiveChanged: {
115 if (contentActive && item) {
117 } else if (!contentActive && item) {
123 // Reset the indicator states
124 if (!visible && item && item["reset"]) {
130 for(var pName in indicatorProperties) {
131 if (item.hasOwnProperty(pName)) {
132 item[pName] = indicatorProperties[pName]
135 if (contentActive && tabs.visible) {
146 id: contentReleaseTimer
148 interval: contentReleaseInterval
150 content.__contentActive = false;
151 menuActivator.clear();
155 Indicators.MenuContentActivator {
157 running: content.__contentActive
158 baseIndex: content.currentMenuIndex
159 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