projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drm/rockchip: dw_hdmi-rockchip: get phy config from dts
[firefly-linux-kernel-4.4.55.git]
/
scripts
/
kconfig
/
nconf.gui.c
diff --git
a/scripts/kconfig/nconf.gui.c
b/scripts/kconfig/nconf.gui.c
index 9f8c44ecc703a1ea9cd27d3e656e5352f8e6ba86..4b2f44c20caf8941d150f261074b40d589a10376 100644
(file)
--- 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, ...)
total_width = max(msg_width, btns_width);
/* place dialog in middle of screen */
total_width = max(msg_width, btns_width);
/* place dialog in middle of screen */
- y = (
LINES
-(msg_lines+4))/2;
- x = (
COLS
-(total_width+4))/2;
+ y = (
getmaxy(stdscr)
-(msg_lines+4))/2;
+ x = (
getmaxx(stdscr)
-(total_width+4))/2;
/* create the windows */
/* create the windows */
@@
-364,12
+364,14
@@
int dialog_inputbox(WINDOW *main_window,
WINDOW *prompt_win;
WINDOW *form_win;
PANEL *panel;
WINDOW *prompt_win;
WINDOW *form_win;
PANEL *panel;
- int i, x, y;
+ int i, x, y
, lines, columns, win_lines, win_cols
;
int res = -1;
int cursor_position = strlen(init);
int cursor_form_win;
char *result = *resultp;
int res = -1;
int cursor_position = strlen(init);
int cursor_form_win;
char *result = *resultp;
+ getmaxyx(stdscr, lines, columns);
+
if (strlen(init)+1 > *result_len) {
*result_len = strlen(init)+1;
*resultp = result = realloc(result, *result_len);
if (strlen(init)+1 > *result_len) {
*result_len = strlen(init)+1;
*resultp = result = realloc(result, *result_len);
@@
-386,14
+388,19
@@
int dialog_inputbox(WINDOW *main_window,
if (title)
prompt_width = max(prompt_width, strlen(title));
if (title)
prompt_width = max(prompt_width, strlen(title));
+ win_lines = min(prompt_lines+6, lines-2);
+ win_cols = min(prompt_width+7, columns-2);
+ prompt_lines = max(win_lines-6, 0);
+ prompt_width = max(win_cols-7, 0);
+
/* place dialog in middle of screen */
/* place dialog in middle of screen */
- y = (
LINES-(prompt_lines+4)
)/2;
- x = (
COLS-(prompt_width+4)
)/2;
+ y = (
lines-win_lines
)/2;
+ x = (
columns-win_cols
)/2;
strncpy(result, init, *result_len);
/* create the windows */
strncpy(result, init, *result_len);
/* create the windows */
- win = newwin(
prompt_lines+6, prompt_width+7
, y, x);
+ win = newwin(
win_lines, win_cols
, y, x);
prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2);
form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
keypad(form_win, TRUE);
prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2);
form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
keypad(form_win, TRUE);
@@
-545,7
+552,7
@@
void show_scroll_win(WINDOW *main_window,
{
int res;
int total_lines = get_line_no(text);
{
int res;
int total_lines = get_line_no(text);
- int x, y;
+ int x, y
, lines, columns
;
int start_x = 0, start_y = 0;
int text_lines = 0, text_cols = 0;
int total_cols = 0;
int start_x = 0, start_y = 0;
int text_lines = 0, text_cols = 0;
int total_cols = 0;
@@
-556,6
+563,8
@@
void show_scroll_win(WINDOW *main_window,
WINDOW *pad;
PANEL *panel;
WINDOW *pad;
PANEL *panel;
+ getmaxyx(stdscr, lines, columns);
+
/* find the widest line of msg: */
total_lines = get_line_no(text);
for (i = 0; i < total_lines; i++) {
/* find the widest line of msg: */
total_lines = get_line_no(text);
for (i = 0; i < total_lines; i++) {
@@
-569,14
+578,14
@@
void show_scroll_win(WINDOW *main_window,
(void) wattrset(pad, attributes[SCROLLWIN_TEXT]);
fill_window(pad, text);
(void) wattrset(pad, attributes[SCROLLWIN_TEXT]);
fill_window(pad, text);
- win_lines = min(total_lines+4,
LINES
-2);
- win_cols = min(total_cols+2,
COLS
-2);
+ win_lines = min(total_lines+4,
lines
-2);
+ win_cols = min(total_cols+2,
columns
-2);
text_lines = max(win_lines-4, 0);
text_cols = max(win_cols-2, 0);
/* place window in middle of screen */
text_lines = max(win_lines-4, 0);
text_cols = max(win_cols-2, 0);
/* place window in middle of screen */
- y = (
LINES
-win_lines)/2;
- x = (
COLS
-win_cols)/2;
+ y = (
lines
-win_lines)/2;
+ x = (
columns
-win_cols)/2;
win = newwin(win_lines, win_cols, y, x);
keypad(win, TRUE);
win = newwin(win_lines, win_cols, y, x);
keypad(win, TRUE);