summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-01-12 15:35:20 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-02-12 13:47:13 +1100
commit11c43508e4360456298a6dcb0563614e9a118b41 (patch)
treef6cca92e407583347986f9c58739aa0391644f36
parent02af1caf9df8e43ebb9555069cb014e60bb7ec6d (diff)
downloadtalos-petitboot-11c43508e4360456298a6dcb0563614e9a118b41.tar.gz
talos-petitboot-11c43508e4360456298a6dcb0563614e9a118b41.zip
ui/ncurses: Clear remaining space when drawing help line
When drawing the screen's help line clear each character after the new help line to avoid stale parts of the previous screen's help line remaining on the screen. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--ui/ncurses/nc-scr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c
index a02627b..e95c0ea 100644
--- a/ui/ncurses/nc-scr.c
+++ b/ui/ncurses/nc-scr.c
@@ -56,7 +56,7 @@ int nc_scr_unpost(struct nc_scr *scr)
void nc_scr_frame_draw(struct nc_scr *scr)
{
- int ltitle_len, rtitle_len;
+ int ltitle_len, rtitle_len, help_len;
DBGS("ltitle '%s'\n", scr->frame.ltitle);
DBGS("rtitle '%s'\n", scr->frame.rtitle);
@@ -77,6 +77,10 @@ void nc_scr_frame_draw(struct nc_scr *scr)
mvwhline(scr->main_ncw, LINES - nc_scr_pos_help_sep, 1, ACS_HLINE,
COLS - 2);
+ help_len = 1 + strlen(scr->frame.help);
+ if (help_len < COLS)
+ mvwhline(scr->main_ncw, LINES - nc_scr_pos_help, help_len, ' ',
+ COLS - help_len);
mvwaddstr(scr->main_ncw, LINES - nc_scr_pos_help, 1, scr->frame.help);
nc_scr_status_draw(scr);
}
OpenPOWER on IntegriCloud