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/mconf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts/kconfig/mconf.c') diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index ef75d6c3d3e5..f7abca434829 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -606,9 +606,8 @@ static void conf(struct menu *menu) reset_dialog(); res = dialog_menu(prompt ? prompt : _("Main Menu"), _(menu_instructions), - rows, cols, rows - 10, active_menu, &s_scroll); - if (res == 1 || res == KEY_ESC) + if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) break; if (!item_activate_selected()) continue; @@ -617,7 +616,10 @@ static void conf(struct menu *menu) submenu = item_data(); active_menu = item_data(); - sym = submenu->sym; + if (submenu) + sym = submenu->sym; + else + sym = NULL; switch (res) { case 0: @@ -683,7 +685,7 @@ static void conf(struct menu *menu) static void show_textbox(const char *title, const char *text, int r, int c) { reset_dialog(); - dialog_textbox(title, text, r ? r : rows, c ? c : cols); + dialog_textbox(title, text, r, c); } static void show_helptext(const char *title, const char *text) @@ -756,6 +758,8 @@ static void conf_choice(struct menu *menu) break; case KEY_ESC: return; + case -ERRDISPLAYTOOSMALL: + return; } } } -- cgit v1.2.3-58-ga151