mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
[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:
parent
a11328c354
commit
ccb75758b4
@ -131,7 +131,7 @@ struct dialog {
|
|||||||
static inline int
|
static inline int
|
||||||
dialog_max_width(struct terminal *term)
|
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));
|
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
|
static inline int
|
||||||
dialog_max_height(struct terminal *term)
|
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));
|
int_bounds(&height, 1, int_max(term->height - 2 * DIALOG_TB, 1));
|
||||||
|
|
||||||
|
@ -51,6 +51,9 @@
|
|||||||
#define DIALOG_FRAME 2
|
#define DIALOG_FRAME 2
|
||||||
#define DIALOG_MIN_WIDTH 42
|
#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_LB (DIALOG_LEFT_BORDER + DIALOG_LEFT_INNER_BORDER + 1)
|
||||||
#define DIALOG_TB (DIALOG_TOP_BORDER + DIALOG_TOP_INNER_BORDER + 1)
|
#define DIALOG_TB (DIALOG_TOP_BORDER + DIALOG_TOP_INNER_BORDER + 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user