mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
parent
7cb18415b8
commit
255ec70534
7 changed files with 15 additions and 6 deletions
|
|
@ -65,10 +65,11 @@ int dialog_checklist(unsigned char *title, unsigned char *prompt, int height, in
|
|||
height = strheight(prompt)+list_height+4+2;
|
||||
if (width < 0) {
|
||||
i = strwidth(prompt);
|
||||
j = strwidth(title);
|
||||
j = ((title != NULL) ? strwidth(title) : 0);
|
||||
width = MAX(i,j);
|
||||
width = MAX(width,check_x+4)+4;
|
||||
}
|
||||
width = MAX(width,24);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int
|
|||
height = strheight(prompt)+2+4;
|
||||
if (width < 0) {
|
||||
i = strwidth(prompt);
|
||||
j = strwidth(title);
|
||||
j = ((title != NULL) ? strwidth(title) : 0);
|
||||
width = MAX(i,j) + 4;
|
||||
}
|
||||
width = MAX(width,24);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
|
|
|
|||
|
|
@ -55,10 +55,11 @@ int dialog_menu(unsigned char *title, unsigned char *prompt, int height, int wid
|
|||
height = strheight(prompt)+menu_height+4+2;
|
||||
if (width < 0) {
|
||||
i = strwidth(prompt);
|
||||
j = strwidth(title);
|
||||
j = ((title != NULL) ? strwidth(title) : 0);
|
||||
width = MAX(i,j);
|
||||
width = MAX(width,tag_x+4)+4;
|
||||
}
|
||||
width = MAX(width,24);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
|
|
|
|||
|
|
@ -36,9 +36,11 @@ int dialog_msgbox(unsigned char *title, unsigned char *prompt, int height, int w
|
|||
height = strheight(prompt)+2+2*(!!pause);
|
||||
if (width < 0) {
|
||||
i = strwidth(prompt);
|
||||
j = strwidth(title);
|
||||
j = ((title != NULL) ? strwidth(title) : 0);
|
||||
width = MAX(i,j)+4;
|
||||
}
|
||||
if (pause)
|
||||
width = MAX(width,10);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ int dialog_prgbox(unsigned char *title, const unsigned char *line, int height, i
|
|||
fprintf(stderr, "\nAutosizing is impossible in dialog_prgbox().\n");
|
||||
exit(-1);
|
||||
}
|
||||
width = MAX(width,10);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
if (height > LINES)
|
||||
|
|
|
|||
|
|
@ -73,10 +73,11 @@ int dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, in
|
|||
height = strheight(prompt)+list_height+4+2;
|
||||
if (width < 0) {
|
||||
i = strwidth(prompt);
|
||||
j = strwidth(title);
|
||||
j = ((title != NULL) ? strwidth(title) : 0);
|
||||
width = MAX(i,j);
|
||||
width = MAX(width,check_x+4)+4;
|
||||
}
|
||||
width = MAX(width,24);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
|
|
|
|||
|
|
@ -35,9 +35,10 @@ int dialog_yesno(unsigned char *title, unsigned char * prompt, int height, int w
|
|||
height = strheight(prompt)+4;
|
||||
if (width < 0) {
|
||||
i = strwidth(prompt);
|
||||
j = strwidth(title);
|
||||
j = ((title != NULL) ? strwidth(title) : 0);
|
||||
width = MAX(i,j)+4;
|
||||
}
|
||||
width = MAX(width,23);
|
||||
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
|
|
|
|||
Loading…
Reference in a new issue