2 * Copyright (C) 2013-2014 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"
25 readonly property real panelHeight: indicatorArea.y + d.indicatorHeight
26 property alias indicators: __indicators
27 property alias callHint: __callHint
28 property bool fullscreenMode: false
32 property real darkenedOpacity: 0.6
35 topMargin: panelHeight
41 opacity: indicators.unitProgress * darkenedOpacity
45 enabled: indicators.shown
46 onClicked: if (indicators.fullyOpened) indicators.hide();
52 objectName: "indicatorArea"
56 Behavior on anchors.topMargin {
57 NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
64 leftMargin: -units.gu(1)
65 bottomMargin: -units.gu(1)
67 visible: !indicators.fullyClosed
68 source: "graphics/rectangular_dropshadow.sci"
72 id: indicatorAreaBackground
73 color: callHint.visible ? "green" : "black"
79 height: indicators.minimizedPanelHeight
81 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
87 top: indicatorAreaBackground.bottom
89 right: indicators.left
91 saturation: 1 - indicators.unitProgress
97 bottom: indicators.bottom
98 right: indicators.left
99 topMargin: indicatorArea.anchors.topMargin + indicators.minimizedPanelHeight
102 source: "graphics/VerticalDivider.png"
109 right: indicators.left
111 height: indicators.minimizedPanelHeight
112 enabled: callHint.visible
113 onClicked: callHint.showLiveCall()
118 objectName: "indicators"
127 minimizedPanelHeight: units.gu(3)
128 expandedPanelHeight: units.gu(7)
129 openedHeight: root.height - indicatorOrangeLine.height
132 if (callHint.visible) {
133 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
137 enableHint: !callHint.active && !fullscreenMode
138 panelColor: indicatorAreaBackground.color
141 if (callHint.active) {
142 callHint.showLiveCall();
147 anchors.bottomMargin: -indicatorOrangeLine.height
152 id: indicatorOrangeLine
154 top: indicators.bottom
155 left: indicators.left
156 right: indicators.right
166 height: indicators.minimizedPanelHeight
167 visible: active && indicators.state == "initial"
173 readonly property real indicatorHeight: indicators.minimizedPanelHeight + indicatorOrangeLine.height
178 name: "onscreen" //fully opaque and visible at top edge of screen
179 when: !fullscreenMode
181 target: indicatorArea;
186 name: "offscreen" //pushed off screen
189 target: indicatorArea;
190 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0
193 target: indicators.showDragHandle;
194 anchors.bottomMargin: -units.gu(1)