summaryrefslogtreecommitdiff
path: root/core/applets/batteryapplet/battery.cpp
Unidiff
Diffstat (limited to 'core/applets/batteryapplet/battery.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 078ce8d..15eb762 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -35,5 +35,8 @@ BatteryMeter::BatteryMeter( QWidget *parent )
35 ps = new PowerStatus; 35 ps = new PowerStatus;
36 startTimer( 10000 ); 36 startTimer( 10000 );
37
38 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) );
37 setFixedHeight( AppLnk::smallIconSize() ); 39 setFixedHeight( AppLnk::smallIconSize() );
40
38 chargeTimer = new QTimer( this ); 41 chargeTimer = new QTimer( this );
39 connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); 42 connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) );
@@ -52,5 +55,5 @@ BatteryMeter::~BatteryMeter()
52QSize BatteryMeter::sizeHint() const 55QSize BatteryMeter::sizeHint() const
53{ 56{
54 return QSize(10, height() ); 57 return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() );
55} 58}
56 59
@@ -117,4 +120,5 @@ void BatteryMeter::chargeTimeout()
117void BatteryMeter::paintEvent( QPaintEvent* ) 120void BatteryMeter::paintEvent( QPaintEvent* )
118{ 121{
122 qWarning("paint");
119 if ( style == 1 ) 123 if ( style == 1 )
120 { 124 {
@@ -123,6 +127,6 @@ void BatteryMeter::paintEvent( QPaintEvent* )
123 QFontMetrics fm( f ); 127 QFontMetrics fm( f );
124 p.setFont( f ); 128 p.setFont( f );
125 p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); 129 p.drawText( 0, height()/2, QString::number( percent ) );
126 p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); 130 p.drawText( width()/4, height(), "%" );
127 return; 131 return;
128 } 132 }