forked from len0rd/rockbox
skin_engine: New param "noborder" for the bar tags.
By specifying this param the bar will not have a border/box. Instead the inner part that fills up is maximized on the bar area. Note that this only affects bars using foreground and background colors, not those constructed with images. Change-Id: Ib8dd49ecbaf9e16b96de840f5f365871b73d4fa4
This commit is contained in:
parent
6e882b43b6
commit
3ae73433ab
5 changed files with 38 additions and 12 deletions
|
@ -94,11 +94,20 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y,
|
|||
max_shown = items;
|
||||
}
|
||||
|
||||
inner_x = x + 1;
|
||||
inner_y = y + 1;
|
||||
inner_wd = width - 2;
|
||||
inner_ht = height - 2;
|
||||
|
||||
if (flags & BORDER_NOFILL)
|
||||
{
|
||||
inner_x = x;
|
||||
inner_y = y;
|
||||
inner_wd = width;
|
||||
inner_ht = height;
|
||||
}
|
||||
else
|
||||
{
|
||||
inner_x = x + 1;
|
||||
inner_y = y + 1;
|
||||
inner_wd = width - 2;
|
||||
inner_ht = height - 2;
|
||||
}
|
||||
/* Boundary check to make sure that height is reasonable, otherwise nothing
|
||||
* to do
|
||||
*/
|
||||
|
@ -113,16 +122,18 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y,
|
|||
scrollbar_helper(min_shown, max_shown, items, inner_len, &size, &start);
|
||||
|
||||
/* draw box */
|
||||
if (!(flags & BORDER_NOFILL))
|
||||
{
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
/* must avoid corners if case of (flags & FOREGROUND) */
|
||||
screen->hline(inner_x, x + inner_wd, y);
|
||||
screen->hline(inner_x, x + inner_wd, y + height - 1);
|
||||
screen->vline(x, inner_y, y + inner_ht);
|
||||
screen->vline(x + width - 1, inner_y, y + inner_ht);
|
||||
/* must avoid corners if case of (flags & FOREGROUND) */
|
||||
screen->hline(inner_x, x + inner_wd, y);
|
||||
screen->hline(inner_x, x + inner_wd, y + height - 1);
|
||||
screen->vline(x, inner_y, y + inner_ht);
|
||||
screen->vline(x + width - 1, inner_y, y + inner_ht);
|
||||
#else
|
||||
screen->drawrect(x, y, width, height);
|
||||
screen->drawrect(x, y, width, height);
|
||||
#endif
|
||||
|
||||
}
|
||||
screen->set_drawmode(DRMODE_SOLID | DRMODE_INVERSEVID);
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue