diff options
| author | Federico Angelilli <code@fedang.net> | 2023-11-19 02:18:01 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-11-19 02:18:01 +0100 |
| commit | bd327c61eb3c59458b197e70f6c091d81dbde1ba (patch) | |
| tree | 060fdeb5eef88c76f9b5439fa8b26069a6a5dca9 /src/draw.c | |
| parent | 07646612acbc833ec50479eee3564af37636f272 (diff) | |
Simplify button shape handling
Diffstat (limited to 'src/draw.c')
| -rw-r--r-- | src/draw.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |
