1
0
Fork 0
forked from len0rd/rockbox

CP: no tabs, 4-level indent.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3381 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2003-03-04 15:20:51 +00:00
parent 071898e3e6
commit 2e638cf8d5

View file

@ -153,46 +153,46 @@ void statusbar_icon_battery(int percent, bool charging)
{ {
int i; int i;
int fill; int fill;
char buffer[5]; char buffer[5];
unsigned int width, height; unsigned int width, height;
/* fill battery */ /* fill battery */
fill=percent; fill=percent;
if (fill < 0) if (fill < 0)
fill = 0; fill = 0;
if (fill > 100) if (fill > 100)
fill = 100; fill = 100;
#ifdef SIMULATOR #ifdef SIMULATOR
if (global_settings.battery_type) { if (global_settings.battery_type) {
#else #else
#ifdef HAVE_CHARGE_CTRL /* Recorder */ #ifdef HAVE_CHARGE_CTRL /* Recorder */
/* show graphical animation when charging instead of numbers */ /* show graphical animation when charging instead of numbers */
if ((global_settings.battery_type) && (charge_state != 1)) { if ((global_settings.battery_type) && (charge_state != 1)) {
#else /* FM */ #else /* FM */
if (global_settings.battery_type) { if (global_settings.battery_type) {
#endif /* HAVE_CHARGE_CTRL */ #endif /* HAVE_CHARGE_CTRL */
#endif #endif
/* Numeric display */ /* Numeric display */
snprintf(buffer, sizeof(buffer), "%3d", percent); snprintf(buffer, sizeof(buffer), "%3d", percent);
lcd_setfont(FONT_SYSFIXED); lcd_setfont(FONT_SYSFIXED);
lcd_getstringsize(buffer, &width, &height); lcd_getstringsize(buffer, &width, &height);
if (height <= STATUSBAR_HEIGHT) if (height <= STATUSBAR_HEIGHT)
lcd_putsxy(ICON_BATTERY_X_POS + ICON_BATTERY_WIDTH / 2 - lcd_putsxy(ICON_BATTERY_X_POS + ICON_BATTERY_WIDTH / 2 -
width/2, STATUSBAR_Y_POS, buffer); width/2, STATUSBAR_Y_POS, buffer);
lcd_setfont(FONT_UI); lcd_setfont(FONT_UI);
} else { }
else {
/* draw battery */
lcd_drawrect(ICON_BATTERY_X_POS, STATUSBAR_Y_POS, 17, 7);
for (i=2; i < 5; i++)
lcd_drawpixel(ICON_BATTERY_X_POS + 17, STATUSBAR_Y_POS + i);
/* draw battery */ fill = fill * 15 / 100;
lcd_drawrect(ICON_BATTERY_X_POS, STATUSBAR_Y_POS, 17, 7);
for (i=2; i < 5; i++)
lcd_drawpixel(ICON_BATTERY_X_POS + 17, STATUSBAR_Y_POS + i);
fill = fill * 15 / 100; lcd_fillrect(ICON_BATTERY_X_POS + 1, STATUSBAR_Y_POS + 1, fill, 5);
}
lcd_fillrect(ICON_BATTERY_X_POS + 1, STATUSBAR_Y_POS + 1, fill, 5);
}
/* draw power plug if charging */ /* draw power plug if charging */
if (charging) if (charging)
@ -234,9 +234,9 @@ void statusbar_icon_volume(int percent)
} }
/* display volume level numerical? */ /* display volume level numerical? */
if (global_settings.volume_type || if (global_settings.volume_type ||
TIME_BEFORE(current_tick,switch_tick)) TIME_BEFORE(current_tick,switch_tick))
{ {
snprintf(buffer, sizeof(buffer), "%2d", percent); snprintf(buffer, sizeof(buffer), "%2d", percent);
lcd_setfont(FONT_SYSFIXED); lcd_setfont(FONT_SYSFIXED);
lcd_getstringsize(buffer, &width, &height); lcd_getstringsize(buffer, &width, &height);