summaryrefslogtreecommitdiffstats
path: root/swaybar
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/render.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index d78d7c90..96118c42 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -163,6 +163,7 @@ static uint32_t render_status_block(cairo_t *cairo,
163 } 163 }
164 164
165 int sep_width, sep_height; 165 int sep_width, sep_height;
166 int sep_block_width = block->separator_block_width;
166 if (!edge) { 167 if (!edge) {
167 if (config->sep_symbol) { 168 if (config->sep_symbol) {
168 get_text_size(cairo, config->font, &sep_width, &sep_height, NULL, 169 get_text_size(cairo, config->font, &sep_width, &sep_height, NULL,
@@ -172,11 +173,11 @@ static uint32_t render_status_block(cairo_t *cairo,
172 if (output->height < _ideal_surface_height) { 173 if (output->height < _ideal_surface_height) {
173 return _ideal_surface_height; 174 return _ideal_surface_height;
174 } 175 }
175 if (sep_width > block->separator_block_width) { 176 if (sep_width > sep_block_width) {
176 block->separator_block_width = sep_width + margin * 2; 177 sep_block_width = sep_width + margin * 2;
177 } 178 }
178 } 179 }
179 *x -= block->separator_block_width; 180 *x -= sep_block_width;
180 } else { 181 } else {
181 *x -= margin; 182 *x -= margin;
182 } 183 }
@@ -261,16 +262,14 @@ static uint32_t render_status_block(cairo_t *cairo,
261 cairo_set_source_u32(cairo, config->colors.separator); 262 cairo_set_source_u32(cairo, config->colors.separator);
262 } 263 }
263 if (config->sep_symbol) { 264 if (config->sep_symbol) {
264 offset = pos + (block->separator_block_width - sep_width) / 2; 265 offset = pos + (sep_block_width - sep_width) / 2;
265 cairo_move_to(cairo, offset, height / 2.0 - sep_height / 2.0); 266 cairo_move_to(cairo, offset, height / 2.0 - sep_height / 2.0);
266 pango_printf(cairo, config->font, output->scale, false, 267 pango_printf(cairo, config->font, output->scale, false,
267 "%s", config->sep_symbol); 268 "%s", config->sep_symbol);
268 } else { 269 } else {
269 cairo_set_line_width(cairo, 1); 270 cairo_set_line_width(cairo, 1);
270 cairo_move_to(cairo, 271 cairo_move_to(cairo, pos + sep_block_width / 2, margin);
271 pos + block->separator_block_width / 2, margin); 272 cairo_line_to(cairo, pos + sep_block_width / 2, height - margin);
272 cairo_line_to(cairo,
273 pos + block->separator_block_width / 2, height - margin);
274 cairo_stroke(cairo); 273 cairo_stroke(cairo);
275 } 274 }
276 } 275 }