aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-04-29 13:22:06 -0400
committerSam Anthony <sam@samanthony.xyz>2025-04-29 13:22:06 -0400
commita7284d1250b3605a471daddb9a214c2fa5978f82 (patch)
tree3eee7c469dc50aa2409ba38e8d1b9a1da4187023 /main.c
parenta9a75f182ad82cf54ca62a5c1e2d1cebc310c850 (diff)
downloadvolute-a7284d1250b3605a471daddb9a214c2fa5978f82.zip
image widget
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/main.c b/main.c
index 60781a9..1edaeda 100644
--- a/main.c
+++ b/main.c
@@ -396,24 +396,18 @@ comp_select(mu_Context *ctx, UI *ui) {
static void
comp_img(mu_Context *ctx, UI *ui) {
+ int w, h;
mu_Rect r;
- const char *data;
- int id, w, h;
+ /* Row that covers the rest of the window. */
r_get_window_size(&w, &h);
mu_layout_row(ctx, 1, &w, h);
-
- data = ui->comps[ui->comp_select.idx].imgfile;
- id = mu_get_id(ctx, &data, sizeof(data));
-
r = mu_layout_next(ctx);
r.w = w - r.x - ctx->style->spacing;
r.h = h - r.y - ctx->style->spacing;
mu_layout_set_next(ctx, r, 0);
- mu_update_control(ctx, id, r, 0);
-
- mu_draw_icon(ctx, 0, r, (mu_Color) {0, 0, 0, 0});
+ w_image(ctx, &ui->comp_img);
}
static void