diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-02-28 14:04:53 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-02-28 14:04:53 -0500 |
| commit | 5beba4bea306dc0bbae9d1092fa187514ca96d98 (patch) | |
| tree | 1d1ddde162145202909ab4f17d82086112cab1f3 | |
| parent | e0b42abda8d5d4e6e350ccd15618f7a2f1b14f6c (diff) | |
| download | volute-5beba4bea306dc0bbae9d1092fa187514ca96d98.zip | |
padding functions
| -rw-r--r-- | main.c | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -61,6 +61,8 @@ static void rpm_row(mu_Context *ctx, UI *ui); static void map_row(mu_Context *ctx, UI *ui); static void ve_row(mu_Context *ctx, UI *ui); static void dup_del_row(mu_Context *ctx, UI *ui); +static void hpad(mu_Context *ctx, int w); +static void vpad(mu_Context *ctx, int h); /* Function Definitions. */ @@ -127,8 +129,7 @@ main_window(mu_Context *ctx, UI *ui) { displacement_row(ctx, ui); - mu_layout_row(ctx, 0, NULL, 0); - mu_label(ctx, ""); + vpad(ctx, 0); rpm_row(ctx, ui); map_row(ctx, ui); @@ -160,8 +161,7 @@ rpm_row(mu_Context *ctx, UI *ui) { mu_layout_row(ctx, 0, NULL, 0); mu_layout_width(ctx, LABEL_WIDTH); mu_label(ctx, "rpm:"); - mu_layout_width(ctx, UNIT_WIDTH); - mu_label(ctx, ""); + hpad(ctx, UNIT_WIDTH); mu_layout_width(ctx, FIELD_WIDTH); for (i = 0; i < ui->npoints; i++) { if (w_field(ctx, &ui->rpm[i])) { @@ -209,10 +209,8 @@ dup_del_row(mu_Context *ctx, UI *ui) { int i; mu_layout_row(ctx, 0, NULL, 0); - mu_layout_width(ctx, LABEL_WIDTH); - mu_label(ctx, ""); - mu_layout_width(ctx, UNIT_WIDTH); - mu_label(ctx, ""); + hpad(ctx, LABEL_WIDTH); + hpad(ctx, UNIT_WIDTH); mu_layout_width(ctx, (FIELD_WIDTH - ctx->style->spacing)/2); for (i = 0; i < ui->npoints; i++) { mu_push_id(ctx, &i, sizeof(i)); @@ -225,3 +223,15 @@ dup_del_row(mu_Context *ctx, UI *ui) { mu_pop_id(ctx); } } + +static void +hpad(mu_Context *ctx, int w) { + mu_layout_width(ctx, w); + mu_label(ctx, ""); +} + +static void +vpad(mu_Context *ctx, int h) { + mu_layout_row(ctx, 0, NULL, h); + mu_label(ctx, ""); +} |