author | mickeyl <mickeyl> | 2003-05-14 20:41:15 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-14 20:41:15 (UTC) |
commit | e1141832179e39f5cebea277a9cfc001d4115cc0 (patch) (unidiff) | |
tree | 38248710325b220430cd89ce9d065a8aaa7f2085 | |
parent | edbf7ecf7686fcc30f1d622c17dc77d878201b90 (diff) | |
download | opie-e1141832179e39f5cebea277a9cfc001d4115cc0.zip opie-e1141832179e39f5cebea277a9cfc001d4115cc0.tar.gz opie-e1141832179e39f5cebea277a9cfc001d4115cc0.tar.bz2 |
bugfix for ipaqs with jacket
-rw-r--r-- | core/applets/batteryapplet/batterystatus.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp index a32a3a6..092a48d 100644 --- a/core/applets/batteryapplet/batterystatus.cpp +++ b/core/applets/batteryapplet/batterystatus.cpp | |||
@@ -195,61 +195,61 @@ void BatteryStatus::paintEvent( QPaintEvent * ) { | |||
195 | } | 195 | } |
196 | 196 | ||
197 | QColor c; | 197 | QColor c; |
198 | QColor darkc; | 198 | QColor darkc; |
199 | QColor lightc; | 199 | QColor lightc; |
200 | if ( ps->acStatus() == PowerStatus::Offline ) { | 200 | if ( ps->acStatus() == PowerStatus::Offline ) { |
201 | c = blue.light(120); | 201 | c = blue.light(120); |
202 | darkc = c.dark(280); | 202 | darkc = c.dark(280); |
203 | lightc = c.light(145); | 203 | lightc = c.light(145); |
204 | } else if ( ps->acStatus() == PowerStatus::Online ) { | 204 | } else if ( ps->acStatus() == PowerStatus::Online ) { |
205 | c = green.dark(130); | 205 | c = green.dark(130); |
206 | darkc = c.dark(200); | 206 | darkc = c.dark(200); |
207 | lightc = c.light(220); | 207 | lightc = c.light(220); |
208 | } else { | 208 | } else { |
209 | c = red; | 209 | c = red; |
210 | darkc = c.dark(280); | 210 | darkc = c.dark(280); |
211 | lightc = c.light(140); | 211 | lightc = c.light(140); |
212 | } | 212 | } |
213 | if ( percent < 0 ) | 213 | if ( percent < 0 ) |
214 | return; | 214 | return; |
215 | 215 | ||
216 | int rightEnd1 = screenWidth - 47; | 216 | int rightEnd1 = screenWidth - 47; |
217 | int rightEnd2 = screenWidth - 35; | 217 | int rightEnd2 = screenWidth - 35; |
218 | int percent2 = ( percent / 100.0 ) * rightEnd1 ; | 218 | int percent2 = ( percent / 100.0 ) * rightEnd1 ; |
219 | p.setPen( black ); | 219 | p.setPen( black ); |
220 | qDrawShadePanel( &p, 9, 30, rightEnd1 , 39, colorGroup(), TRUE, 1, NULL); | 220 | qDrawShadePanel( &p, 9, 30, rightEnd1 , 39, colorGroup(), TRUE, 1, NULL); |
221 | qDrawShadePanel( &p, rightEnd2, 37, 12, 24, colorGroup(), TRUE, 1, NULL); | 221 | qDrawShadePanel( &p, rightEnd2, 37, 12, 24, colorGroup(), TRUE, 1, NULL); |
222 | drawSegment( &p, QRect( 10, 30, percent2, 40 ), lightc, darkc, lightc.light(115), 6 ); | 222 | drawSegment( &p, QRect( 10, 30, percent2, 40 ), lightc, darkc, lightc.light(115), 6 ); |
223 | drawSegment( &p, QRect( 11 + percent2, 30, rightEnd1 - percent2, 40 ), white.light(80), black, white.light(90), 6 ); | 223 | drawSegment( &p, QRect( 11 + percent2, 30, rightEnd1 - percent2, 40 ), white.light(80), black, white.light(90), 6 ); |
224 | drawSegment( &p, QRect( rightEnd2, 37, 10, 25 ), white.light(80), black, white.light(90), 2 ); | 224 | drawSegment( &p, QRect( rightEnd2, 37, 10, 25 ), white.light(80), black, white.light(90), 2 ); |
225 | p.setPen( black); | 225 | p.setPen( black); |
226 | 226 | ||
227 | 227 | ||
228 | if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) { | 228 | if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) { |
229 | 229 | ||
230 | p.drawText(15, 50, tr ("Ipaq " + ipaqChem)); | 230 | p.drawText(15, 50, tr ("Ipaq " + ipaqChem)); |
231 | 231 | ||
232 | QString jacketMsg; | 232 | QString jacketMsg; |
233 | if (bat2) { | 233 | if (bat2) { |
234 | p.setPen(black); | 234 | p.setPen(black); |
235 | p.drawText(10,220, tr("Percentage battery remaining: ") + perc2 + " " + jackStatus); | 235 | p.drawText(10,220, tr("Percentage battery remaining: ") + perc2 + " " + jackStatus); |
236 | p.drawText(10,240, tr("Battery time remaining: ") + sec2); | 236 | p.drawText(10,240, tr("Battery time remaining: ") + sec2); |
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 ) * 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 ); |
250 | p.setPen( black ); | 250 | p.setPen( black ); |
251 | p.drawText(15, 180, jacketMsg); | 251 | p.drawText(15, 180, jacketMsg); |
252 | } | 252 | } |
253 | 253 | ||
254 | } | 254 | } |
255 | 255 | ||