1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the Qt Components project.
9 ** $QT_BEGIN_LICENSE:BSD$
10 ** You may use this file under the terms of the BSD license as follows:
12 ** "Redistribution and use in source and binary forms, with or without
13 ** modification, are permitted provided that the following conditions are
15 ** * Redistributions of source code must retain the above copyright
16 ** notice, this list of conditions and the following disclaimer.
17 ** * Redistributions in binary form must reproduce the above copyright
18 ** notice, this list of conditions and the following disclaimer in
19 ** the documentation and/or other materials provided with the
21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
22 ** the names of its contributors may be used to endorse or promote
23 ** products derived from this software without specific prior written
26 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
39 ****************************************************************************/
47 // implicitWidth: screen.width
48 // implicitHeight: privateStyle.statusBarHeight
49 property bool platformInverted: false
55 // property bool clickedOpensStatusPanel: android.s60Version == Android.SV_S60_5_2 ? true : false
56 // property int contentHeight: Math.round(privateStyle.statusBarHeight * 18 / 26)
57 // property int paddingSmallOneQuarter: Math.round(platformStyle.paddingSmall / 4)
58 // property int paddingSmallThreeQuarters: Math.round(platformStyle.paddingSmall * 3 / 4)
60 // function signalWidthPercentage(signalStrength) {
61 // if (signalStrength < 10)
63 // else if (signalStrength < 20)
65 // else if (signalStrength < 30)
67 // else if (signalStrength < 60)
69 // else if (signalStrength < 100)
78 // anchors.fill: parent
81 // if (priv.clickedOpensStatusPanel) {
82 // privateStyle.play(Android.PopUp)
83 // platformPopupManager.privateShowIndicatorPopup()
87 // if (!priv.clickedOpensStatusPanel) {
88 // privateStyle.play(Android.PopUp)
89 // platformPopupManager.privateShowIndicatorPopup()
90 // // reset MouseArea state since status panel window eats the release event
91 // android.privateSendMouseRelease(mouseArea)
97 // source: privateStyle.imagePath("qtg_fr_statusbar", root.platformInverted)
98 // anchors.fill: parent
99 // width: parent.width
101 // UniversalIndicators {
102 // height: indicatorHeight
104 // right: networkMode.left
105 // rightMargin: priv.paddingSmallOneQuarter
106 // verticalCenter: parent.verticalCenter
109 // width: priv.paddingSmallOneQuarter * 2 + 3 * indicatorWidth
111 // indicatorColor: root.platformInverted ? platformStyle.colorNormalDarkInverted
112 // : platformStyle.colorNormalLight
113 // indicatorWidth: priv.contentHeight // same as height
114 // indicatorHeight: priv.contentHeight
115 // indicatorPadding: priv.paddingSmallOneQuarter
116 // maxIndicatorCount: 3
119 // // icon for network signal type e.g. 3G, GPRS etc
120 // NetworkIndicator {
122 // height: priv.contentHeight
123 // width: priv.contentHeight // same as height
124 // anchors.verticalCenter: parent.verticalCenter
125 // anchors.right: offline ? batteryBackground.left : signalBackground.left
126 // anchors.rightMargin: priv.paddingSmallThreeQuarters
127 // color: root.platformInverted ? platformStyle.colorNormalDarkInverted
128 // : platformStyle.colorNormalLight
130 // // signal strength
132 // id: signalBackground
133 // visible: !networkMode.offline
134 // sourceSize.height: priv.contentHeight
135 // sourceSize.width: Math.round(privateStyle.statusBarHeight * 19 / 26)
136 // anchors.verticalCenter: parent.verticalCenter
137 // anchors.right: batteryBackground.left
138 // anchors.rightMargin: priv.paddingSmallThreeQuarters
139 // fillMode: Image.PreserveAspectFit
140 // source: privateStyle.imagePath("qtg_graf_signal_level_bg", root.platformInverted)
142 // id: signalLevelItem
143 // anchors.left: parent.left
144 // anchors.top: parent.top
145 // height: parent.height
146 // width: priv.signalWidthPercentage(privateNetworkInfo.networkSignalStrength) * parent.width
148 // LayoutMirroring.enabled: false
151 // sourceSize.width: signalBackground.sourceSize.width
152 // sourceSize.height: signalBackground.sourceSize.height
153 // fillMode: Image.PreserveAspectFit
154 // source: privateStyle.imagePath("qtg_graf_signal_level_full", root.platformInverted)
158 // // battery indicator
160 // id: batteryBackground
161 // anchors.verticalCenter: parent.verticalCenter
162 // anchors.right: timeItem.left
163 // anchors.rightMargin: priv.paddingSmallThreeQuarters
164 // sourceSize.height: priv.contentHeight
165 // sourceSize.width: Math.round(privateStyle.statusBarHeight * 24 / 26)
166 // fillMode: Image.PreserveAspectFit
167 // source: privateStyle.imagePath((privateBatteryInfo.powerSaveModeEnabled ?
168 // "qtg_graf_battery_level_psm_bg" :
169 // "qtg_graf_battery_level_bg"), root.platformInverted)
174 // property int animatedLevel
176 // anchors.left: parent.left
177 // anchors.top: parent.top
178 // width: Math.round(privateStyle.statusBarHeight
179 // * ((privateBatteryInfo.charging ? Math.floor(animatedLevel / 100) :
180 // privateBatteryInfo.batteryLevel) + 2) / 13)
181 // height: parent.height
183 // LayoutMirroring.enabled: false
186 // sourceSize.width: batteryBackground.sourceSize.width
187 // sourceSize.height: batteryBackground.sourceSize.height
189 // fillMode: Image.PreserveAspectFit
191 // // Battery state mappings: Levels 0 and 1 are low, 2-4 are medium, 5-7 are full.
192 // // Currently all levels use same graphics with white color.
194 // source: privateStyle.imagePath((privateBatteryInfo.powerSaveModeEnabled ?
195 // "qtg_graf_battery_level_psm_full" :
196 // "qtg_graf_battery_level_full"), root.platformInverted)
201 // // power save mode indicator
202 // anchors.fill: parent
203 // sourceSize.width: parent.sourceSize.width
204 // sourceSize.height: parent.sourceSize.height
205 // source: privateStyle.imagePath("qtg_graf_battery_psm")
206 // visible: privateBatteryInfo.powerSaveModeEnabled
210 // id: batteryChargingAnimation
211 // loops: Animation.Infinite
212 // running: privateBatteryInfo.charging
213 // target: batteryLevel
214 // property: "animatedLevel"
215 // // Use bigger range (compared to 0-7) in order to make the animation smoother.
224 // width: Math.round(privateStyle.statusBarHeight * 44 / 26)
225 // color: root.platformInverted ? platformStyle.colorNormalDarkInverted
226 // : platformStyle.colorNormalLight
227 // anchors.verticalCenter: parent.verticalCenter
228 // anchors.right: parent.right
229 // anchors.rightMargin: platformStyle.paddingSmall
230 // horizontalAlignment: Text.AlignRight
231 // text: android.currentTime
233 // family: platformStyle.fontFamilyRegular;
234 // pixelSize: priv.contentHeight
235 // weight: Font.Light