summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 15eb762..4adcab4 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -81,25 +81,25 @@ void BatteryMeter::mouseReleaseEvent( QMouseEvent* e)
batteryView->show();
}
}
void BatteryMeter::timerEvent( QTimerEvent * )
{
PowerStatus prev = *ps;
*ps = PowerStatusManager::readStatus();
if ( prev != *ps ) {
percent = ps->batteryPercentRemaining();
- if ( !charging && ps->batteryStatus() == PowerStatus::Charging && percent < 0 ) {
+ if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) {
percent = 0;
charging = true;
chargeTimer->start( 500 );
} else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) {
charging = false;
chargeTimer->stop();
if ( batteryView )
batteryView->updatePercent( percent );
}
repaint( style != 0 );
if ( batteryView )
batteryView->repaint();
@@ -110,25 +110,25 @@ void BatteryMeter::chargeTimeout()
{
percent += 20;
if ( percent > 100 )
percent = 0;
repaint(FALSE);
if ( batteryView )
batteryView->updatePercent( percent );
}
void BatteryMeter::paintEvent( QPaintEvent* )
{
- qWarning("paint");
+
if ( style == 1 )
{
QPainter p(this);
QFont f( "Fixed", AppLnk::smallIconSize()/2 );
QFontMetrics fm( f );
p.setFont( f );
p.drawText( 0, height()/2, QString::number( percent ) );
p.drawText( width()/4, height(), "%" );
return;
}
QPainter p(this);