forked from len0rd/rockbox
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
This commit is contained in:
parent
c80dd635ab
commit
0f8fe94f46
3 changed files with 39 additions and 44 deletions
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
length, 0, 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
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue