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/>.
18 import Ubuntu.Components 1.3
19 import Unity.Application 0.1
20 import "../Components"
21 import "../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
33 opacity: fullscreenMode && indicators.fullyClosed ? 0.0 : 1.0
37 property real darkenedOpacity: 0.6
40 topMargin: panelHeight
46 opacity: indicators.unitProgress * darkenedOpacity
47 visible: !indicators.fullyClosed
51 onClicked: if (indicators.fullyOpened) indicators.hide();
52 hoverEnabled: true // should also eat hover events, otherwise they will pass through
58 objectName: "indicatorArea"
62 Behavior on anchors.topMargin {
63 NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
66 transform: Translate {
67 y: indicators.state === "initial"
68 ? (1.0 - indicatorAreaShowProgress) * -d.indicatorHeight
76 leftMargin: -units.gu(1)
77 bottomMargin: -units.gu(1)
79 visible: !indicators.fullyClosed
80 source: "graphics/rectangular_dropshadow.sci"
84 id: indicatorAreaBackground
85 color: callHint.visible ? "green" : "black"
91 height: indicators.minimizedPanelHeight
93 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
99 top: indicatorAreaBackground.bottom
101 right: indicators.left
103 saturation: 1 - indicators.unitProgress
105 // Don't let input event pass trough
106 MouseArea { anchors.fill: parent }
112 bottom: indicators.bottom
113 right: indicators.left
114 topMargin: indicatorArea.anchors.topMargin + indicators.minimizedPanelHeight
117 source: "graphics/VerticalDivider.png"
124 right: indicators.left
126 height: indicators.minimizedPanelHeight
127 onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
132 objectName: "indicators"
140 width: root.width - (windowControlButtons.visible ? windowControlButtons.width : 0)
141 minimizedPanelHeight: units.gu(3)
142 expandedPanelHeight: units.gu(7)
143 openedHeight: root.height - indicatorOrangeLine.height
146 if (callHint.visible) {
147 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
151 enableHint: !callHint.active && !fullscreenMode
152 showOnClick: !callHint.visible
153 panelColor: indicatorAreaBackground.color
156 if (callHint.active) {
157 callHint.showLiveCall();
162 anchors.bottomMargin: -indicatorOrangeLine.height
166 WindowControlButtons {
167 id: windowControlButtons
168 objectName: "panelWindowControlButtons"
172 margins: units.gu(0.7)
174 height: indicators.minimizedPanelHeight - anchors.margins * 2
175 visible: PanelState.buttonsVisible && !root.locked
176 onClose: PanelState.close()
177 onMinimize: PanelState.minimize()
178 onMaximize: PanelState.maximize()
182 id: indicatorOrangeLine
184 top: indicators.bottom
185 left: indicators.left
186 right: indicators.right
194 left: windowControlButtons.visible ? windowControlButtons.right : parent.left
196 height: indicators.minimizedPanelHeight
197 visible: active && indicators.state == "initial"
203 objectName: "panelPriv"
204 readonly property real indicatorHeight: indicators.minimizedPanelHeight + indicatorOrangeLine.height
209 name: "onscreen" //fully opaque and visible at top edge of screen
210 when: !fullscreenMode
212 target: indicatorArea;
217 name: "offscreen" //pushed off screen
220 target: indicatorArea;
221 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0
224 target: indicators.showDragHandle;
225 anchors.bottomMargin: -units.gu(1)