diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-22 19:17:02 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-22 19:17:02 (EDT) |
commit | b6d4c5523065a19b0048657fba171d125c561c08 (patch) | |
tree | a7271bdb5341cad636b6ae5ce15d66902767e5fb | |
parent | 8fc032f2f64f4b7eb022adb0b1255a5a68df109f (diff) | |
download | marquee-b6d4c5523065a19b0048657fba171d125c561c08.zip marquee-b6d4c5523065a19b0048657fba171d125c561c08.tar.gz marquee-b6d4c5523065a19b0048657fba171d125c561c08.tar.bz2 |
mq_tab_label_begin_scrolling(): Make PangoFontDescription static
-rw-r--r-- | src/tab-label.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tab-label.c b/src/tab-label.c index 77e6b62..33a6cd8 100644 --- a/src/tab-label.c +++ b/src/tab-label.c @@ -492,13 +492,16 @@ mq_tab_label_set_position(MqTabLabel *tab_label, guint position) void mq_tab_label_begin_scrolling(MqTabLabel *tab_label) { - PangoFontDescription *font_desc; + static PangoFontDescription *font_desc = NULL; + + if (!font_desc) { + font_desc = pango_font_description_new(); + pango_font_description_set_family_static(font_desc, + "monospace"); + } tab_label->scrolling = TRUE; tab_label->scrolled_title = g_strdup_printf("%s ", tab_label->title); - - font_desc = pango_font_description_new(); - pango_font_description_set_family_static(font_desc, "monospace"); gtk_widget_override_font(tab_label->label, font_desc); } |