]> git.ozlabs.org Git - petitboot/commitdiff
ui/ncurses: Extend nc-subset pad height
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Wed, 14 Jun 2017 05:17:35 +0000 (15:17 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 11 Jul 2017 04:32:31 +0000 (14:32 +1000)
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>
ui/ncurses/nc-subset.c

index 8336725d8e39a103816f2e42eb881bcc4bc880f7..50e1b6521c6565135833799c9f5da7f110bf54ac 100644 (file)
@@ -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)