summaryrefslogtreecommitdiffstats
path: root/support/kconfig/lxdialog/menubox.c
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2013-11-14 00:53:35 +0100
committerPeter Korsgaard <peter@korsgaard.com>2013-11-14 12:34:49 +0100
commitb48e35a28a6391ec16f09df66ad5b1065330f265 (patch)
tree83e955dab61ba5cca95707c2b7920e74ec99e2d0 /support/kconfig/lxdialog/menubox.c
parent147be50283c49ed15a6b56aaa5d455eec92c9615 (diff)
downloadbuildroot-b48e35a28a6391ec16f09df66ad5b1065330f265.tar.gz
buildroot-b48e35a28a6391ec16f09df66ad5b1065330f265.zip
support/kconfig: bump to kconfig from linux-3.12
With this, we can trash our probability patch, it's now upstream. Refresh a few other patches. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'support/kconfig/lxdialog/menubox.c')
-rw-r--r--support/kconfig/lxdialog/menubox.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/support/kconfig/lxdialog/menubox.c b/support/kconfig/lxdialog/menubox.c
index 6fc7e7821f..b0d0d698e1 100644
--- a/support/kconfig/lxdialog/menubox.c
+++ b/support/kconfig/lxdialog/menubox.c
@@ -193,7 +193,7 @@ int dialog_menu(const char *title, const char *prompt,
do_resize:
height = getmaxy(stdscr);
width = getmaxx(stdscr);
- if (height < 15 || width < 65)
+ if (height < MENUBOX_HEIGTH_MIN || width < MENUBOX_WIDTH_MIN)
return -ERRDISPLAYTOOSMALL;
height -= 4;
@@ -203,8 +203,8 @@ do_resize:
max_choice = MIN(menu_height, item_count());
/* 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);
@@ -303,10 +303,11 @@ do_resize:
}
}
- if (i < max_choice ||
- key == KEY_UP || key == KEY_DOWN ||
- key == '-' || key == '+' ||
- key == KEY_PPAGE || key == KEY_NPAGE) {
+ if (item_count() != 0 &&
+ (i < max_choice ||
+ key == KEY_UP || key == KEY_DOWN ||
+ key == '-' || key == '+' ||
+ key == KEY_PPAGE || key == KEY_NPAGE)) {
/* Remove highligt of current item */
print_item(scroll + choice, choice, FALSE);
OpenPOWER on IntegriCloud