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
26 property QtObject indicatorsModel: null
27 property bool animate: true // FIXME: Remove. This doesnt seem to be being used and it's referenced in Indicators.
28 property bool overviewActive: true // "state of the menu"
29 property bool __shown: false
30 property bool __contentActive: false
31 property alias currentIndex : menus.currentIndex
32 property color backgroundColor: "#221e1c"
33 property int contentReleaseInterval: 20000
37 color: backgroundColor
40 signal menuSelected(int index)
44 overviewActive = false
47 function showOverview() {
56 function activateContent() {
57 contentReleaseTimer.stop()
58 __contentActive = true
61 function releaseContent() {
63 contentReleaseTimer.restart()
70 anchors.bottom: parent.bottom
71 anchors.top: header.bottom
74 spacing: units.gu(0.5)
75 opacity: !overviewActive && __shown ? 1 : 0
77 orientation: ListView.Horizontal
78 model: indicatorsModel
80 //FIXME: This will make sure that all plugins still alive
81 //check bug https://bugs.launchpad.net/manhattan/+bug/1088945 for more details
82 cacheBuffer: 2147483647
86 property bool contentActive: content.__contentActive
88 onContentActiveChanged: {
89 if (contentActive && item) {
91 } else if (!contentActive && item) {
99 visible: content.__shown
101 // Reset the indicator states
102 if (!visible && item) {
109 for(var pName in indicatorProperties) {
110 if (item.hasOwnProperty(pName)) {
111 item[pName] = indicatorProperties[pName]
114 if (contentActive && menus.visible) {
119 // Need to use a binding because the handle height changes.
120 // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin
123 property: "anchors.bottomMargin"
128 Behavior on opacity { NumberAnimation {duration: 200} }
133 objectName: "overview"
135 anchors.top: header.bottom
136 anchors.bottom: parent.bottom
137 // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin
138 anchors.bottomMargin: handle.height
141 indicatorsModel: content.indicatorsModel
142 enabled: content.overviewActive && content.__shown
143 opacity: content.overviewActive && content.__shown ? 1 : 0
144 Behavior on opacity {NumberAnimation{duration: 200}}
145 visible: opacity != 0
148 var storedDuration = menus.highlightMoveDuration
149 var storedVelocity = menus.highlightMoveVelocity
150 menus.highlightMoveDuration = 0
151 menus.highlightMoveVelocity = 100000
153 menus.currentIndex = modelIndex
154 content.overviewActive = false
156 menus.highlightMoveDuration = storedDuration
157 menus.highlightMoveVelocity = storedVelocity
159 content.menuSelected(modelIndex)
167 property alias title: pageHeader.text
169 color: backgroundColor
170 opacity: pageHeader.opacity
175 height: childrenRect.height
184 if (content.overviewActive)
185 return i18n.tr("Device");
186 if (indicatorsModel && menus.currentIndex >= 0 && menus.currentIndex < indicatorsModel.count)
187 return indicatorsModel.data(menus.currentIndex, Indicators.IndicatorsModelRole.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