summaryrefslogtreecommitdiff
path: root/core/applets/batteryapplet
authorkergoth <kergoth>2003-08-09 17:29:36 (UTC)
committer kergoth <kergoth>2003-08-09 17:29:36 (UTC)
commita0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93 (patch) (unidiff)
tree5ce78e1a5dedd31b7851d53bf9f072bd44edd1b0 /core/applets/batteryapplet
parenta7e015198a8c5ad3b6e144a9032b059086253e00 (diff)
downloadopie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.zip
opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.gz
opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'core/applets/batteryapplet') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp14
-rw-r--r--core/applets/batteryapplet/batterystatus.cpp2
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
@@ -119,24 +119,14 @@ void BatteryMeter::paintEvent( QPaintEvent* )
119 if ( style == 1 ) 119 if ( style == 1 )
120 { 120 {
121 QPainter p(this); 121 QPainter p(this);
122 QFont f( "Fixed", AppLnk::smallIconSize()/2 ); 122 QFont f( "Fixed", AppLnk::smallIconSize()/2 );
123 QFontMetrics fm( f ); 123 QFontMetrics fm( f );
124 p.setFont( f ); 124 p.setFont( f );
125 if ( percent > 98 ) { 125 p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
126 p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) ); 126 p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
127 }
128 else if ( percent < 5 )
129 {
130 p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) );
131 }
132 else
133 {
134 p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
135 p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
136 }
137 return; 127 return;
138 } 128 }
139 129
140 QPainter p(this); 130 QPainter p(this);
141 QColor color; 131 QColor color;
142 QColor g = gray.light( 160 ); 132 QColor g = gray.light( 160 );
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
@@ -237,13 +237,13 @@ void BatteryStatus::paintEvent( QPaintEvent * ) {
237 jacketMsg = tr("Jacket " + jackChem); 237 jacketMsg = tr("Jacket " + jackChem);
238 } else { 238 } else {
239 jackPercent = 0; 239 jackPercent = 0;
240 jacketMsg = tr("No jacket with battery inserted"); 240 jacketMsg = tr("No jacket with battery inserted");
241 } 241 }
242 242
243 int jackPerc = ( jackPercent / 100.0 ) * screenWidth - 47; 243 int jackPerc = ( jackPercent / 100.0 ) * ( screenWidth - 47 ) ;
244 244
245 qDrawShadePanel( &p, 9, 160, rightEnd1, 39, colorGroup(), TRUE, 1, NULL); 245 qDrawShadePanel( &p, 9, 160, rightEnd1, 39, colorGroup(), TRUE, 1, NULL);
246 qDrawShadePanel( &p, rightEnd2, 167, 12, 24, colorGroup(), TRUE, 1, NULL); 246 qDrawShadePanel( &p, rightEnd2, 167, 12, 24, colorGroup(), TRUE, 1, NULL);
247 drawSegment( &p, QRect( 10, 160, jackPerc, 40 ), lightc, darkc, lightc.light(115), 6 ); 247 drawSegment( &p, QRect( 10, 160, jackPerc, 40 ), lightc, darkc, lightc.light(115), 6 );
248 drawSegment( &p, QRect( 11 + jackPerc, 160, rightEnd1 - jackPerc, 40 ), white.light(80), black, white.light(90), 6 ); 248 drawSegment( &p, QRect( 11 + jackPerc, 160, rightEnd1 - jackPerc, 40 ), white.light(80), black, white.light(90), 6 );
249 drawSegment( &p, QRect( rightEnd2, 167, 10, 25 ), white.light(80), black, white.light(90), 2 ); 249 drawSegment( &p, QRect( rightEnd2, 167, 10, 25 ), white.light(80), black, white.light(90), 2 );