Mercurial > pidgin.yaz
diff pidgin/gtkutils.c @ 17489:747e5fd970e6
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Thu, 31 May 2007 03:00:35 +0000 |
| parents | fe8a1051aa0a |
| children | e91e2b450e5d 840ae0796048 |
line wrap: on
line diff
--- a/pidgin/gtkutils.c Thu May 31 00:57:53 2007 +0000 +++ b/pidgin/gtkutils.c Thu May 31 03:00:35 2007 +0000 @@ -94,6 +94,7 @@ void pidgin_setup_imhtml(GtkWidget *imhtml) { + PangoFontDescription *desc = NULL; g_return_if_fail(imhtml != NULL); g_return_if_fail(GTK_IS_IMHTML(imhtml)); @@ -104,10 +105,12 @@ gtk_imhtml_set_funcs(GTK_IMHTML(imhtml), >kimhtml_cbs); - /* Use the GNOME "document" font, if applicable */ - if (purple_running_gnome()) { + if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) { + const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); + desc = pango_font_description_from_string(font); + } else if (purple_running_gnome()) { + /* Use the GNOME "document" font, if applicable */ char *path, *font; - PangoFontDescription *desc = NULL; if ((path = g_find_program_in_path("gconftool-2"))) { g_free(path); @@ -118,11 +121,11 @@ } desc = pango_font_description_from_string(font); g_free(font); - - if (desc) { - gtk_widget_modify_font(imhtml, desc); - pango_font_description_free(desc); - } + } + + if (desc) { + gtk_widget_modify_font(imhtml, desc); + pango_font_description_free(desc); } }
