aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-04-10 16:08:08 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-04-10 16:08:08 +1000
commit1a0d367f227fddd026ddf2a1bd21c5edbb111b00 (patch)
treef9ff84fd470e8d838ecb724fc31f791962c575de /swaybar/render.c
parentMerge pull request #1788 from thejan2009/move_auto_back_and_forth (diff)
downloadsway-1a0d367f227fddd026ddf2a1bd21c5edbb111b00.tar.gz
sway-1a0d367f227fddd026ddf2a1bd21c5edbb111b00.tar.zst
sway-1a0d367f227fddd026ddf2a1bd21c5edbb111b00.zip
Fix swaybar not showing all status blocks.
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 28296f31..8681532a 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -154,15 +154,14 @@ static uint32_t render_status_block(cairo_t *cairo,
154 block_width += block->border_right + margin; 154 block_width += block->border_right + margin;
155 } 155 }
156 156
157 int sep_width; 157 int sep_width, sep_height;
158 if (!edge) { 158 if (!edge) {
159 if (config->sep_symbol) { 159 if (config->sep_symbol) {
160 int _height; 160 get_text_size(cairo, config->font, &sep_width, &sep_height,
161 get_text_size(cairo, config->font, &sep_width, &_height,
162 output->scale, false, "%s", config->sep_symbol); 161 output->scale, false, "%s", config->sep_symbol);
163 uint32_t _ideal_height = _height + ws_vertical_padding * 2; 162 uint32_t _ideal_height = sep_height + ws_vertical_padding * 2;
164 if ((uint32_t)_height < _ideal_height / output->scale) { 163 if (_ideal_height * output->scale > height) {
165 return _height / output->scale; 164 return _ideal_height;
166 } 165 }
167 if (sep_width > block->separator_block_width) { 166 if (sep_width > block->separator_block_width) {
168 block->separator_block_width = sep_width + margin * 2; 167 block->separator_block_width = sep_width + margin * 2;
@@ -240,7 +239,7 @@ static uint32_t render_status_block(cairo_t *cairo,
240 } 239 }
241 if (config->sep_symbol) { 240 if (config->sep_symbol) {
242 offset = pos + (block->separator_block_width - sep_width) / 2; 241 offset = pos + (block->separator_block_width - sep_width) / 2;
243 cairo_move_to(cairo, offset, margin); 242 cairo_move_to(cairo, offset, height / 2.0 - sep_height / 2.0);
244 pango_printf(cairo, config->font, output->scale, false, 243 pango_printf(cairo, config->font, output->scale, false,
245 "%s", config->sep_symbol); 244 "%s", config->sep_symbol);
246 } else { 245 } else {