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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index e85a9da..fa95b2b 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -123,24 +123,26 @@ void BatteryMeter::chargeTimeout() {
123 123
124 repaint(FALSE); 124 repaint(FALSE);
125 if ( batteryView ) 125 if ( batteryView )
126 batteryView->updatePercent( percent ); 126 batteryView->updatePercent( percent );
127} 127}
128 128
129void BatteryMeter::paintEvent( QPaintEvent* ) { 129void BatteryMeter::paintEvent( QPaintEvent* ) {
130 130
131 if ( style == 1 ) { 131 if ( style == 1 ) {
132 QPainter p(this); 132 QPainter p(this);
133 QFont f( "Fixed", AppLnk::smallIconSize()/2 ); 133 QFont f( "Fixed", AppLnk::smallIconSize()/2 );
134 QFontMetrics fm( f ); 134 QFontMetrics fm( f );
135 //Avoid text overlapping
136 p.eraseRect( 0, 0, 20, 20 );
135 p.setFont( f ); 137 p.setFont( f );
136 p.drawText( 0, height()/2, QString::number( percent ) ); 138 p.drawText( 0, height()/2, QString::number( percent ) );
137 p.drawText( width()/4, height(), "%" ); 139 p.drawText( width()/4, height(), "%" );
138 return; 140 return;
139 } 141 }
140 142
141 QPainter p(this); 143 QPainter p(this);
142 QColor color; 144 QColor color;
143 QColor g = gray.light( 160 ); 145 QColor g = gray.light( 160 );
144 switch ( ps->acStatus() ) { 146 switch ( ps->acStatus() ) {
145 case PowerStatus::Offline: 147 case PowerStatus::Offline:
146 color = blue.light( 150 ); 148 color = blue.light( 150 );