From 54444e7587589309e329c539ed2b2d505b443ba7 Mon Sep 17 00:00:00 2001 From: Jonathan Rouleau Date: Tue, 27 Mar 2018 01:14:03 +0000 Subject: swaybar: correctly render min_width for strings fixes #1635 --- swaybar/render.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'swaybar/render.c') diff --git a/swaybar/render.c b/swaybar/render.c index e874fc86..b3494351 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -61,6 +61,13 @@ static void render_block(struct window *window, struct config *config, struct st int textwidth = width; double block_width = width; + if (block->min_width_str) { + int w, h; + get_text_size(window->cairo, window->font, &w, &h, + window->scale, block->markup, "%s", block->min_width_str); + block->min_width = w; + } + if (width < block->min_width) { width = block->min_width; } -- cgit v1.2.3