diff options
author | Markus Braun <markus.braun@krawel.de> | 2002-08-21 06:23:23 +0000 |
---|---|---|
committer | Markus Braun <markus.braun@krawel.de> | 2002-08-21 06:23:23 +0000 |
commit | c7aaca4615e2fa0c2316f81d5c229715e11dc0e7 (patch) | |
tree | ae0e2add7368fed4bcd0fc2c94f544875d759d66 /apps | |
parent | bcbb8046f8d5ca3339e1793826b04d2f387138b8 (diff) | |
download | rockbox-c7aaca4615e2fa0c2316f81d5c229715e11dc0e7.tar.gz rockbox-c7aaca4615e2fa0c2316f81d5c229715e11dc0e7.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/icons.c | 2 | ||||
-rw-r--r-- | 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) | |||
237 | snprintf(buffer, sizeof(buffer), "%2d", percent); | 237 | snprintf(buffer, sizeof(buffer), "%2d", percent); |
238 | #if defined(LCD_PROPFONTS) | 238 | #if defined(LCD_PROPFONTS) |
239 | lcd_getstringsize(buffer, 0, &width, &height); | 239 | lcd_getstringsize(buffer, 0, &width, &height); |
240 | width += strlen(buffer) - 1; | ||
241 | #elif defined(LOADABLE_FONTS) | 240 | #elif defined(LOADABLE_FONTS) |
242 | font = lcd_getcurrentldfont(); | 241 | font = lcd_getcurrentldfont(); |
243 | lcd_getstringsize(buffer, font, &width, &height); | 242 | lcd_getstringsize(buffer, font, &width, &height); |
@@ -320,7 +319,6 @@ void statusbar_time(void) | |||
320 | minute & 0x0f); | 319 | minute & 0x0f); |
321 | #if defined(LCD_PROPFONTS) | 320 | #if defined(LCD_PROPFONTS) |
322 | lcd_getstringsize(buffer, 0, &width, &height); | 321 | lcd_getstringsize(buffer, 0, &width, &height); |
323 | width += strlen(buffer) - 1; | ||
324 | #elif defined(LOADABLE_FONTS) | 322 | #elif defined(LOADABLE_FONTS) |
325 | font = lcd_getcurrentldfont(); | 323 | font = lcd_getcurrentldfont(); |
326 | lcd_getstringsize(buffer, font, &width, &height); | 324 | 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[]) | |||
733 | lcd_getstringsize(reffub, 0, &width, &height); | 733 | lcd_getstringsize(reffub, 0, &width, &height); |
734 | cursor[0][INDEX_X] = 0; | 734 | cursor[0][INDEX_X] = 0; |
735 | cursor[0][INDEX_Y] = 1 + prev_line_height + 1; | 735 | cursor[0][INDEX_Y] = 1 + prev_line_height + 1; |
736 | cursor[0][INDEX_WIDTH] = width + strlen(reffub) - 1; | 736 | cursor[0][INDEX_WIDTH] = width; |
737 | 737 | ||
738 | strncpy(reffub, buffer + 3, 2); | 738 | strncpy(reffub, buffer + 3, 2); |
739 | reffub[2] = '\0'; | 739 | reffub[2] = '\0'; |
740 | lcd_getstringsize(reffub, 0, &width, &height); | 740 | lcd_getstringsize(reffub, 0, &width, &height); |
741 | cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + 1 + separator_width + 1; | 741 | cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width; |
742 | cursor[1][INDEX_Y] = 1 + prev_line_height + 1; | 742 | cursor[1][INDEX_Y] = 1 + prev_line_height + 1; |
743 | cursor[1][INDEX_WIDTH] = width + strlen(reffub) - 1; | 743 | cursor[1][INDEX_WIDTH] = width; |
744 | 744 | ||
745 | strncpy(reffub, buffer + 6, 2); | 745 | strncpy(reffub, buffer + 6, 2); |
746 | reffub[2] = '\0'; | 746 | reffub[2] = '\0'; |
747 | lcd_getstringsize(reffub, 0, &width, &height); | 747 | lcd_getstringsize(reffub, 0, &width, &height); |
748 | cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + 1 + separator_width + 1 + | 748 | cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width + |
749 | cursor[1][INDEX_WIDTH] + 1 + separator_width + 1; | 749 | cursor[1][INDEX_WIDTH] + separator_width; |
750 | cursor[2][INDEX_Y] = 1 + prev_line_height + 1; | 750 | cursor[2][INDEX_Y] = 1 + prev_line_height + 1; |
751 | cursor[2][INDEX_WIDTH] = width + strlen(reffub) - 1; | 751 | cursor[2][INDEX_WIDTH] = width; |
752 | 752 | ||
753 | lcd_getstringsize(buffer, 0, &width, &prev_line_height); | 753 | lcd_getstringsize(buffer, 0, &width, &prev_line_height); |
754 | #elif defined(LOADABLE_FONTS) | 754 | #elif defined(LOADABLE_FONTS) |
@@ -794,32 +794,31 @@ void set_time(char* string, int timedate[]) | |||
794 | strncpy(reffub, buffer, 3); | 794 | strncpy(reffub, buffer, 3); |
795 | reffub[3] = '\0'; | 795 | reffub[3] = '\0'; |
796 | lcd_getstringsize(reffub, 0, &weekday_width, &height); | 796 | lcd_getstringsize(reffub, 0, &weekday_width, &height); |
797 | weekday_width += strlen(reffub) - 1; | ||
798 | lcd_getstringsize(" ", 0, &separator_width, &height); | 797 | lcd_getstringsize(" ", 0, &separator_width, &height); |
799 | 798 | ||
800 | strncpy(reffub, buffer + 4, 4); | 799 | strncpy(reffub, buffer + 4, 4); |
801 | reffub[4] = '\0'; | 800 | reffub[4] = '\0'; |
802 | lcd_getstringsize(reffub, 0, &width, &height); | 801 | lcd_getstringsize(reffub, 0, &width, &height); |
803 | cursor[3][INDEX_X] = weekday_width + 1 + separator_width + 1; | 802 | cursor[3][INDEX_X] = weekday_width + separator_width; |
804 | cursor[3][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1; | 803 | cursor[3][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1; |
805 | cursor[3][INDEX_WIDTH] = width + strlen(reffub) - 1; | 804 | cursor[3][INDEX_WIDTH] = width; |
806 | 805 | ||
807 | strncpy(reffub, buffer + 9, 3); | 806 | strncpy(reffub, buffer + 9, 3); |
808 | reffub[3] = '\0'; | 807 | reffub[3] = '\0'; |
809 | lcd_getstringsize(reffub, 0, &width, &height); | 808 | lcd_getstringsize(reffub, 0, &width, &height); |
810 | cursor[4][INDEX_X] = weekday_width + 1 + separator_width + 1 + | 809 | cursor[4][INDEX_X] = weekday_width + separator_width + |
811 | cursor[3][INDEX_WIDTH] + 1 + separator_width + 1; | 810 | cursor[3][INDEX_WIDTH] + separator_width; |
812 | cursor[4][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1; | 811 | cursor[4][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1; |
813 | cursor[4][INDEX_WIDTH] = width + strlen(reffub) - 1; | 812 | cursor[4][INDEX_WIDTH] = width; |
814 | 813 | ||
815 | strncpy(reffub, buffer + 13, 2); | 814 | strncpy(reffub, buffer + 13, 2); |
816 | reffub[2] = '\0'; | 815 | reffub[2] = '\0'; |
817 | lcd_getstringsize(reffub, 0, &width, &height); | 816 | lcd_getstringsize(reffub, 0, &width, &height); |
818 | cursor[5][INDEX_X] = weekday_width + 1 + separator_width + 1 + | 817 | cursor[5][INDEX_X] = weekday_width + separator_width + |
819 | cursor[3][INDEX_WIDTH] + 1 + separator_width + 1 + | 818 | cursor[3][INDEX_WIDTH] + separator_width + |
820 | cursor[4][INDEX_WIDTH] + 1 + separator_width + 1; | 819 | cursor[4][INDEX_WIDTH] + separator_width; |
821 | cursor[5][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1; | 820 | cursor[5][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1; |
822 | cursor[5][INDEX_WIDTH] = width + strlen(reffub) - 1; | 821 | cursor[5][INDEX_WIDTH] = width; |
823 | 822 | ||
824 | lcd_invertrect(cursor[cursorpos][INDEX_X], | 823 | lcd_invertrect(cursor[cursorpos][INDEX_X], |
825 | cursor[cursorpos][INDEX_Y] + lcd_getymargin(), | 824 | cursor[cursorpos][INDEX_Y] + lcd_getymargin(), |