From c7aaca4615e2fa0c2316f81d5c229715e11dc0e7 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 21 Aug 2002 06:23:23 +0000 Subject: 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 --- apps/recorder/icons.c | 2 -- apps/settings.c | 31 +++++++++++++++---------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index bac719e0f1..eb2e4e21fb 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -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); diff --git a/apps/settings.c b/apps/settings.c index 74843fe20d..afd9840b2a 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -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(), -- cgit v1.2.3