diff options
| author | Federico Angelilli <code@fedang.net> | 2024-07-09 17:02:42 +0200 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-07-09 17:02:42 +0200 |
| commit | 0c567c67933cc48ac57f08167d88a57ce0504524 (patch) | |
| tree | da7c5ccc0935093cf5ecc661371db324ea0005cb /src/layout.c | |
| parent | 28adc6b395d2fb7545189636cec3651b9c2a5f73 (diff) | |
Add event handling
Diffstat (limited to 'src/layout.c')
| -rw-r--r-- | src/layout.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |
