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:
parent
071898e3e6
commit
2e638cf8d5
1 changed files with 30 additions and 30 deletions
|
@ -153,46 +153,46 @@ void statusbar_icon_battery(int percent, bool charging)
|
|||
{
|
||||
int i;
|
||||
int fill;
|
||||
char buffer[5];
|
||||
char buffer[5];
|
||||
unsigned int width, height;
|
||||
|
||||
/* fill battery */
|
||||
fill=percent;
|
||||
if (fill < 0)
|
||||
fill = 0;
|
||||
if (fill > 100)
|
||||
fill = 100;
|
||||
/* fill battery */
|
||||
fill=percent;
|
||||
if (fill < 0)
|
||||
fill = 0;
|
||||
if (fill > 100)
|
||||
fill = 100;
|
||||
|
||||
#ifdef SIMULATOR
|
||||
if (global_settings.battery_type) {
|
||||
if (global_settings.battery_type) {
|
||||
#else
|
||||
#ifdef HAVE_CHARGE_CTRL /* Recorder */
|
||||
/* 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 */
|
||||
if (global_settings.battery_type) {
|
||||
if (global_settings.battery_type) {
|
||||
#endif /* HAVE_CHARGE_CTRL */
|
||||
#endif
|
||||
/* Numeric display */
|
||||
snprintf(buffer, sizeof(buffer), "%3d", percent);
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
lcd_getstringsize(buffer, &width, &height);
|
||||
if (height <= STATUSBAR_HEIGHT)
|
||||
lcd_putsxy(ICON_BATTERY_X_POS + ICON_BATTERY_WIDTH / 2 -
|
||||
width/2, STATUSBAR_Y_POS, buffer);
|
||||
lcd_setfont(FONT_UI);
|
||||
/* Numeric display */
|
||||
snprintf(buffer, sizeof(buffer), "%3d", percent);
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
lcd_getstringsize(buffer, &width, &height);
|
||||
if (height <= STATUSBAR_HEIGHT)
|
||||
lcd_putsxy(ICON_BATTERY_X_POS + ICON_BATTERY_WIDTH / 2 -
|
||||
width/2, STATUSBAR_Y_POS, buffer);
|
||||
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 */
|
||||
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;
|
||||
|
||||
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 */
|
||||
if (charging)
|
||||
|
@ -234,9 +234,9 @@ void statusbar_icon_volume(int percent)
|
|||
}
|
||||
|
||||
/* display volume level numerical? */
|
||||
if (global_settings.volume_type ||
|
||||
TIME_BEFORE(current_tick,switch_tick))
|
||||
{
|
||||
if (global_settings.volume_type ||
|
||||
TIME_BEFORE(current_tick,switch_tick))
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "%2d", percent);
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
lcd_getstringsize(buffer, &width, &height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue