From b94e342ea59c9d13ef1e380834534c1c1c8a83ec Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Wed, 11 Sep 2024 22:20:04 +0200 Subject: Add collapse option to groups --- src/layout.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/layout.c') diff --git a/src/layout.c b/src/layout.c index 6b6590e..92e6469 100644 --- a/src/layout.c +++ b/src/layout.c @@ -32,7 +32,12 @@ void layout_init(layout_t *layout, block_t *block, layout_info_t info) layout->n_children++; } - if (layout->n_children > 0) { + if (block->group.collapse && layout->n_children == 1) { + layout_t *children = layout->children; + memcpy(layout, children, sizeof(layout_t)); + free(children); + + } else if (layout->n_children > 0) { layout_t *last = &layout->children[layout->n_children - 1]; layout->width = last->x + last->width - x_offset; -- cgit v1.2.3