Make use of the fixed lcd_getstringsize() for prop fonts.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1835 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Markus Braun 2002-08-21 06:23:23 +00:00
parent bcbb8046f8
commit c7aaca4615
2 changed files with 15 additions and 18 deletions

View file

@ -237,7 +237,6 @@ void statusbar_icon_volume(int percent)
snprintf(buffer, sizeof(buffer), "%2d", percent);
#if defined(LCD_PROPFONTS)
lcd_getstringsize(buffer, 0, &width, &height);
width += strlen(buffer) - 1;
#elif defined(LOADABLE_FONTS)
font = lcd_getcurrentldfont();
lcd_getstringsize(buffer, font, &width, &height);
@ -320,7 +319,6 @@ void statusbar_time(void)
minute & 0x0f);
#if defined(LCD_PROPFONTS)
lcd_getstringsize(buffer, 0, &width, &height);
width += strlen(buffer) - 1;
#elif defined(LOADABLE_FONTS)
font = lcd_getcurrentldfont();
lcd_getstringsize(buffer, font, &width, &height);

View file

@ -733,22 +733,22 @@ void set_time(char* string, int timedate[])
lcd_getstringsize(reffub, 0, &width, &height);
cursor[0][INDEX_X] = 0;
cursor[0][INDEX_Y] = 1 + prev_line_height + 1;
cursor[0][INDEX_WIDTH] = width + strlen(reffub) - 1;
cursor[0][INDEX_WIDTH] = width;
strncpy(reffub, buffer + 3, 2);
reffub[2] = '\0';
lcd_getstringsize(reffub, 0, &width, &height);
cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + 1 + separator_width + 1;
cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width;
cursor[1][INDEX_Y] = 1 + prev_line_height + 1;
cursor[1][INDEX_WIDTH] = width + strlen(reffub) - 1;
cursor[1][INDEX_WIDTH] = width;
strncpy(reffub, buffer + 6, 2);
reffub[2] = '\0';
lcd_getstringsize(reffub, 0, &width, &height);
cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + 1 + separator_width + 1 +
cursor[1][INDEX_WIDTH] + 1 + separator_width + 1;
cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width +
cursor[1][INDEX_WIDTH] + separator_width;
cursor[2][INDEX_Y] = 1 + prev_line_height + 1;
cursor[2][INDEX_WIDTH] = width + strlen(reffub) - 1;
cursor[2][INDEX_WIDTH] = width;
lcd_getstringsize(buffer, 0, &width, &prev_line_height);
#elif defined(LOADABLE_FONTS)
@ -794,32 +794,31 @@ void set_time(char* string, int timedate[])
strncpy(reffub, buffer, 3);
reffub[3] = '\0';
lcd_getstringsize(reffub, 0, &weekday_width, &height);
weekday_width += strlen(reffub) - 1;
lcd_getstringsize(" ", 0, &separator_width, &height);
strncpy(reffub, buffer + 4, 4);
reffub[4] = '\0';
lcd_getstringsize(reffub, 0, &width, &height);
cursor[3][INDEX_X] = weekday_width + 1 + separator_width + 1;
cursor[3][INDEX_X] = weekday_width + separator_width;
cursor[3][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1;
cursor[3][INDEX_WIDTH] = width + strlen(reffub) - 1;
cursor[3][INDEX_WIDTH] = width;
strncpy(reffub, buffer + 9, 3);
reffub[3] = '\0';
lcd_getstringsize(reffub, 0, &width, &height);
cursor[4][INDEX_X] = weekday_width + 1 + separator_width + 1 +
cursor[3][INDEX_WIDTH] + 1 + separator_width + 1;
cursor[4][INDEX_X] = weekday_width + separator_width +
cursor[3][INDEX_WIDTH] + separator_width;
cursor[4][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1;
cursor[4][INDEX_WIDTH] = width + strlen(reffub) - 1;
cursor[4][INDEX_WIDTH] = width;
strncpy(reffub, buffer + 13, 2);
reffub[2] = '\0';
lcd_getstringsize(reffub, 0, &width, &height);
cursor[5][INDEX_X] = weekday_width + 1 + separator_width + 1 +
cursor[3][INDEX_WIDTH] + 1 + separator_width + 1 +
cursor[4][INDEX_WIDTH] + 1 + separator_width + 1;
cursor[5][INDEX_X] = weekday_width + separator_width +
cursor[3][INDEX_WIDTH] + separator_width +
cursor[4][INDEX_WIDTH] + separator_width;
cursor[5][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1;
cursor[5][INDEX_WIDTH] = width + strlen(reffub) - 1;
cursor[5][INDEX_WIDTH] = width;
lcd_invertrect(cursor[cursorpos][INDEX_X],
cursor[cursorpos][INDEX_Y] + lcd_getymargin(),