aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/nconf.gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/nconf.gui.c')
-rw-r--r--scripts/kconfig/nconf.gui.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 9f8c44ecc703..8275f0e55106 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -276,8 +276,8 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...)
276 276
277 total_width = max(msg_width, btns_width); 277 total_width = max(msg_width, btns_width);
278 /* place dialog in middle of screen */ 278 /* place dialog in middle of screen */
279 y = (LINES-(msg_lines+4))/2; 279 y = (getmaxy(stdscr)-(msg_lines+4))/2;
280 x = (COLS-(total_width+4))/2; 280 x = (getmaxx(stdscr)-(total_width+4))/2;
281 281
282 282
283 /* create the windows */ 283 /* create the windows */
@@ -387,8 +387,8 @@ int dialog_inputbox(WINDOW *main_window,
387 prompt_width = max(prompt_width, strlen(title)); 387 prompt_width = max(prompt_width, strlen(title));
388 388
389 /* place dialog in middle of screen */ 389 /* place dialog in middle of screen */
390 y = (LINES-(prompt_lines+4))/2; 390 y = (getmaxy(stdscr)-(prompt_lines+4))/2;
391 x = (COLS-(prompt_width+4))/2; 391 x = (getmaxx(stdscr)-(prompt_width+4))/2;
392 392
393 strncpy(result, init, *result_len); 393 strncpy(result, init, *result_len);
394 394
@@ -545,7 +545,7 @@ void show_scroll_win(WINDOW *main_window,
545{ 545{
546 int res; 546 int res;
547 int total_lines = get_line_no(text); 547 int total_lines = get_line_no(text);
548 int x, y; 548 int x, y, lines, columns;
549 int start_x = 0, start_y = 0; 549 int start_x = 0, start_y = 0;
550 int text_lines = 0, text_cols = 0; 550 int text_lines = 0, text_cols = 0;
551 int total_cols = 0; 551 int total_cols = 0;
@@ -556,6 +556,8 @@ void show_scroll_win(WINDOW *main_window,
556 WINDOW *pad; 556 WINDOW *pad;
557 PANEL *panel; 557 PANEL *panel;
558 558
559 getmaxyx(stdscr, lines, columns);
560
559 /* find the widest line of msg: */ 561 /* find the widest line of msg: */
560 total_lines = get_line_no(text); 562 total_lines = get_line_no(text);
561 for (i = 0; i < total_lines; i++) { 563 for (i = 0; i < total_lines; i++) {
@@ -569,14 +571,14 @@ void show_scroll_win(WINDOW *main_window,
569 (void) wattrset(pad, attributes[SCROLLWIN_TEXT]); 571 (void) wattrset(pad, attributes[SCROLLWIN_TEXT]);
570 fill_window(pad, text); 572 fill_window(pad, text);
571 573
572 win_lines = min(total_lines+4, LINES-2); 574 win_lines = min(total_lines+4, lines-2);
573 win_cols = min(total_cols+2, COLS-2); 575 win_cols = min(total_cols+2, columns-2);
574 text_lines = max(win_lines-4, 0); 576 text_lines = max(win_lines-4, 0);
575 text_cols = max(win_cols-2, 0); 577 text_cols = max(win_cols-2, 0);
576 578
577 /* place window in middle of screen */ 579 /* place window in middle of screen */
578 y = (LINES-win_lines)/2; 580 y = (lines-win_lines)/2;
579 x = (COLS-win_cols)/2; 581 x = (columns-win_cols)/2;
580 582
581 win = newwin(win_lines, win_cols, y, x); 583 win = newwin(win_lines, win_cols, y, x);
582 keypad(win, TRUE); 584 keypad(win, TRUE);