diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2017-06-14 15:17:35 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2017-07-11 14:32:31 +1000 |
commit | 4c55c0778e983c41418effecdbd96437b43a5513 (patch) | |
tree | 78a22dbe62e13956707c3ada9ec3f634833db815 | |
parent | 6704a228c6389607f775bbaf2ee7de786d7b9996 (diff) | |
download | petitboot-4c55c0778e983c41418effecdbd96437b43a5513.zip petitboot-4c55c0778e983c41418effecdbd96437b43a5513.tar.gz |
ui/ncurses: Extend nc-subset pad height
The nc-subset screen can exceed its maximum height if some options are
long enough to wrap around to two lines. Increaes the maximum size of
the pad to account for every line potentially wrapping once.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r-- | ui/ncurses/nc-subset.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/ncurses/nc-subset.c b/ui/ncurses/nc-subset.c index 8336725..50e1b65 100644 --- a/ui/ncurses/nc-subset.c +++ b/ui/ncurses/nc-subset.c @@ -222,8 +222,11 @@ static void subset_screen_draw(struct subset_screen *screen) bool repost = false; int height; - /* Size of pad = top space + number of available options */ - height = 1 + N_FIELDS + widget_subset_n_inactive(screen->options); + /* + * Size of pad = top space + 2 * number of available options in case + * device names wrap + */ + height = 1 + N_FIELDS + widget_subset_n_inactive(screen->options) * 2; if (!screen->pad || getmaxy(screen->pad) < height) { if (screen->pad) |