@@ -0,0 +1,122 @@
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/>.
18+import Ubuntu.Components 0.1
19+import Unity.Indicators 0.1 as Indicators
20+import "../Components"
25+ property QtObject indicatorsModel: null
26+ property alias currentMenuIndex : tabs.selectedTabIndex
27+ property color backgroundColor: "#221e1c"
28+ property int contentReleaseInterval: 20000
33+ // FIXME: *grumble* MainView is locked to style with a background. OVERRIDE!!
36+ color: backgroundColor
41+ property bool contentActive: false
44+ function activateContent() {
45+ contentReleaseTimer.stop();
46+ d.contentActive = true;
49+ function releaseContent() {
50+ if (d.contentActive) {
51+ contentReleaseTimer.restart();
62+ model: indicatorsModel
65+ // FIXME: This is needed because tabs dont handle repeaters well.
66+ // Due to the child ordering happening after child insertion.
69+ parent.childrenChanged();
74+ title: indicatorsModel ? indicatorsModel.data(index, Indicators.IndicatorsModelRole.Title) : ""
83+ property bool contentActive: d.contentActive
85+ onContentActiveChanged: {
86+ if (contentActive && item) {
88+ } else if (!contentActive && item) {
94+ // Reset the indicator states
95+ if (!visible && item && item["reset"]) {
101+ for(var pName in indicatorProperties) {
102+ if (item.hasOwnProperty(pName)) {
103+ item[pName] = indicatorProperties[pName]
106+ if (contentActive && menus.visible) {
117+ id: contentReleaseTimer
119+ interval: contentReleaseInterval
120+ onTriggered: d.contentActive = false