aboutsummaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/draw.c b/src/draw.c
index f571671..292f2d2 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -200,6 +200,7 @@ static GList *compute_group_layout(Drawer *draw, GList *btns, int bx, bool root)
GList *layouts = NULL;
for (GList *it = btns; it; it = it->next) {
Button *btn = it->data;
+ PangoAlignment align = btn->align;
Layout *layout = g_malloc0(sizeof(Layout));
layouts = g_list_prepend(layouts, layout);
@@ -216,7 +217,8 @@ retry:
ButtonGroup *group = CAST(btn, ButtonGroup);
g_assert_nonnull(group->children);
- // If there is only one child treat a group like a single button
+ // NOTE: If a group has only one children treat it as a single button
+ // As a consequence btn->align can't be trusted
if (group->children->next == NULL) {
layout->btn = btn = group->children->data;
g_assert_true(btn->simple);
@@ -254,11 +256,11 @@ retry:
bx += layout->width;
if (root) {
- draw->layout_bx[btn->align] = bx;
- draw->layout_end[btn->align] = layouts;
+ draw->layout_bx[align] = bx;
+ draw->layout_end[align] = layouts;
}
- if (it->next != NULL && (!root || CAST(it->next->data, Button)->align == btn->align))
+ if (it->next != NULL && (!root || CAST(it->next->data, Button)->align == align))
bx += draw->sep;
}