X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fconfig%2Flxdialog%2Fchecklist.c;h=8d016faa28d704be886cb1c6195a3bdca78d29b0;hb=2fbbe49c0ac77681c069743e84b711b2a4967dbf;hp=a2eb80fbc896fe28b2b0f8efc614cf83fcbfc7b8;hpb=3c10624a8ee0bd49c213b878c109612d3ad4333e;p=openwrt.git diff --git a/scripts/config/lxdialog/checklist.c b/scripts/config/lxdialog/checklist.c index a2eb80fbc8..8d016faa28 100644 --- a/scripts/config/lxdialog/checklist.c +++ b/scripts/config/lxdialog/checklist.c @@ -132,16 +132,16 @@ int dialog_checklist(const char *title, const char *prompt, int height, } do_resize: - if (getmaxy(stdscr) < (height + 6)) + if (getmaxy(stdscr) < (height + CHECKLIST_HEIGTH_MIN)) return -ERRDISPLAYTOOSMALL; - if (getmaxx(stdscr) < (width + 6)) + if (getmaxx(stdscr) < (width + CHECKLIST_WIDTH_MIN)) return -ERRDISPLAYTOOSMALL; max_choice = MIN(list_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); @@ -168,13 +168,13 @@ do_resize: /* create new window for the list */ list = subwin(dialog, list_height, list_width, y + box_y + 1, - x + box_x + 1); + x + box_x + 1); keypad(list, TRUE); /* draw a box around the list items */ draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, - dlg.menubox_border.atr, dlg.menubox.atr); + dlg.menubox_border.atr, dlg.menubox.atr); /* Find length of longest item in order to center checklist */ check_x = 0;