comparison pidgin/gtkutils.c @ 28937:3a055fbe806b

Kill the use of the GNOME document font and the prefs to override it. The font can be set via the theme control plugin. This makes the Themes and Sounds tabs the tallest, and I believe I've accomplished my initial goal of fitting on the shorter screens for netbooks.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 15 Nov 2009 20:34:26 +0000
parents 3fdad8b715c7
children b027d1d97edb
comparison
equal deleted inserted replaced
28936:1c892675f054 28937:3a055fbe806b
103 }; 103 };
104 104
105 void 105 void
106 pidgin_setup_imhtml(GtkWidget *imhtml) 106 pidgin_setup_imhtml(GtkWidget *imhtml)
107 { 107 {
108 PangoFontDescription *desc = NULL;
109 g_return_if_fail(imhtml != NULL); 108 g_return_if_fail(imhtml != NULL);
110 g_return_if_fail(GTK_IS_IMHTML(imhtml)); 109 g_return_if_fail(GTK_IS_IMHTML(imhtml));
111 110
112 pidgin_themes_smiley_themeize(imhtml); 111 pidgin_themes_smiley_themeize(imhtml);
113 112
114 gtk_imhtml_set_funcs(GTK_IMHTML(imhtml), &gtkimhtml_cbs); 113 gtk_imhtml_set_funcs(GTK_IMHTML(imhtml), &gtkimhtml_cbs);
115 114
116 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) {
117 const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
118 desc = pango_font_description_from_string(font);
119 } else if (purple_running_gnome()) {
120 /* Use the GNOME "document" font, if applicable */
121 char *path;
122
123 if ((path = g_find_program_in_path("gconftool-2"))) {
124 char *font = NULL;
125 char *err = NULL;
126 g_free(path);
127 if (g_spawn_command_line_sync(
128 "gconftool-2 -g /desktop/gnome/interface/document_font_name",
129 &font, &err, NULL, NULL)) {
130 desc = pango_font_description_from_string(font);
131 }
132 g_free(err);
133 g_free(font);
134 }
135 }
136
137 if (desc) {
138 gtk_widget_modify_font(imhtml, desc);
139 pango_font_description_free(desc);
140 }
141 } 115 }
142 116
143 static 117 static
144 void pidgin_window_init(GtkWindow *wnd, const char *title, guint border_width, const char *role, gboolean resizable) 118 void pidgin_window_init(GtkWindow *wnd, const char *title, guint border_width, const char *role, gboolean resizable)
145 { 119 {