diff options
Diffstat (limited to 'src/totem-interface.c')
-rw-r--r-- | src/totem-interface.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/totem-interface.c b/src/totem-interface.c index d05b2da07..f8077a84a 100644 --- a/src/totem-interface.c +++ b/src/totem-interface.c @@ -289,3 +289,37 @@ totem_interface_boldify_label (GladeXML *xml, const char *name) g_free (str_final); } +void +totem_interface_italicise_label (GladeXML *xml, const char *name) +{ + GtkWidget *widget; + + widget = glade_xml_get_widget (xml, name); + + if (widget == NULL) { + g_warning ("widget '%s' not found", name); + return; + } + + /* this way is probably better, but for some reason doesn't work with + * labels with mnemonics. + + static PangoAttrList *pattrlist = NULL; + + if (pattrlist == NULL) { + PangoAttribute *attr; + + pattrlist = pango_attr_list_new (); + attr = pango_attr_style_new (PANGO_STYLE_ITALIC); + attr->start_index = 0; + attr->end_index = G_MAXINT; + pango_attr_list_insert (pattrlist, attr); + } + gtk_label_set_attributes (GTK_LABEL (widget), pattrlist);*/ + + gchar *str_final; + str_final = g_strdup_printf ("<i>%s</i>", gtk_label_get_label (GTK_LABEL (widget))); + gtk_label_set_markup_with_mnemonic (GTK_LABEL (widget), str_final); + g_free (str_final); +} + |