aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-09 14:54:22 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-09 14:54:22 +1000
commite012b05b004b00c7be8ad321ce88f2302e2e7b37 (patch)
tree7a905193a0f552806548717862868e602d437968 /swaybar/render.c
parentMerge pull request #1942 from VincentVanlaer/xwayland-lazy (diff)
downloadsway-e012b05b004b00c7be8ad321ce88f2302e2e7b37.tar.gz
sway-e012b05b004b00c7be8ad321ce88f2302e2e7b37.tar.zst
sway-e012b05b004b00c7be8ad321ce88f2302e2e7b37.zip
Swaybar: Respect pango_markup config
Makes swaybar respect the user's pango_markup configuration in the workspace buttons and binding mode indicator.
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 26248d35..327a6f5f 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -298,7 +298,7 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo,
298 298
299 int text_width, text_height; 299 int text_width, text_height;
300 get_text_size(cairo, config->font, &text_width, &text_height, 300 get_text_size(cairo, config->font, &text_width, &text_height,
301 output->scale, true, "%s", mode); 301 output->scale, config->pango_markup, "%s", mode);
302 302
303 int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; 303 int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale;
304 int ws_horizontal_padding = WS_HORIZONTAL_PADDING * output->scale; 304 int ws_horizontal_padding = WS_HORIZONTAL_PADDING * output->scale;
@@ -329,7 +329,8 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo,
329 double text_y = height / 2.0 - text_height / 2.0; 329 double text_y = height / 2.0 - text_height / 2.0;
330 cairo_set_source_u32(cairo, config->colors.binding_mode.text); 330 cairo_set_source_u32(cairo, config->colors.binding_mode.text);
331 cairo_move_to(cairo, x + width / 2 - text_width / 2, (int)floor(text_y)); 331 cairo_move_to(cairo, x + width / 2 - text_width / 2, (int)floor(text_y));
332 pango_printf(cairo, config->font, output->scale, true, "%s", mode); 332 pango_printf(cairo, config->font, output->scale, config->pango_markup,
333 "%s", mode);
333 return surface_height; 334 return surface_height;
334} 335}
335 336
@@ -374,7 +375,7 @@ static uint32_t render_workspace_button(cairo_t *cairo,
374 375
375 int text_width, text_height; 376 int text_width, text_height;
376 get_text_size(cairo, config->font, &text_width, &text_height, 377 get_text_size(cairo, config->font, &text_width, &text_height,
377 output->scale, true, "%s", name); 378 output->scale, config->pango_markup, "%s", name);
378 379
379 int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; 380 int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale;
380 int ws_horizontal_padding = WS_HORIZONTAL_PADDING * output->scale; 381 int ws_horizontal_padding = WS_HORIZONTAL_PADDING * output->scale;
@@ -406,7 +407,8 @@ static uint32_t render_workspace_button(cairo_t *cairo,
406 double text_y = height / 2.0 - text_height / 2.0; 407 double text_y = height / 2.0 - text_height / 2.0;
407 cairo_set_source_u32(cairo, box_colors.text); 408 cairo_set_source_u32(cairo, box_colors.text);
408 cairo_move_to(cairo, *x + width / 2 - text_width / 2, (int)floor(text_y)); 409 cairo_move_to(cairo, *x + width / 2 - text_width / 2, (int)floor(text_y));
409 pango_printf(cairo, config->font, output->scale, true, "%s", name); 410 pango_printf(cairo, config->font, output->scale, config->pango_markup,
411 "%s", name);
410 412
411 struct swaybar_hotspot *hotspot = calloc(1, sizeof(struct swaybar_hotspot)); 413 struct swaybar_hotspot *hotspot = calloc(1, sizeof(struct swaybar_hotspot));
412 hotspot->x = *x; 414 hotspot->x = *x;