aboutsummaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/draw.c b/src/draw.c
index d9e999b..91ae186 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -151,7 +151,10 @@ void draw_compute_layout(Drawable *draw, GList *btns, cairo_t *cr)
layout->text_w = ceil(text_w / scale);
layout->text_h = ceil(text_h / scale);
- layout->width = btn->fixed_size ? height : layout->text_w + 2 * radius;
+ // If there is only one glyph the button should be round
+ size_t text_l = g_utf8_strlen(btn->text, -1);
+
+ layout->width = text_l == 1 ? height : layout->text_w + 2 * radius;
layout->height = height;
draw->layouts = g_list_append(draw->layouts, layout);