diff options
author | emersion <contact@emersion.fr> | 2018-04-10 18:38:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-10 18:38:43 -0400 |
commit | 84243a708e1f2bb6db6b04550b798dea5a5049d6 (patch) | |
tree | 8850a8528f1e241a9a0ea3247c43840e371e29cf /swaybar/render.c | |
parent | Merge pull request #1793 from PyroLagus/input-simulation (diff) | |
parent | Check height in surface local coordinates and rename some variables. (diff) | |
download | sway-84243a708e1f2bb6db6b04550b798dea5a5049d6.tar.gz sway-84243a708e1f2bb6db6b04550b798dea5a5049d6.tar.zst sway-84243a708e1f2bb6db6b04550b798dea5a5049d6.zip |
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.c | 14 |
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, | |||
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_surface_height = ws_vertical_padding * 2 |
164 | if ((uint32_t)_height < _ideal_height / output->scale) { | 163 | + sep_height; |
165 | return _height / output->scale; | 164 | if (_ideal_surface_height > surface_height) { |
165 | return _ideal_surface_height; | ||
166 | } | 166 | } |
167 | if (sep_width > block->separator_block_width) { | 167 | if (sep_width > block->separator_block_width) { |
168 | block->separator_block_width = sep_width + margin * 2; | 168 | block->separator_block_width = sep_width + margin * 2; |
@@ -240,7 +240,7 @@ static uint32_t render_status_block(cairo_t *cairo, | |||
240 | } | 240 | } |
241 | if (config->sep_symbol) { | 241 | if (config->sep_symbol) { |
242 | offset = pos + (block->separator_block_width - sep_width) / 2; | 242 | offset = pos + (block->separator_block_width - sep_width) / 2; |
243 | cairo_move_to(cairo, offset, margin); | 243 | cairo_move_to(cairo, offset, height / 2.0 - sep_height / 2.0); |
244 | pango_printf(cairo, config->font, output->scale, false, | 244 | pango_printf(cairo, config->font, output->scale, false, |
245 | "%s", config->sep_symbol); | 245 | "%s", config->sep_symbol); |
246 | } else { | 246 | } else { |