summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rw-r--r--apps/gui/skin_engine/skin_display.c58
1 files changed, 37 insertions, 21 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 24e976d393..1418d91b57 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -131,7 +131,7 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
131 struct viewport *vp = pb->vp; 131 struct viewport *vp = pb->vp;
132 struct wps_state *state = skin_get_global_state(); 132 struct wps_state *state = skin_get_global_state();
133 struct mp3entry *id3 = state->id3; 133 struct mp3entry *id3 = state->id3;
134 int y = pb->y, height = pb->height; 134 int x = pb->x, y = pb->y, width = pb->width, height = pb->height;
135 unsigned long length, end; 135 unsigned long length, end;
136 int flags = HORIZONTAL; 136 int flags = HORIZONTAL;
137 137
@@ -194,29 +194,48 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
194 flags |= INNER_NOFILL; 194 flags |= INNER_NOFILL;
195 } 195 }
196 196
197 if (pb->have_bitmap_pb) 197 if (pb->slider)
198 gui_bitmap_scrollbar_draw(display, &pb->bm, 198 {
199 pb->x, y, pb->width, height, 199 struct gui_img *img = pb->slider;
200 length, 0, end, flags); 200 /* clear the slider */
201 else 201 screen_clear_area(display, x, y, width, height);
202 gui_scrollbar_draw(display, pb->x, y, pb->width, height, 202
203 length, 0, end, flags); 203 /* shrink the bar so the slider is inside bounds */
204 if (flags&HORIZONTAL)
205 {
206 width -= img->bm.width;
207 x += img->bm.width / 2;
208 }
209 else
210 {
211 height -= img->bm.height;
212 y += img->bm.height / 2;
213 }
214 }
215 if (!pb->nobar)
216 {
217 if (pb->have_bitmap_pb)
218 gui_bitmap_scrollbar_draw(display, &pb->bm,
219 x, y, width, height,
220 length, 0, end, flags);
221 else
222 gui_scrollbar_draw(display, x, y, width, height,
223 length, 0, end, flags);
224 }
204 225
205 if (pb->slider) 226 if (pb->slider)
206 { 227 {
207 int xoff = 0, yoff = 0; 228 int xoff = 0, yoff = 0;
208 int w = pb->width, h = height; 229 int w = width, h = height;
209 struct gui_img *img = pb->slider; 230 struct gui_img *img = pb->slider;
210 231
211 if (flags&HORIZONTAL) 232 if (flags&HORIZONTAL)
212 { 233 {
213 w = img->bm.width; 234 w = img->bm.width;
214 xoff = pb->width * end / length; 235 xoff = width * end / length;
215 if (flags&INVERTFILL) 236 if (flags&INVERTFILL)
216 xoff = pb->width - xoff; 237 xoff = width - xoff;
217#if 0 /* maybe add this in later, make the slider bmp overlap abit */
218 xoff -= w / 2; 238 xoff -= w / 2;
219#endif
220 } 239 }
221 else 240 else
222 { 241 {
@@ -224,23 +243,21 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
224 yoff = height * end / length; 243 yoff = height * end / length;
225 if (flags&INVERTFILL) 244 if (flags&INVERTFILL)
226 yoff = height - yoff; 245 yoff = height - yoff;
227#if 0 /* maybe add this in later, make the slider bmp overlap abit */
228 yoff -= h / 2; 246 yoff -= h / 2;
229#endif
230 } 247 }
231#if LCD_DEPTH > 1 248#if LCD_DEPTH > 1
232 if(img->bm.format == FORMAT_MONO) { 249 if(img->bm.format == FORMAT_MONO) {
233#endif 250#endif
234 display->mono_bitmap_part(img->bm.data, 251 display->mono_bitmap_part(img->bm.data,
235 0, 0, img->bm.width, 252 0, 0, img->bm.width,
236 pb->x + xoff, y + yoff, w, h); 253 x + xoff, y + yoff, w, h);
237#if LCD_DEPTH > 1 254#if LCD_DEPTH > 1
238 } else { 255 } else {
239 display->transparent_bitmap_part((fb_data *)img->bm.data, 256 display->transparent_bitmap_part((fb_data *)img->bm.data,
240 0, 0, 257 0, 0,
241 STRIDE(display->screen_type, 258 STRIDE(display->screen_type,
242 img->bm.width, img->bm.height), 259 img->bm.width, img->bm.height),
243 pb->x + xoff, y + yoff, w, h); 260 x + xoff, y + yoff, w, h);
244 } 261 }
245#endif 262#endif
246 } 263 }
@@ -251,18 +268,17 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
251 { 268 {
252#ifdef AB_REPEAT_ENABLE 269#ifdef AB_REPEAT_ENABLE
253 if (ab_repeat_mode_enabled()) 270 if (ab_repeat_mode_enabled())
254 ab_draw_markers(display, id3->length, 271 ab_draw_markers(display, id3->length, x, y, width, height);
255 pb->x, y, pb->width, height);
256#endif 272#endif
257 273
258 if (id3->cuesheet) 274 if (id3->cuesheet)
259 cue_draw_markers(display, id3->cuesheet, id3->length, 275 cue_draw_markers(display, id3->cuesheet, id3->length,
260 pb->x, y+1, pb->width, height-2); 276 x, y+1, width, height-2);
261 } 277 }
262#if 0 /* disable for now CONFIG_TUNER */ 278#if 0 /* disable for now CONFIG_TUNER */
263 else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) 279 else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF))
264 { 280 {
265 presets_draw_markers(display, pb->x, y, pb->width, height); 281 presets_draw_markers(display, x, y, width, height);
266 } 282 }
267#endif 283#endif
268 } 284 }