summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-03-02 08:47:45 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-03-02 08:47:45 +0000
commit04e0d6c12c6ad878b551be79a7c83c8b1784e748 (patch)
tree16f42740f0293d237f0c262ed0e3e976058fcbb0
parent3f09d7eed10c2f03b26ff11b8a3fa5a64dc9b2c2 (diff)
downloadrockbox-04e0d6c12c6ad878b551be79a7c83c8b1784e748.tar.gz
rockbox-04e0d6c12c6ad878b551be79a7c83c8b1784e748.zip
fix %pb when the height isnt given and it is in a viewport with a user font (so the height is calculated on the font height at display time)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24991 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_display.c10
-rw-r--r--apps/gui/skin_engine/skin_parser.c18
2 files changed, 19 insertions, 9 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index df200bec5f..2d47989aa2 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -122,6 +122,10 @@ static void draw_progressbar(struct gui_wps *gwps,
122 struct progressbar *pb = wps_vp->pb; 122 struct progressbar *pb = wps_vp->pb;
123 struct mp3entry *id3 = state->id3; 123 struct mp3entry *id3 = state->id3;
124 int y = pb->y; 124 int y = pb->y;
125 int height = pb->height;
126
127 if (pb->height < 0 && !pb->have_bitmap_pb)
128 height = font_get(wps_vp->vp.font)->height;
125 129
126 if (y < 0) 130 if (y < 0)
127 { 131 {
@@ -151,19 +155,19 @@ static void draw_progressbar(struct gui_wps *gwps,
151 length ? elapsed + state->ff_rewind_count : 0, 155 length ? elapsed + state->ff_rewind_count : 0,
152 HORIZONTAL); 156 HORIZONTAL);
153 else 157 else
154 gui_scrollbar_draw(display, pb->x, y, pb->width, pb->height, 158 gui_scrollbar_draw(display, pb->x, y, pb->width, height,
155 length ? length : 1, 0, 159 length ? length : 1, 0,
156 length ? elapsed + state->ff_rewind_count : 0, 160 length ? elapsed + state->ff_rewind_count : 0,
157 HORIZONTAL); 161 HORIZONTAL);
158#ifdef AB_REPEAT_ENABLE 162#ifdef AB_REPEAT_ENABLE
159 if ( ab_repeat_mode_enabled() && length != 0 ) 163 if ( ab_repeat_mode_enabled() && length != 0 )
160 ab_draw_markers(display, length, 164 ab_draw_markers(display, length,
161 pb->x, pb->x + pb->width, y, pb->height); 165 pb->x, pb->x + pb->width, y, height);
162#endif 166#endif
163 167
164 if (id3 && id3->cuesheet) 168 if (id3 && id3->cuesheet)
165 cue_draw_markers(display, state->id3->cuesheet, length, 169 cue_draw_markers(display, state->id3->cuesheet, length,
166 pb->x, pb->x + pb->width, y+1, pb->height-2); 170 pb->x, pb->x + pb->width, y+1, height-2);
167} 171}
168bool audio_peek_track(struct mp3entry* id3, int offset); 172bool audio_peek_track(struct mp3entry* id3, int offset);
169static void draw_playlist_viewer_list(struct gui_wps *gwps, 173static void draw_playlist_viewer_list(struct gui_wps *gwps,
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index a81ae5ea1f..c4f8d1a8ca 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1124,11 +1124,6 @@ static int parse_progressbar(const char *wps_bufptr,
1124 return WPS_ERROR_INVALID_PARAM; 1124 return WPS_ERROR_INVALID_PARAM;
1125 1125
1126 struct viewport *vp = &curr_vp->vp; 1126 struct viewport *vp = &curr_vp->vp;
1127#ifndef __PCTOOL__
1128 int font_height = font_get(vp->font)->height;
1129#else
1130 int font_height = 8;
1131#endif
1132 /* we need to know what line number (viewport relative) this pb is, 1127 /* we need to know what line number (viewport relative) this pb is,
1133 * so count them... */ 1128 * so count them... */
1134 int line_num = -1; 1129 int line_num = -1;
@@ -1187,7 +1182,18 @@ static int parse_progressbar(const char *wps_bufptr,
1187 pb->height = height; 1182 pb->height = height;
1188 } 1183 }
1189 else 1184 else
1190 pb->height = font_height; 1185 {
1186 if (vp->font > FONT_UI)
1187 pb->height = -1; /* calculate at display time */
1188 else
1189 {
1190#ifndef __PCTOOL__
1191 pb->height = font_get(vp->font)->height;
1192#else
1193 pb->height = 8;
1194#endif
1195 }
1196 }
1191 1197
1192 if (LIST_VALUE_PARSED(set, PB_Y)) /* y */ 1198 if (LIST_VALUE_PARSED(set, PB_Y)) /* y */
1193 pb->y = y; 1199 pb->y = y;