New option for the bar tags: 'backdrop, <label>' will draw another image under the progressbar (only works with image and slider bars)
example: %V(22,253,198,14,-) %xl(a,PLAY_BAR_BACKDROP-240x320x16.bmp,0,0) %pb(0,0,198,14,PLAY_BAR-240x320x16.bmp, backdrop, a) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29127 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cb39ac6b1e
commit
f06f685273
6 changed files with 44 additions and 4 deletions
|
@ -192,7 +192,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
|
|||
screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||
|
||||
/* clear pixels in progress bar */
|
||||
screen->fillrect(x, y, width, height);
|
||||
if ((flags&DONT_CLEAR_EXCESS) == 0)
|
||||
screen->fillrect(x, y, width, height);
|
||||
|
||||
screen->set_drawmode(DRMODE_SOLID);
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ enum orientation {
|
|||
color even if FOREGROUND */
|
||||
INNER_FILL_MASK = 0x00c0,
|
||||
#endif
|
||||
DONT_CLEAR_EXCESS = 0x0100, /* Don't clear the entire bar area */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -234,6 +234,28 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
|
|||
y += img->bm.height / 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (pb->backdrop)
|
||||
{
|
||||
struct gui_img *img = pb->backdrop;
|
||||
#if LCD_DEPTH > 1
|
||||
if(img->bm.format == FORMAT_MONO) {
|
||||
#endif
|
||||
display->mono_bitmap_part(img->bm.data,
|
||||
0, 0, img->bm.width,
|
||||
x, y, width, height);
|
||||
#if LCD_DEPTH > 1
|
||||
} else {
|
||||
display->transparent_bitmap_part((fb_data *)img->bm.data,
|
||||
0, 0,
|
||||
STRIDE(display->screen_type,
|
||||
img->bm.width, img->bm.height),
|
||||
x, y, width, height);
|
||||
}
|
||||
#endif
|
||||
flags |= DONT_CLEAR_EXCESS;
|
||||
}
|
||||
|
||||
if (!pb->nobar)
|
||||
{
|
||||
if (pb->image)
|
||||
|
|
|
@ -601,6 +601,7 @@ static int parse_progressbar_tag(struct skin_element* element,
|
|||
pb->nobar = false;
|
||||
pb->image = NULL;
|
||||
pb->slider = NULL;
|
||||
pb->backdrop = NULL;
|
||||
pb->invert_fill_direction = false;
|
||||
pb->horizontal = true;
|
||||
|
||||
|
@ -696,6 +697,18 @@ static int parse_progressbar_tag(struct skin_element* element,
|
|||
else /* option needs the next param */
|
||||
return -1;
|
||||
}
|
||||
else if (!strcmp(param->data.text, "backdrop"))
|
||||
{
|
||||
if (curr_param+1 < element->params_count)
|
||||
{
|
||||
curr_param++;
|
||||
param++;
|
||||
pb->backdrop = find_image(param->data.text, wps_data);
|
||||
|
||||
}
|
||||
else /* option needs the next param */
|
||||
return -1;
|
||||
}
|
||||
else if (!strcmp(param->data.text, "vertical"))
|
||||
{
|
||||
pb->horizontal = false;
|
||||
|
@ -735,8 +748,7 @@ static int parse_progressbar_tag(struct skin_element* element,
|
|||
add_to_ll_chain(&wps_data->images, item);
|
||||
pb->image = img;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (token->type == SKIN_TOKEN_VOLUME)
|
||||
token->type = SKIN_TOKEN_VOLUMEBAR;
|
||||
|
|
|
@ -111,6 +111,7 @@ struct progressbar {
|
|||
bool nobar;
|
||||
struct gui_img *slider;
|
||||
bool horizontal;
|
||||
struct gui_img *backdrop;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -663,9 +663,12 @@ display cycling round the defined sublines. See
|
|||
\item[vertical] -- force the bar to be drawn vertically.
|
||||
\item[invert] -- invert the draw direction (i.e. right to left, or top to
|
||||
bottom).
|
||||
\item[slider] -- draw an preloaded image over the top of the bar so that
|
||||
\item[slider] -- draw a preloaded image over the top of the bar so that
|
||||
the centre of the image matches the current position. This must be
|
||||
followed by the label of the desired image.
|
||||
\item[backdrop] -- draw a preloaded image under the bar. The full
|
||||
image will be displayed and must be the same size as the bar.
|
||||
This must be followed by the label of the desired image.
|
||||
\item[nofill] -- don't draw the bar, only its frame (for use with the
|
||||
``slider'' option).
|
||||
\item[nobar] -- don't draw the bar or its frame (for use with the
|
||||
|
|
Loading…
Reference in a new issue