aboutsummaryrefslogtreecommitdiff
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-27 08:36:29 -0400
committerGitHub <noreply@github.com>2018-03-27 08:36:29 -0400
commitef169fcaeb17ec40cf83e54bba2ddbdcff10936f (patch)
treedb2771489afbfbffcc77a038867bcc45117ba38a /swaybar/render.c
parent45f14fcb24b6dae8bb78efb1ec7d7a51cb9a4d2c (diff)
parent54444e7587589309e329c539ed2b2d505b443ba7 (diff)
Merge pull request #1636 from jrouleau/master
swaybar: correctly render min_width for strings
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c7
1 files changed, 7 insertions, 0 deletions
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;
}