diff options
author | Zandr Martin <zandrmartin@gmail.com> | 2016-09-08 14:45:21 -0500 |
---|---|---|
committer | Zandr Martin <zandrmartin@gmail.com> | 2016-09-08 14:45:21 -0500 |
commit | 70b3796071d4ed8d92bb99e9db7a2554dd7f3821 (patch) | |
tree | 0cbd656e90e093225b78de33b071e1d2a901aca2 /wayland | |
parent | Merge pull request #885 from zandrmartin/commands-refactor (diff) | |
download | sway-70b3796071d4ed8d92bb99e9db7a2554dd7f3821.tar.gz sway-70b3796071d4ed8d92bb99e9db7a2554dd7f3821.tar.zst sway-70b3796071d4ed8d92bb99e9db7a2554dd7f3821.zip |
fix pango markup on swaybar
Diffstat (limited to 'wayland')
-rw-r--r-- | wayland/pango.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wayland/pango.c b/wayland/pango.c index ac090c9a..38993243 100644 --- a/wayland/pango.c +++ b/wayland/pango.c | |||
@@ -11,12 +11,13 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text | |||
11 | int32_t scale, bool markup) { | 11 | int32_t scale, bool markup) { |
12 | PangoLayout *layout = pango_cairo_create_layout(cairo); | 12 | PangoLayout *layout = pango_cairo_create_layout(cairo); |
13 | PangoAttrList *attrs = pango_attr_list_new(); | 13 | PangoAttrList *attrs = pango_attr_list_new(); |
14 | pango_attr_list_insert(attrs, pango_attr_scale_new(scale)); | ||
15 | if (markup) { | 14 | if (markup) { |
15 | pango_parse_markup(text, -1, 0, &attrs, NULL, NULL, NULL); | ||
16 | pango_layout_set_markup(layout, text, -1); | 16 | pango_layout_set_markup(layout, text, -1); |
17 | } else { | 17 | } else { |
18 | pango_layout_set_text(layout, text, -1); | 18 | pango_layout_set_text(layout, text, -1); |
19 | } | 19 | } |
20 | pango_attr_list_insert(attrs, pango_attr_scale_new(scale)); | ||
20 | PangoFontDescription *desc = pango_font_description_from_string(font); | 21 | PangoFontDescription *desc = pango_font_description_from_string(font); |
21 | pango_layout_set_font_description(layout, desc); | 22 | pango_layout_set_font_description(layout, desc); |
22 | pango_layout_set_single_paragraph_mode(layout, 1); | 23 | pango_layout_set_single_paragraph_mode(layout, 1); |