diff options
author | Bastien Nocera <hadess@hadess.net> | 2007-04-04 01:32:44 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2007-04-04 01:32:44 +0000 |
commit | 67a788be72ae2dfce1c82ac53395e38707be4fe5 (patch) | |
tree | 645601db28a01f1c8b87e73ac3638f109fe52bd4 /src/totem-interface.c | |
parent | a75c34b0cca5e6d6e97f4d4981328df2e66b0581 (diff) | |
download | totem-67a788be72ae2dfce1c82ac53395e38707be4fe5.tar.gz |
Add a way to italicise labels
2007-04-04 Bastien Nocera <hadess@hadess.net>
* src/totem-interface.c: (totem_interface_italicise_label):
* src/totem-interface.h: Add a way to italicise labels
* data/properties.glade:
* data/screenshot.glade:
* data/totem.glade:
* src/bacon-video-widget-properties.c:
(bacon_video_widget_properties_new):
* src/totem-preferences.c: (totem_setup_preferences):
* src/totem-screenshot.c: (totem_screenshot_new):
Use the newly added totem_interface_boldify_label, and
totem_interface_italicise_label to remove the markup
from the glade files (Closes: #100036)
svn path=/trunk/; revision=4193
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); +} + |