diff --git a/src/bfu/dialog.h b/src/bfu/dialog.h index e6a277bd..6236511f 100644 --- a/src/bfu/dialog.h +++ b/src/bfu/dialog.h @@ -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)); diff --git a/src/setup.h b/src/setup.h index 7f76be3e..589ff064 100644 --- a/src/setup.h +++ b/src/setup.h @@ -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)