From c8dc68ad0fbd934e78e913b8a8d7b45945db4930 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 29 Jul 2006 22:48:57 +0200 Subject: kconfig/lxdialog: support resize In all dialogs now properly catch KEY_RESIZE and take proper action. In mconf try to behave sensibly when a dialog routine returns -ERRDISPLAYTOOSMALL. The original check for a screnn size of 80x19 is kept for now. It may make sense to remove it later, but thats anyway what much text is adjusted for. Signed-off-by: Sam Ravnborg --- scripts/kconfig/lxdialog/checklist.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/kconfig/lxdialog/checklist.c') diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c index 39becb72444..cf697080ddd 100644 --- a/scripts/kconfig/lxdialog/checklist.c +++ b/scripts/kconfig/lxdialog/checklist.c @@ -125,6 +125,12 @@ int dialog_checklist(const char *title, const char *prompt, int height, } } +do_resize: + if (getmaxy(stdscr) < (height + 6)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 6)) + return -ERRDISPLAYTOOSMALL; + max_choice = MIN(list_height, item_count()); /* center dialog box on screen */ @@ -303,6 +309,11 @@ int dialog_checklist(const char *title, const char *prompt, int height, case KEY_ESC: key = on_key_esc(dialog); break; + case KEY_RESIZE: + delwin(list); + delwin(dialog); + on_key_resize(); + goto do_resize; } /* Now, update everything... */ -- cgit v1.2.3