diff options
Diffstat (limited to 'util/kconfig/lxdialog/yesno.c')
-rw-r--r-- | util/kconfig/lxdialog/yesno.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/util/kconfig/lxdialog/yesno.c b/util/kconfig/lxdialog/yesno.c index 4614d0f299..676fb2f824 100644 --- a/util/kconfig/lxdialog/yesno.c +++ b/util/kconfig/lxdialog/yesno.c @@ -45,14 +45,14 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width) WINDOW *dialog; do_resize: - if (getmaxy(stdscr) < (height + 4)) + if (getmaxy(stdscr) < (height + YESNO_HEIGTH_MIN)) return -ERRDISPLAYTOOSMALL; - if (getmaxx(stdscr) < (width + 4)) + if (getmaxx(stdscr) < (width + YESNO_WIDTH_MIN)) return -ERRDISPLAYTOOSMALL; /* center dialog box on screen */ - x = (COLS - width) / 2; - y = (LINES - height) / 2; + x = (getmaxx(stdscr) - width) / 2; + y = (getmaxy(stdscr) - height) / 2; draw_shadow(stdscr, y, x, height, width); @@ -102,12 +102,10 @@ do_resize: case KEY_ESC: key = on_key_esc(dialog); break; -#ifdef NCURSES_VERSION case KEY_RESIZE: delwin(dialog); on_key_resize(); goto do_resize; -#endif } } |