author | kergoth <kergoth> | 2003-08-09 17:29:36 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:29:36 (UTC) |
commit | a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93 (patch) (side-by-side diff) | |
tree | 5ce78e1a5dedd31b7851d53bf9f072bd44edd1b0 /core/applets/batteryapplet | |
parent | a7e015198a8c5ad3b6e144a9032b059086253e00 (diff) | |
download | opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.zip opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.gz opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 14 | ||||
-rw-r--r-- | core/applets/batteryapplet/batterystatus.cpp | 2 |
2 files changed, 3 insertions, 13 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 480d261..078ce8d 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp @@ -109,44 +109,34 @@ void BatteryMeter::chargeTimeout() if ( percent > 100 ) percent = 0; repaint(FALSE); if ( batteryView ) batteryView->updatePercent( percent ); } void BatteryMeter::paintEvent( QPaintEvent* ) { if ( style == 1 ) { QPainter p(this); QFont f( "Fixed", AppLnk::smallIconSize()/2 ); QFontMetrics fm( f ); p.setFont( f ); - if ( percent > 98 ) { - p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) ); - } - else if ( percent < 5 ) - { - p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) ); - } - else - { - p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); - p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); - } + p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); + p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); return; } QPainter p(this); QColor color; QColor g = gray.light( 160 ); switch ( ps->acStatus() ) { case PowerStatus::Offline: color = blue.light( 150 ); break; case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; default: color = red.light( 160 ); } int w = height() / 2; if ( !(w%2) ) w--; // should have an odd value to get a real middle line int h = height() - 4; diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp index 092a48d..5936b5d 100644 --- a/core/applets/batteryapplet/batterystatus.cpp +++ b/core/applets/batteryapplet/batterystatus.cpp @@ -227,29 +227,29 @@ void BatteryStatus::paintEvent( QPaintEvent * ) { if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) { p.drawText(15, 50, tr ("Ipaq " + ipaqChem)); QString jacketMsg; if (bat2) { p.setPen(black); p.drawText(10,220, tr("Percentage battery remaining: ") + perc2 + " " + jackStatus); p.drawText(10,240, tr("Battery time remaining: ") + sec2); jacketMsg = tr("Jacket " + jackChem); } else { jackPercent = 0; jacketMsg = tr("No jacket with battery inserted"); } - int jackPerc = ( jackPercent / 100.0 ) * screenWidth - 47; + int jackPerc = ( jackPercent / 100.0 ) * ( screenWidth - 47 ) ; qDrawShadePanel( &p, 9, 160, rightEnd1, 39, colorGroup(), TRUE, 1, NULL); qDrawShadePanel( &p, rightEnd2, 167, 12, 24, colorGroup(), TRUE, 1, NULL); drawSegment( &p, QRect( 10, 160, jackPerc, 40 ), lightc, darkc, lightc.light(115), 6 ); drawSegment( &p, QRect( 11 + jackPerc, 160, rightEnd1 - jackPerc, 40 ), white.light(80), black, white.light(90), 6 ); drawSegment( &p, QRect( rightEnd2, 167, 10, 25 ), white.light(80), black, white.light(90), 2 ); p.setPen( black ); p.drawText(15, 180, jacketMsg); } } |