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: 20000
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) {
98 visible: content.__shown
100 // Reset the indicator states
101 if (!visible && item) {
108 if (status == Loader.Ready) {
109 for(var pName in indicatorProperties) {
110 if (item.hasOwnProperty(pName)) {
111 item[pName] = indicatorProperties[pName]
114 if (contentActive && menus.visible) {
120 // FIXME: QTBUG-30632 - asynchronous loader crashes when changing index quickly.
121 Component.onDestruction: {
125 // Need to use a binding because the handle height changes.
126 // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin
129 property: "anchors.bottomMargin"
134 Behavior on opacity { NumberAnimation {duration: 200} }
139 objectName: "overview"
141 anchors.top: header.bottom
142 anchors.bottom: parent.bottom
143 // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin
144 anchors.bottomMargin: handle.height
147 indicatorsModel: content.indicatorsModel
148 enabled: content.overviewActive && content.__shown
149 opacity: content.overviewActive && content.__shown ? 1 : 0
150 Behavior on opacity {NumberAnimation{duration: 200}}
151 visible: opacity != 0
154 var storedDuration = menus.highlightMoveDuration
155 var storedVelocity = menus.highlightMoveVelocity
156 menus.highlightMoveDuration = 0
157 menus.highlightMoveVelocity = 100000
159 menus.currentIndex = modelIndex
160 content.overviewActive = false
162 menus.highlightMoveDuration = storedDuration
163 menus.highlightMoveVelocity = storedVelocity
165 content.menuSelected(modelIndex)
173 property alias title: pageHeader.text
175 color: backgroundColor
176 opacity: pageHeader.opacity
181 height: childrenRect.height
189 text: content.overviewActive ? i18n.tr("Device") : (indicatorsModel && menus.currentIndex >= 0 && menus.currentIndex < indicatorsModel.count) ? indicatorsModel.get(menus.currentIndex).title : ""
190 opacity: __shown ? 1 : 0
191 Behavior on opacity {NumberAnimation{duration: 100}}
196 id: contentReleaseTimer
198 interval: contentReleaseInterval
199 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