summaryrefslogtreecommitdiff
path: root/core/applets/batteryapplet/battery.cpp
Unidiff
Diffstat (limited to 'core/applets/batteryapplet/battery.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 9a9ddf6..fed9b34 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -11,29 +11,32 @@
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "battery.h" 20#include "battery.h"
21#include "batterystatus.h" 21#include "batterystatus.h"
22 22
23/* OPIE */
24#include <opie2/otaskbarapplet.h>
23#include <qpe/applnk.h> 25#include <qpe/applnk.h>
24#include <qpe/config.h> 26#include <qpe/config.h>
25#include <qpe/power.h> 27#include <qpe/power.h>
26#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
27 29
30/* QT */
28#include <qpainter.h> 31#include <qpainter.h>
29#include <qtimer.h> 32#include <qtimer.h>
30 33
31 34
32BatteryMeter::BatteryMeter( QWidget *parent ) 35BatteryMeter::BatteryMeter( QWidget *parent )
33 : QWidget( parent ), charging(false) 36 : QWidget( parent ), charging(false)
34{ 37{
35 ps = new PowerStatus; 38 ps = new PowerStatus;
36 startTimer( 10000 ); 39 startTimer( 10000 );
37 40
38 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) ); 41 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) );
39 setFixedHeight( AppLnk::smallIconSize() ); 42 setFixedHeight( AppLnk::smallIconSize() );
@@ -159,12 +162,22 @@ void BatteryMeter::paintEvent( QPaintEvent* )
159 int middle = w/2; 162 int middle = w/2;
160 for ( int i = 0; i < middle; i++ ) 163 for ( int i = 0; i < middle; i++ )
161 { 164 {
162 p.setPen( gray.dark( 100+i*20 ) ); 165 p.setPen( gray.dark( 100+i*20 ) );
163 p.drawLine( x1+middle-i, 2, x1+middle-i, y-1 ); 166 p.drawLine( x1+middle-i, 2, x1+middle-i, y-1 );
164 p.drawLine( x1+middle+i, 2, x1+middle+i, y-1 ); 167 p.drawLine( x1+middle+i, 2, x1+middle+i, y-1 );
165 p.setPen( color.dark( 100+i*20 ) ); 168 p.setPen( color.dark( 100+i*20 ) );
166 p.drawLine( x1+middle-i, y, x1+middle-i, y2 ); 169 p.drawLine( x1+middle-i, y, x1+middle-i, y2 );
167 p.drawLine( x1+middle+i, y, x1+middle+i, y2 ); 170 p.drawLine( x1+middle+i, y, x1+middle+i, y2 );
168 } 171 }
169} 172}
170 173
174int BatteryMeter::position()
175{
176 return 8;
177}
178
179Q_EXPORT_INTERFACE()
180{
181 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<BatteryMeter> );
182}
183