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
25 property QtObject indicatorsModel: null
26 property bool animate: true // FIXME: Remove. This doesnt seem to be being used and it's referenced in Indicators.
27 property bool overviewActive: true // "state of the menu"
28 property bool __shown: false
29 property bool __contentActive: false
30 property alias currentIndex : menus.currentIndex
31 property color backgroundColor: "#221e1c"
32 property int contentReleaseInterval: 5000
36 color: backgroundColor
39 signal menuSelected(int index)
43 overviewActive = false
46 function showOverview() {
55 function activateContent() {
56 contentReleaseTimer.stop()
57 __contentActive = true
60 function releaseContent() {
62 contentReleaseTimer.restart()
69 anchors.bottom: parent.bottom
70 anchors.top: header.bottom
73 spacing: units.gu(0.5)
74 opacity: !overviewActive && __shown ? 1 : 0
76 orientation: ListView.Horizontal
77 model: indicatorsModel
79 //FIXME: This will make sure that all plugins still alive
80 //check bug https://bugs.launchpad.net/manhattan/+bug/1088945 for more details
81 cacheBuffer: 2147483647
85 property bool contentActive: content.__contentActive
87 onContentActiveChanged: {
88 if (contentActive && item) {
90 } else if (!contentActive && item) {
97 sourceComponent: component
98 visible: content.__shown
100 // Reset the indicator states
101 if (!visible && item && item["reset"]) {
108 if (status == Loader.Ready) {
109 if (indicatorsModel.widgetsMap && item.hasOwnProperty("widgetsMap")) {
110 item["widgetsMap"] = indicatorsModel.widgetsMap
112 for(var pName in initialProperties) {
113 if (item.hasOwnProperty(pName)) {
114 item[pName] = initialProperties[pName]
117 if (contentActive && menus.visible) {
123 // FIXME: QTBUG-30632 - asynchronous loader crashes when changing index quickly.
124 Component.onDestruction: {
128 // Need to use a binding because the handle height changes.
129 // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin
132 property: "anchors.bottomMargin"
137 Behavior on opacity { NumberAnimation {duration: 200} }
142 objectName: "overview"
144 anchors.top: header.bottom
145 anchors.bottom: parent.bottom
146 // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin
147 anchors.bottomMargin: handle.height
150 indicatorsModel: content.indicatorsModel
151 enabled: content.overviewActive && content.__shown
152 opacity: content.overviewActive && content.__shown ? 1 : 0
153 Behavior on opacity {NumberAnimation{duration: 200}}
154 visible: opacity != 0
157 var storedDuration = menus.highlightMoveDuration
158 var storedVelocity = menus.highlightMoveVelocity
159 menus.highlightMoveDuration = 0
160 menus.highlightMoveVelocity = 100000
162 menus.currentIndex = modelIndex
163 content.overviewActive = false
165 menus.highlightMoveDuration = storedDuration
166 menus.highlightMoveVelocity = storedVelocity
168 content.menuSelected(modelIndex)
176 property alias title: pageHeader.text
178 color: backgroundColor
179 opacity: pageHeader.opacity
184 height: childrenRect.height
192 text: content.overviewActive ? i18n.tr("Device") : (indicatorsModel && menus.currentIndex >= 0 && menus.currentIndex < indicatorsModel.count) ? indicatorsModel.get(menus.currentIndex).title : ""
193 opacity: __shown ? 1 : 0
194 Behavior on opacity {NumberAnimation{duration: 100}}
199 id: contentReleaseTimer
201 interval: contentReleaseInterval
202 onTriggered: __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