summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-01-04 16:51:24 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2022-01-04 16:51:24 -0500
commitbfe3dac3badd6ddd22f65237cbbd839f8feb4a17 (patch)
tree1ef49cba6036f97280a78399cb7351cfc76882ac
parentcbb57fe714b633cd5b91850eae9cfd326dee2eeb (diff)
downloadrockbox-bfe3dac3badd6ddd22f65237cbbd839f8feb4a17.tar.gz
rockbox-bfe3dac3badd6ddd22f65237cbbd839f8feb4a17.zip
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
-rw-r--r--apps/plugins/lib/printcell_helper.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/plugins/lib/printcell_helper.c b/apps/plugins/lib/printcell_helper.c
index 27a4b0fc95..ce79943c31 100644
--- a/apps/plugins/lib/printcell_helper.c
+++ b/apps/plugins/lib/printcell_helper.c
@@ -41,6 +41,7 @@ struct printcell_info_t {
int iconw[NB_SCREENS];
int selcol_offw[NB_SCREENS];
int totalcolw[NB_SCREENS];
+ int firstcolxw[NB_SCREENS];
uint16_t colw[NB_SCREENS][PRINTCELL_MAX_COLUMNS];
int ncols;
int selcol;
@@ -119,6 +120,15 @@ static void draw_selector(struct screen *display, struct line_desc *linedes,
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 */
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;
colxw = nx + nw;
+ printcell.firstcolxw[screen] = colxw; /* save position of first column for subsequent items */
+
if (colxw > 0)
{
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", "");
}
- nw = screencolwidth[0] + printcell.iconw[screen] + text_offset;
- colxw = nx + nw;
+ //nw = screencolwidth[0] + printcell.iconw[screen] + text_offset;
+ colxw = printcell.firstcolxw[screen] - vp->x; /* match title spacing */
+ nw = colxw - nx;
if (colxw > 0)
{
set_cell_width(vp, vp_w, colxw);