forked from len0rd/rockbox
printcell_helper.c bugfix scrollbar spacing
when the scrollbar was on left and number of items was < nb_lines the spacing between title and items was off by sb_width selected item no longer draws separators when no colums are selected Change-Id: If564261759721eb7bcf3b7b4ba58bf9c130771b0
This commit is contained in:
parent
cbb57fe714
commit
bfe3dac3ba
1 changed files with 15 additions and 2 deletions
|
|
@ -41,6 +41,7 @@ struct printcell_info_t {
|
||||||
int iconw[NB_SCREENS];
|
int iconw[NB_SCREENS];
|
||||||
int selcol_offw[NB_SCREENS];
|
int selcol_offw[NB_SCREENS];
|
||||||
int totalcolw[NB_SCREENS];
|
int totalcolw[NB_SCREENS];
|
||||||
|
int firstcolxw[NB_SCREENS];
|
||||||
uint16_t colw[NB_SCREENS][PRINTCELL_MAX_COLUMNS];
|
uint16_t colw[NB_SCREENS][PRINTCELL_MAX_COLUMNS];
|
||||||
int ncols;
|
int ncols;
|
||||||
int selcol;
|
int selcol;
|
||||||
|
|
@ -119,6 +120,15 @@ static void draw_selector(struct screen *display, struct line_desc *linedes,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (printcell.selcol < 0)
|
||||||
|
{
|
||||||
|
if (selected_flag == SELECTED_FLAG)
|
||||||
|
{
|
||||||
|
display->hline(x + 1, w + x, y);
|
||||||
|
display->hline(x + 1, w + x, y + h - 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* draw whole rect outline */
|
/* draw whole rect outline */
|
||||||
display->drawrect(x + 1, y, w - 1, h);
|
display->drawrect(x + 1, y, w - 1, h);
|
||||||
}
|
}
|
||||||
|
|
@ -255,6 +265,8 @@ static void printcell_listdraw_fn(struct list_putlineinfo_t *list_info)
|
||||||
nw += sbwidth;
|
nw += sbwidth;
|
||||||
|
|
||||||
colxw = nx + nw;
|
colxw = nx + nw;
|
||||||
|
printcell.firstcolxw[screen] = colxw; /* save position of first column for subsequent items */
|
||||||
|
|
||||||
if (colxw > 0)
|
if (colxw > 0)
|
||||||
{
|
{
|
||||||
set_cell_width(vp, vp_w, colxw);
|
set_cell_width(vp, vp_w, colxw);
|
||||||
|
|
@ -289,8 +301,9 @@ static void printcell_listdraw_fn(struct list_putlineinfo_t *list_info)
|
||||||
display->put_line(x, y, linedes, "$t", "");
|
display->put_line(x, y, linedes, "$t", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
nw = screencolwidth[0] + printcell.iconw[screen] + text_offset;
|
//nw = screencolwidth[0] + printcell.iconw[screen] + text_offset;
|
||||||
colxw = nx + nw;
|
colxw = printcell.firstcolxw[screen] - vp->x; /* match title spacing */
|
||||||
|
nw = colxw - nx;
|
||||||
if (colxw > 0)
|
if (colxw > 0)
|
||||||
{
|
{
|
||||||
set_cell_width(vp, vp_w, colxw);
|
set_cell_width(vp, vp_w, colxw);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue