From 0f8fe94f46b5c14b5f67b747131a5a66ed883e4c Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Sun, 3 Oct 2010 14:19:30 +0000 Subject: correct drawing of the bar type tags when nofill is set. draw the slider bitmap before drawing A-B repeat markers so that they are visible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28204 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/scrollbar.c | 12 +++++-- apps/gui/scrollbar.h | 1 + apps/gui/skin_engine/skin_display.c | 70 +++++++++++++++---------------------- 3 files changed, 39 insertions(+), 44 deletions(-) (limited to 'apps') diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c index 8f431a4ff8..17d280b1ca 100644 --- a/apps/gui/scrollbar.c +++ b/apps/gui/scrollbar.c @@ -151,6 +151,9 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y, screen->set_drawmode(DRMODE_SOLID); + if (flags & INNER_NOFILL) + return; + #ifdef HAVE_LCD_COLOR if (infill == INNER_BGFILL) { @@ -190,7 +193,12 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x, /* clear pixels in progress bar */ screen->fillrect(x, y, width, height); - + + screen->set_drawmode(DRMODE_SOLID); + + if (flags & INNER_NOFILL) + return; + if (flags & INVERTFILL) { min_shown = items - max_shown; @@ -204,8 +212,6 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x, scrollbar_helper(min_shown, max_shown, items, inner_len, &size, &start); - screen->set_drawmode(DRMODE_SOLID); - if (flags & HORIZONTAL) { x += start; width = size; diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h index e5ffae79b0..31f91a3eaa 100644 --- a/apps/gui/scrollbar.h +++ b/apps/gui/scrollbar.h @@ -29,6 +29,7 @@ enum orientation { VERTICAL = 0x0000, /* Vertical orientation */ HORIZONTAL = 0x0001, /* Horizontal orientation */ INVERTFILL = 0x0002, /* Invert the fill direction */ + INNER_NOFILL = 0x0004, /* Do not fill inner part */ #ifdef HAVE_LCD_COLOR FOREGROUND = 0x0020, /* Do not clear background pixels */ INNER_FILL = 0x0040, /* Fill inner part even if FOREGROUND */ diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 4c96782280..91e8bbfafc 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -135,8 +135,6 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) unsigned long length, end; int flags = HORIZONTAL; - int drawn_length, drawn_end; - if (height < 0) height = font_get(vp->font)->height; @@ -180,17 +178,6 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) end = 0; } - if (pb->nofill) - { - drawn_length = 1; - drawn_end = 0; - } - else - { - drawn_length = length; - drawn_end = end; - } - if (!pb->horizontal) { /* we want to fill upwards which is technically inverted. */ @@ -202,37 +189,19 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) flags ^= INVERTFILL; } - + if (pb->nofill) + { + flags |= INNER_NOFILL; + } + if (pb->have_bitmap_pb) gui_bitmap_scrollbar_draw(display, &pb->bm, pb->x, y, pb->width, pb->bm.height, - drawn_length, 0, drawn_end, flags); + length, 0, end, flags); else gui_scrollbar_draw(display, pb->x, y, pb->width, height, - drawn_length, 0, drawn_end, flags); - - if (pb->type == SKIN_TOKEN_PROGRESSBAR) - { - if (id3 && id3->length) - { -#ifdef AB_REPEAT_ENABLE - if (ab_repeat_mode_enabled()) - ab_draw_markers(display, id3->length, - pb->x, y, pb->width, height); -#endif + length, 0, end, flags); - if (id3->cuesheet) - cue_draw_markers(display, id3->cuesheet, id3->length, - pb->x, y+1, pb->width, height-2); - } -#if 0 /* disable for now CONFIG_TUNER */ - else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) - { - presets_draw_markers(display, pb->x, y, pb->width, height); - } -#endif - } - if (pb->slider) { int x = pb->x, y = pb->y; @@ -265,6 +234,28 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) img->bm.width, img->bm.height), x, y, width, height); } +#endif + } + + if (pb->type == SKIN_TOKEN_PROGRESSBAR) + { + if (id3 && id3->length) + { +#ifdef AB_REPEAT_ENABLE + if (ab_repeat_mode_enabled()) + ab_draw_markers(display, id3->length, + pb->x, y, pb->width, height); +#endif + + if (id3->cuesheet) + cue_draw_markers(display, id3->cuesheet, id3->length, + pb->x, y+1, pb->width, height-2); + } +#if 0 /* disable for now CONFIG_TUNER */ + else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) + { + presets_draw_markers(display, pb->x, y, pb->width, height); + } #endif } } @@ -783,6 +774,3 @@ int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout) } return button; } - - - -- cgit v1.2.3