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"
22import "../Components/TouchControlsState"
27 readonly property real panelHeight: indicatorArea.y + d.indicatorHeight
28 property alias indicators: __indicators
29 property alias callHint: __callHint
30 property bool fullscreenMode: false
31 property real indicatorAreaShowProgress: 1.0
32 property bool locked: false
36 property real darkenedOpacity: 0.6
39 topMargin: panelHeight
42 opacity: indicators.unitProgress * darkenedOpacity
43 visible: !indicators.fullyClosed
47 onClicked: if (indicators.fullyOpened) indicators.hide();
48 hoverEnabled: true // should also eat hover events, otherwise they will pass through
54 property: "panelHeight"
55 value: indicators.minimizedPanelHeight
60 objectName: "indicatorArea"
64 transform: Translate {
65 y: indicators.state === "initial"
66 ? (1.0 - indicatorAreaShowProgress) * -d.indicatorHeight
71 id: indicatorsDropShadow
74 leftMargin: -units.gu(1)
75 bottomMargin: -units.gu(1)
77 visible: !indicators.fullyClosed
78 source: "graphics/rectangular_dropshadow.sci"
84 fill: indicatorAreaBackground
85 bottomMargin: -units.gu(1)
87 visible: PanelState.dropShadow && !callHint.visible
88 source: "graphics/rectangular_dropshadow.sci"
92 id: indicatorAreaBackground
93 color: callHint.visible ? UbuntuColors.green : theme.palette.normal.background
99 height: indicators.minimizedPanelHeight
101 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
108 right: indicators.left
110 height: indicators.minimizedPanelHeight
112 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
113 onDoubleClicked: PanelState.restoreClicked()
115 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
116 // cf. https://bugreports.qt.io/browse/QTBUG-32909
117 WindowControlButtons {
118 id: windowControlButtons
119 objectName: "panelWindowControlButtons"
123 leftMargin: units.gu(1)
124 topMargin: units.gu(0.5)
125 bottomMargin: units.gu(0.5)
127 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
129 visible: ((PanelState.buttonsVisible && parent.containsMouse) || TouchControlsState.buttonsShownInPanel)
130 && !root.locked && !callHint.visible
131 active: PanelState.buttonsVisible || TouchControlsState.buttonsShownInPanel
132 windowIsMaximized: true
133 onCloseClicked: PanelState.closeClicked()
134 onMinimizeClicked: PanelState.minimizeClicked()
135 onMaximizeClicked: PanelState.restoreClicked()
136 closeButtonShown: PanelState.closeButtonShown
142 objectName: "indicators"
150 width: root.width - (windowControlButtons.visible ? windowControlButtons.width + titleLabel.width : 0)
151 minimizedPanelHeight: units.gu(3)
152 expandedPanelHeight: units.gu(7)
153 openedHeight: root.height
156 if (callHint.visible) {
157 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
161 enableHint: !callHint.active && !fullscreenMode
162 showOnClick: !callHint.visible
163 panelColor: indicatorAreaBackground.color
166 if (callHint.active) {
167 callHint.showLiveCall();
174 objectName: "windowDecorationTitle"
177 right: __indicators.left
179 leftMargin: units.gu(1)
180 rightMargin: units.gu(1)
181 topMargin: units.gu(0.5)
182 bottomMargin: units.gu(0.5)
185 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
186 visible: !windowControlButtons.visible && !root.locked && !callHint.visible
187 verticalAlignment: Text.AlignVCenter
189 font.weight: PanelState.buttonsVisible ? Font.Light : Font.Medium
190 text: PanelState.title
191 elide: Text.ElideRight
195 // TODO here would the Locally integrated menus come
203 height: indicators.minimizedPanelHeight
204 visible: active && indicators.state == "initial"
210 objectName: "panelPriv"
211 readonly property real indicatorHeight: indicators.minimizedPanelHeight
216 name: "onscreen" //fully opaque and visible at top edge of screen
217 when: !fullscreenMode
219 target: indicatorArea;
225 name: "offscreen" //pushed off screen
228 target: indicatorArea;
229 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0
230 opacity: indicators.fullyClosed ? 0.0 : 1.0
233 target: indicators.showDragHandle;
234 anchors.bottomMargin: -units.gu(1)
242 UbuntuNumberAnimation { target: indicatorArea; properties: "anchors.topMargin,opacity" }
246 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