# HG changeset patch # User Daniel Atallah # Date 1266126946 0 # Node ID f6cc979020494db11cc6f6f635690d216187d00d # Parent b5af0c398c69dc27068c320deb0d5d19c320e1fe Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168 diff -r b5af0c398c69 -r f6cc97902049 pidgin/gtkprefs.c --- a/pidgin/gtkprefs.c Sat Feb 13 18:51:00 2010 +0000 +++ b/pidgin/gtkprefs.c Sun Feb 14 05:55:46 2010 +0000 @@ -1445,11 +1445,27 @@ #ifdef _WIN32 static void +apply_custom_font(void) +{ + PangoFontDescription *desc = NULL; + 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); + } + + gtk_widget_modify_font(sample_imhtml, desc); + if (desc) + pango_font_description_free(desc); + +} +static void pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul) { + purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", - gtk_font_button_get_font_name(font_button)) -; + gtk_font_button_get_font_name(font_button)); + + apply_custom_font(); } #endif @@ -1522,6 +1538,7 @@ if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) gtk_widget_set_sensitive(hbox, FALSE); g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); + g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(apply_custom_font), hbox); g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); } diff -r b5af0c398c69 -r f6cc97902049 pidgin/gtkutils.c --- a/pidgin/gtkutils.c Sat Feb 13 18:51:00 2010 +0000 +++ b/pidgin/gtkutils.c Sun Feb 14 05:55:46 2010 +0000 @@ -105,7 +105,6 @@ void pidgin_setup_imhtml(GtkWidget *imhtml) { - PangoFontDescription *desc = NULL; g_return_if_fail(imhtml != NULL); g_return_if_fail(GTK_IS_IMHTML(imhtml)); @@ -115,15 +114,16 @@ #ifdef _WIN32 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) { + PangoFontDescription *desc; const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); desc = pango_font_description_from_string(font); + if (desc) { + gtk_widget_modify_font(imhtml, desc); + pango_font_description_free(desc); + } } #endif - if (desc) { - gtk_widget_modify_font(imhtml, desc); - pango_font_description_free(desc); - } } static