2 * Copyright (C) 2013-2015 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 1.3
19import Unity.Application 0.1
21import "../Components/PanelState"
26 readonly property real panelHeight: indicatorArea.y + d.indicatorHeight
27 property alias indicators: __indicators
28 property alias callHint: __callHint
29 property bool fullscreenMode: false
30 property real indicatorAreaShowProgress: 1.0
31 property bool locked: false
35 property real darkenedOpacity: 0.6
38 topMargin: panelHeight
41 opacity: indicators.unitProgress * darkenedOpacity
42 visible: !indicators.fullyClosed
46 onClicked: if (indicators.fullyOpened) indicators.hide();
47 hoverEnabled: true // should also eat hover events, otherwise they will pass through
53 property: "panelHeight"
54 value: indicators.minimizedPanelHeight
59 objectName: "indicatorArea"
63 transform: Translate {
64 y: indicators.state === "initial"
65 ? (1.0 - indicatorAreaShowProgress) * -d.indicatorHeight
70 id: indicatorsDropShadow
73 leftMargin: -units.gu(1)
74 bottomMargin: -units.gu(1)
76 visible: !indicators.fullyClosed
77 source: "graphics/rectangular_dropshadow.sci"
83 fill: indicatorAreaBackground
84 bottomMargin: -units.gu(1)
86 visible: PanelState.dropShadow && !callHint.visible
87 source: "graphics/rectangular_dropshadow.sci"
91 id: indicatorAreaBackground
92 color: callHint.visible ? UbuntuColors.green : theme.palette.normal.background
98 height: indicators.minimizedPanelHeight
100 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
107 right: indicators.left
109 height: indicators.minimizedPanelHeight
111 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
112 onDoubleClicked: PanelState.maximize()
114 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
115 // cf. https://bugreports.qt.io/browse/QTBUG-32909
116 WindowControlButtons {
117 id: windowControlButtons
118 objectName: "panelWindowControlButtons"
122 leftMargin: units.gu(1)
123 topMargin: units.gu(0.5)
124 bottomMargin: units.gu(0.5)
126 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
127 visible: PanelState.buttonsVisible && parent.containsMouse && !root.locked && !callHint.visible
128 active: PanelState.buttonsVisible
129 closeButtonShown: PanelState.closeButtonShown
130 onClose: PanelState.close()
131 onMinimize: PanelState.minimize()
132 onMaximize: PanelState.maximize()
138 objectName: "indicators"
146 width: root.width - (windowControlButtons.visible ? windowControlButtons.width + titleLabel.width : 0)
147 minimizedPanelHeight: units.gu(3)
148 expandedPanelHeight: units.gu(7)
149 openedHeight: root.height
152 if (callHint.visible) {
153 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
157 enableHint: !callHint.active && !fullscreenMode
158 showOnClick: !callHint.visible
159 panelColor: indicatorAreaBackground.color
162 if (callHint.active) {
163 callHint.showLiveCall();
170 objectName: "windowDecorationTitle"
173 right: __indicators.left
175 leftMargin: units.gu(1)
176 rightMargin: units.gu(1)
177 topMargin: units.gu(0.5)
178 bottomMargin: units.gu(0.5)
181 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
182 visible: !windowControlButtons.visible && !root.locked && !callHint.visible
183 verticalAlignment: Text.AlignVCenter
185 font.weight: PanelState.buttonsVisible ? Font.Light : Font.Medium
186 text: PanelState.title
187 elide: Text.ElideRight
191 // TODO here would the Locally integrated menus come
199 height: indicators.minimizedPanelHeight
200 visible: active && indicators.state == "initial"
206 objectName: "panelPriv"
207 readonly property real indicatorHeight: indicators.minimizedPanelHeight
212 name: "onscreen" //fully opaque and visible at top edge of screen
213 when: !fullscreenMode
215 target: indicatorArea;
221 name: "offscreen" //pushed off screen
224 target: indicatorArea;
225 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0
226 opacity: indicators.fullyClosed ? 0.0 : 1.0
229 target: indicators.showDragHandle;
230 anchors.bottomMargin: -units.gu(1)
238 UbuntuNumberAnimation { target: indicatorArea; properties: "anchors.topMargin,opacity" }
242 UbuntuNumberAnimation { target: indicatorArea; properties: "anchors.topMargin,opacity" }
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