Diffstat (limited to 'core/applets/batteryapplet/battery.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 3b329c6..f3a95ed 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp @@ -22,4 +22,5 @@ #include <qpe/power.h> +#include <qpe/applnk.h> #include <qpainter.h> @@ -32,5 +33,5 @@ BatteryMeter::BatteryMeter( QWidget *parent ) ps = new PowerStatus; startTimer( 10000 ); - setFixedHeight(12); + setFixedHeight( AppLnk::smallIconSize() ); chargeTimer = new QTimer( this ); connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); @@ -45,5 +46,5 @@ BatteryMeter::~BatteryMeter() QSize BatteryMeter::sizeHint() const { - return QSize(10,12); + return QSize(10, height() ); } @@ -117,10 +118,10 @@ void BatteryMeter::paintEvent( QPaintEvent* ) } - int w = 6; - int h = height()-3; + int w = height() / 2 ; + int h = height() - 4; int pix = (percent * h) / 100; - int y2 = height() - 2; + int y2 = height() -2; int y = y2 - pix; - int x1 = (width() - w) / 2; + int x1 = (width() - w ) / 2; p.setPen(QColor(80,80,80)); @@ -141,5 +142,5 @@ void BatteryMeter::paintEvent( QPaintEvent* ) DRAWUPPER(4); -#define DRAW(i) { if ( Y(i) < y2 ) p.drawLine(i+x1,Y(i)+1,i+x1,y2); } +#define DRAW(i) { if ( Y(i) < y2 ) p.drawLine(i+x1,Y(i)+1, i+x1,y2); } p.setPen( c ); DRAW(1); |