pidgin: b858ae80: Make the conversation text preview secti...

datallah at pidgin.im datallah at pidgin.im
Sun Feb 14 01:01:47 EST 2010


-----------------------------------------------------------------
Revision: b858ae8085cda451692ceda2c63265a69c2d4a6f
Ancestor: 012eabf54827bbaf5588c9e59939238c6003dc22
Author: datallah at pidgin.im
Date: 2010-02-14T05:55:46
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b858ae8085cda451692ceda2c63265a69c2d4a6f

Modified files:
        pidgin/gtkprefs.c pidgin/gtkutils.c

ChangeLog: 

Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168 

-------------- next part --------------
============================================================
--- pidgin/gtkprefs.c	5ff8516c68ae90b3d4ba168c9881c5652ba0082d
+++ pidgin/gtkprefs.c	cf9f6167c620f778c1e3ba42fb95abda64d8ef11
@@ -1445,11 +1445,27 @@ static void
 
 #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 @@ conv_page(void)
 	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);
 
 	}
============================================================
--- pidgin/gtkutils.c	2991dc8413788be8c017b52a40af30e90d5ff80e
+++ pidgin/gtkutils.c	f2249c34c76983c63795b3b0109b20e57db1bcf7
@@ -105,7 +105,6 @@ pidgin_setup_imhtml(GtkWidget *imhtml)
 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 @@ pidgin_setup_imhtml(GtkWidget *imhtml)
 
 #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


More information about the Commits mailing list