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, 10 insertions, 0 deletions
diff --git a/src/draw.c b/src/draw.c
index 5a43a51..51a8a59 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -187,6 +187,15 @@ static void compute_width(Drawer *draw, Window *win)
log_debug("Draw context width calculated [width=%d]", draw->width);
}
+static void layout_check_width(Layout *layout)
+{
+ if (layout->btn->max_width > 0)
+ layout->width = MIN(layout->btn->max_width, layout->width);
+
+ if (layout->btn->min_width > 0)
+ layout->width = MAX(layout->btn->min_width, layout->width);
+}
+
static GList *compute_group_layout(Drawer *draw, GList *btns, int bx, bool root)
{
GList *layouts = NULL;
@@ -242,6 +251,7 @@ retry:
// NOTE: We add half a line width on both sides
layout->width += layout->line_w;
+ layout_check_width(layout);
// Apply layout_func on the layout
ANIMATION(btn, layout, layout);