From 0c567c67933cc48ac57f08167d88a57ce0504524 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Tue, 9 Jul 2024 17:02:42 +0200 Subject: Add event handling --- src/layout.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/layout.c') diff --git a/src/layout.c b/src/layout.c index db6e435..126e2f5 100644 --- a/src/layout.c +++ b/src/layout.c @@ -20,6 +20,7 @@ layout_t *layout_create(block_t *block, layout_info_t info) if (block->type == BLOCK_GROUP) { layout->children = calloc(block->group.n_children, sizeof(layout_t)); + int x = info.x_offset; for (int i = 0; i < block->group.n_children; i++) { if (block->group.children[i].hidden) @@ -29,6 +30,9 @@ layout_t *layout_create(block_t *block, layout_info_t info) info.x_offset += child->width + block->group.spacing; layout->children[layout->n_children++] = child; } + + layout_t *last = layout->children[layout->n_children - 1]; + layout->width = last->x + last->width - x; } else if (block->type == BLOCK_TEXT) { layout->pl = pango_layout_new(info.context); -- cgit v1.2.3