diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-07-29 16:48:57 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.ravnborg.org> | 2006-09-30 05:19:20 -0400 |
commit | c8dc68ad0fbd934e78e913b8a8d7b45945db4930 (patch) | |
tree | 62169927ce5ca83e3f280e6bbe06053989462968 /scripts/kconfig/lxdialog/checklist.c | |
parent | f3cbcdc955d0d2c8b4c52d6b73fc536b01b68c64 (diff) |
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 <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lxdialog/checklist.c')
-rw-r--r-- | scripts/kconfig/lxdialog/checklist.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c index 39becb72444a..cf697080dddd 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, | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | do_resize: | ||
129 | if (getmaxy(stdscr) < (height + 6)) | ||
130 | return -ERRDISPLAYTOOSMALL; | ||
131 | if (getmaxx(stdscr) < (width + 6)) | ||
132 | return -ERRDISPLAYTOOSMALL; | ||
133 | |||
128 | max_choice = MIN(list_height, item_count()); | 134 | max_choice = MIN(list_height, item_count()); |
129 | 135 | ||
130 | /* center dialog box on screen */ | 136 | /* center dialog box on screen */ |
@@ -303,6 +309,11 @@ int dialog_checklist(const char *title, const char *prompt, int height, | |||
303 | case KEY_ESC: | 309 | case KEY_ESC: |
304 | key = on_key_esc(dialog); | 310 | key = on_key_esc(dialog); |
305 | break; | 311 | break; |
312 | case KEY_RESIZE: | ||
313 | delwin(list); | ||
314 | delwin(dialog); | ||
315 | on_key_resize(); | ||
316 | goto do_resize; | ||
306 | } | 317 | } |
307 | 318 | ||
308 | /* Now, update everything... */ | 319 | /* Now, update everything... */ |