diff options
author | 2018-09-08 09:19:47 -0400 | |
---|---|---|
committer | 2018-09-08 09:19:47 -0400 | |
commit | 3600b3db577298bc553c394a4b09e71163f76561 (patch) | |
tree | a1defcadae4b1d07388fd9e6bfe2a09051aec777 /swaybar | |
parent | Merge pull request #2603 from emersion/fix-dnd (diff) | |
parent | Align titles to baseline (diff) | |
download | sway-3600b3db577298bc553c394a4b09e71163f76561.tar.gz sway-3600b3db577298bc553c394a4b09e71163f76561.tar.zst sway-3600b3db577298bc553c394a4b09e71163f76561.zip |
Merge pull request #2602 from RyanDwyer/fix-title-textures
Fix gaps in title textures and vertically center them
Diffstat (limited to 'swaybar')
-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 702e863c..7303e70f 100644 --- a/swaybar/render.c +++ b/swaybar/render.c | |||
@@ -33,8 +33,8 @@ static uint32_t render_status_line_error(cairo_t *cairo, | |||
33 | int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; | 33 | int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; |
34 | 34 | ||
35 | int text_width, text_height; | 35 | int text_width, text_height; |
36 | get_text_size(cairo, config->font, | 36 | get_text_size(cairo, config->font, &text_width, &text_height, NULL, |
37 | &text_width, &text_height, output->scale, false, "%s", error); | 37 | output->scale, false, "%s", error); |
38 | 38 | ||
39 | uint32_t ideal_height = text_height + ws_vertical_padding * 2; | 39 | uint32_t ideal_height = text_height + ws_vertical_padding * 2; |
40 | uint32_t ideal_surface_height = ideal_height / output->scale; | 40 | uint32_t ideal_surface_height = ideal_height / output->scale; |
@@ -63,7 +63,7 @@ static uint32_t render_status_line_text(cairo_t *cairo, | |||
63 | config->colors.focused_statusline : config->colors.statusline); | 63 | config->colors.focused_statusline : config->colors.statusline); |
64 | 64 | ||
65 | int text_width, text_height; | 65 | int text_width, text_height; |
66 | get_text_size(cairo, config->font, &text_width, &text_height, | 66 | get_text_size(cairo, config->font, &text_width, &text_height, NULL, |
67 | output->scale, config->pango_markup, "%s", text); | 67 | output->scale, config->pango_markup, "%s", text); |
68 | 68 | ||
69 | int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; | 69 | int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; |
@@ -126,7 +126,7 @@ static uint32_t render_status_block(cairo_t *cairo, | |||
126 | uint32_t height = surface_height * output->scale; | 126 | uint32_t height = surface_height * output->scale; |
127 | 127 | ||
128 | int text_width, text_height; | 128 | int text_width, text_height; |
129 | get_text_size(cairo, config->font, &text_width, &text_height, | 129 | get_text_size(cairo, config->font, &text_width, &text_height, NULL, |
130 | output->scale, block->markup, "%s", block->full_text); | 130 | output->scale, block->markup, "%s", block->full_text); |
131 | 131 | ||
132 | int margin = 3 * output->scale; | 132 | int margin = 3 * output->scale; |
@@ -157,7 +157,7 @@ static uint32_t render_status_block(cairo_t *cairo, | |||
157 | int sep_width, sep_height; | 157 | int sep_width, sep_height; |
158 | if (!edge) { | 158 | if (!edge) { |
159 | if (config->sep_symbol) { | 159 | if (config->sep_symbol) { |
160 | get_text_size(cairo, config->font, &sep_width, &sep_height, | 160 | get_text_size(cairo, config->font, &sep_width, &sep_height, NULL, |
161 | output->scale, false, "%s", config->sep_symbol); | 161 | output->scale, false, "%s", config->sep_symbol); |
162 | uint32_t _ideal_height = sep_height + ws_vertical_padding * 2; | 162 | uint32_t _ideal_height = sep_height + ws_vertical_padding * 2; |
163 | uint32_t _ideal_surface_height = _ideal_height / output->scale; | 163 | uint32_t _ideal_surface_height = _ideal_height / output->scale; |
@@ -297,7 +297,7 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo, | |||
297 | uint32_t height = surface_height * output->scale; | 297 | uint32_t height = surface_height * output->scale; |
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, NULL, |
301 | output->scale, config->mode_pango_markup, | 301 | output->scale, config->mode_pango_markup, |
302 | "%s", mode); | 302 | "%s", mode); |
303 | 303 | ||
@@ -379,7 +379,7 @@ static uint32_t render_workspace_button(cairo_t *cairo, | |||
379 | uint32_t height = surface_height * output->scale; | 379 | uint32_t height = surface_height * output->scale; |
380 | 380 | ||
381 | int text_width, text_height; | 381 | int text_width, text_height; |
382 | get_text_size(cairo, config->font, &text_width, &text_height, | 382 | get_text_size(cairo, config->font, &text_width, &text_height, NULL, |
383 | output->scale, config->pango_markup, "%s", name); | 383 | output->scale, config->pango_markup, "%s", name); |
384 | 384 | ||
385 | int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; | 385 | int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale; |