1
0
Fork 0

[dialogs] Make 9 / 10 ratio configurable at compile time.

DIALOG_WIDTH_RATIO and DIALOG_HEIGHT_RATIO in src/setup.h
This commit is contained in:
Witold Filipczyk 2021-08-23 16:11:17 +02:00
parent a11328c354
commit ccb75758b4
2 changed files with 5 additions and 2 deletions

View File

@ -131,7 +131,7 @@ struct dialog {
static inline int
dialog_max_width(struct terminal *term)
{
int width = term->width * 9 / 10 - 2 * DIALOG_LB;
int width = term->width * DIALOG_WIDTH_RATIO - 2 * DIALOG_LB;
int_bounds(&width, 1, int_max(term->width - 2 * DIALOG_LB, 1));
@ -141,7 +141,7 @@ dialog_max_width(struct terminal *term)
static inline int
dialog_max_height(struct terminal *term)
{
int height = term->height * 9 / 10 - 2 * DIALOG_TB;
int height = term->height * DIALOG_HEIGHT_RATIO - 2 * DIALOG_TB;
int_bounds(&height, 1, int_max(term->height - 2 * DIALOG_TB, 1));

View File

@ -51,6 +51,9 @@
#define DIALOG_FRAME 2
#define DIALOG_MIN_WIDTH 42
#define DIALOG_WIDTH_RATIO 0.9
#define DIALOG_HEIGHT_RATIO 0.9
#define DIALOG_LB (DIALOG_LEFT_BORDER + DIALOG_LEFT_INNER_BORDER + 1)
#define DIALOG_TB (DIALOG_TOP_BORDER + DIALOG_TOP_INNER_BORDER + 1)