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
30 property real indicatorAreaShowProgress: 1.0
32 opacity: fullscreenMode && indicators.fullyClosed ? 0.0 : 1.0
36 property real darkenedOpacity: 0.6
39 topMargin: panelHeight
45 opacity: indicators.unitProgress * darkenedOpacity
46 visible: !indicators.fullyClosed
50 onClicked: if (indicators.fullyOpened) indicators.hide();
56 objectName: "indicatorArea"
60 Behavior on anchors.topMargin {
61 NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
64 transform: Translate {
65 y: indicators.state === "initial"
66 ? (1.0 - indicatorAreaShowProgress) * -d.indicatorHeight
74 leftMargin: -units.gu(1)
75 bottomMargin: -units.gu(1)
77 visible: !indicators.fullyClosed
78 source: "graphics/rectangular_dropshadow.sci"
82 id: indicatorAreaBackground
83 color: callHint.visible ? "green" : "black"
89 height: indicators.minimizedPanelHeight
91 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
97 top: indicatorAreaBackground.bottom
99 right: indicators.left
101 saturation: 1 - indicators.unitProgress
103 // Don't let input event pass trough
104 MouseArea { anchors.fill: parent }
110 bottom: indicators.bottom
111 right: indicators.left
112 topMargin: indicatorArea.anchors.topMargin + indicators.minimizedPanelHeight
115 source: "graphics/VerticalDivider.png"
122 right: indicators.left
124 height: indicators.minimizedPanelHeight
125 onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
130 objectName: "indicators"
138 width: root.width - (PanelState.buttonsVisible ? windowControlButtons.width : 0)
139 minimizedPanelHeight: units.gu(3)
140 expandedPanelHeight: units.gu(7)
141 openedHeight: root.height - indicatorOrangeLine.height
144 if (callHint.visible) {
145 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
149 enableHint: !callHint.active && !fullscreenMode
150 showOnClick: !callHint.visible
151 panelColor: indicatorAreaBackground.color
154 if (callHint.active) {
155 callHint.showLiveCall();
160 anchors.bottomMargin: -indicatorOrangeLine.height
164 WindowControlButtons {
165 id: windowControlButtons
169 margins: units.gu(0.7)
171 height: indicators.minimizedPanelHeight - anchors.margins * 2
172 visible: PanelState.buttonsVisible
173 onClose: PanelState.close()
174 onMinimize: PanelState.minimize()
175 onMaximize: PanelState.maximize()
179 id: indicatorOrangeLine
181 top: indicators.bottom
182 left: indicators.left
183 right: indicators.right
191 left: PanelState.buttonsVisible ? windowControlButtons.right : parent.left
193 height: indicators.minimizedPanelHeight
194 visible: active && indicators.state == "initial"
200 objectName: "panelPriv"
201 readonly property real indicatorHeight: indicators.minimizedPanelHeight + indicatorOrangeLine.height
206 name: "onscreen" //fully opaque and visible at top edge of screen
207 when: !fullscreenMode
209 target: indicatorArea;
214 name: "offscreen" //pushed off screen
217 target: indicatorArea;
218 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0
221 target: indicators.showDragHandle;
222 anchors.bottomMargin: -units.gu(1)