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.1
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
33 property real darkenedOpacity: 0.6
36 topMargin: panelHeight
42 opacity: indicators.unitProgress * darkenedOpacity
46 enabled: indicators.shown
47 onClicked: if (indicators.fullyOpened) indicators.hide();
53 objectName: "indicatorArea"
57 Behavior on anchors.topMargin {
58 NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
65 leftMargin: -units.gu(1)
66 bottomMargin: -units.gu(1)
68 visible: !indicators.fullyClosed
69 source: "graphics/rectangular_dropshadow.sci"
73 id: indicatorAreaBackground
74 color: callHint.visible ? "green" : "black"
80 height: indicators.minimizedPanelHeight
82 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
88 top: indicatorAreaBackground.bottom
90 right: indicators.left
92 saturation: 1 - indicators.unitProgress
94 // Don't let input event pass trough
95 MouseArea { anchors.fill: parent }
101 bottom: indicators.bottom
102 right: indicators.left
103 topMargin: indicatorArea.anchors.topMargin + indicators.minimizedPanelHeight
106 source: "graphics/VerticalDivider.png"
113 right: indicators.left
115 height: indicators.minimizedPanelHeight
116 onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
121 objectName: "indicators"
129 width: root.width - (PanelState.buttonsVisible ? windowControlButtons.width : 0)
130 minimizedPanelHeight: units.gu(3)
131 expandedPanelHeight: units.gu(7)
132 openedHeight: root.height - indicatorOrangeLine.height
135 if (callHint.visible) {
136 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
140 enableHint: !callHint.active && !fullscreenMode
141 panelColor: indicatorAreaBackground.color
144 if (callHint.active) {
145 callHint.showLiveCall();
150 anchors.bottomMargin: -indicatorOrangeLine.height
154 WindowControlButtons {
155 id: windowControlButtons
159 margins: units.gu(0.7)
161 height: indicators.minimizedPanelHeight - anchors.margins * 2
162 visible: PanelState.buttonsVisible
163 onClose: PanelState.close()
164 onMinimize: PanelState.minimize()
165 onMaximize: PanelState.maximize()
169 id: indicatorOrangeLine
171 top: indicators.bottom
172 left: indicators.left
173 right: indicators.right
181 left: PanelState.buttonsVisible ? windowControlButtons.right : parent.left
183 height: indicators.minimizedPanelHeight
184 visible: active && indicators.state == "initial"
190 readonly property real indicatorHeight: indicators.minimizedPanelHeight + indicatorOrangeLine.height
195 name: "onscreen" //fully opaque and visible at top edge of screen
196 when: !fullscreenMode
198 target: indicatorArea;
203 name: "offscreen" //pushed off screen
206 target: indicatorArea;
207 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0
210 target: indicators.showDragHandle;
211 anchors.bottomMargin: -units.gu(1)