2 * Copyright (C) 2013 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 0.1
19 import Unity.Application 0.1
20 import "../Components"
21 import "../Components/ListItems"
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 { StandardAnimation {} }
62 leftMargin: -units.gu(1)
63 bottomMargin: -units.gu(1)
65 visible: indicators.height > indicators.panelHeight
66 source: "graphics/rectangular_dropshadow.sci"
73 bottom: indicators.bottom
74 right: indicators.left
76 topMargin: indicatorArea.anchors.topMargin + indicators.panelHeight
80 source: "graphics/VerticalDivider.png"
84 id: indicatorAreaBackground
85 color: callHint.visible ? "green" : "black"
91 height: indicators.panelHeight
93 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
97 id: nonIndicatorAreaSeparatorLine
99 top: indicatorAreaBackground.bottom
101 right: indicators.left
103 saturation: 1 - indicators.unitProgress
110 right: indicators.left
112 height: indicators.panelHeight
113 enabled: callHint.visible
114 onClicked: callHint.showLiveCall()
119 objectName: "indicators"
128 panelHeight: units.gu(3)
129 openedHeight: root.height
131 if (callHint.visible) {
132 return Math.max(root.width - (callHint.width + units.gu(2)), 0)
137 enableHint: !callHint.active && !fullscreenMode
138 showHintBottomMargin: fullscreenMode ? -panelHeight : 0
141 if (callHint.active) {
142 callHint.showLiveCall();
153 height: indicators.panelHeight
154 visible: active && indicators.state == "initial"
158 id: indicatorsSeparatorLine
161 top: indicators.bottom
162 left: indicatorDividor.left
163 right: indicators.right
170 readonly property real indicatorHeight: indicators.panelHeight + indicatorsSeparatorLine.height
175 name: "onscreen" //fully opaque and visible at top edge of screen
176 when: !fullscreenMode
178 target: indicatorArea;
183 name: "offscreen" //pushed off screen
186 target: indicatorArea;
187 anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0