diff pidgin/gtkprefs.c @ 29430:f6cc97902049

Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
author Daniel Atallah <daniel.atallah@gmail.com>
date Sun, 14 Feb 2010 05:55:46 +0000
parents 78a63f5590f2
children d77ecfe2b2c9 47aa24b2247c 2ad2e3490b23
line wrap: on
line diff
--- 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);
 
 	}