From bfe3dac3badd6ddd22f65237cbbd839f8feb4a17 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 4 Jan 2022 16:51:24 -0500 Subject: [PATCH] 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 --- apps/plugins/lib/printcell_helper.c | 17 +++++++++++++++-- 1 file 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);