aboutsummaryrefslogtreecommitdiff
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2018-04-10 18:38:43 -0400
committerFurkan Sahin <furkan-dev@proton.me>2018-04-10 18:38:43 -0400
commitddc8b9a1b5249c9f9571756185775a5634953fc7 (patch)
tree8850a8528f1e241a9a0ea3247c43840e371e29cf /swaybar/render.c
parent692284e0002636bad74b4f0e029baa16061987aa (diff)
parent890c6005f0766fa17aeb4d4f74de280a920e0e67 (diff)
Merge pull request #1792 from RyanDwyer/fix-swaybar-status-blocks
Fix swaybar not showing all status blocks
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 28296f31..3fd8da0b 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -154,15 +154,15 @@ static uint32_t render_status_block(cairo_t *cairo,
block_width += block->border_right + margin;
}
- int sep_width;
+ int sep_width, sep_height;
if (!edge) {
if (config->sep_symbol) {
- int _height;
- get_text_size(cairo, config->font, &sep_width, &_height,
+ get_text_size(cairo, config->font, &sep_width, &sep_height,
output->scale, false, "%s", config->sep_symbol);
- uint32_t _ideal_height = _height + ws_vertical_padding * 2;
- if ((uint32_t)_height < _ideal_height / output->scale) {
- return _height / output->scale;
+ uint32_t _ideal_surface_height = ws_vertical_padding * 2
+ + sep_height;
+ if (_ideal_surface_height > surface_height) {
+ return _ideal_surface_height;
}
if (sep_width > block->separator_block_width) {
block->separator_block_width = sep_width + margin * 2;
@@ -240,7 +240,7 @@ static uint32_t render_status_block(cairo_t *cairo,
}
if (config->sep_symbol) {
offset = pos + (block->separator_block_width - sep_width) / 2;
- cairo_move_to(cairo, offset, margin);
+ cairo_move_to(cairo, offset, height / 2.0 - sep_height / 2.0);
pango_printf(cairo, config->font, output->scale, false,
"%s", config->sep_symbol);
} else {