pidgin/gtkwebviewtoolbar.c

changeset 37991
b344343d3cf0
parent 37143
728319cb659f
child 37992
0185eb26ac7d
equal deleted inserted replaced
37990:710f725725a8 37991:b344343d3cf0
244 priv->font_dialog = NULL; 244 priv->font_dialog = NULL;
245 } 245 }
246 } 246 }
247 247
248 static void 248 static void
249 realize_toolbar_font(GtkWidget *widget, PidginWebViewToolbar *toolbar)
250 {
251 #if !GTK_CHECK_VERSION(3,2,0)
252 PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar);
253 GtkFontSelection *sel;
254
255 sel = GTK_FONT_SELECTION(
256 gtk_font_selection_dialog_get_font_selection(GTK_FONT_SELECTION_DIALOG(priv->font_dialog)));
257 gtk_widget_hide(gtk_widget_get_parent(
258 gtk_font_selection_get_size_entry(sel)));
259 gtk_widget_show_all(gtk_font_selection_get_family_list(sel));
260 gtk_widget_show(gtk_widget_get_parent(
261 gtk_font_selection_get_family_list(sel)));
262 gtk_widget_show(gtk_widget_get_parent(gtk_widget_get_parent(
263 gtk_font_selection_get_family_list(sel))));
264 #endif
265 }
266
267 static void
268 apply_font(GtkDialog *dialog, gint response, PidginWebViewToolbar *toolbar) 249 apply_font(GtkDialog *dialog, gint response, PidginWebViewToolbar *toolbar)
269 { 250 {
270 /* this could be expanded to include font size, weight, etc. 251 /* this could be expanded to include font size, weight, etc.
271 but for now only works with font face */ 252 but for now only works with font face */
272 gchar *fontname = NULL; 253 gchar *fontname = NULL;
319 PIDGIN_DEFAULT_FONT_FACE); 300 PIDGIN_DEFAULT_FONT_FACE);
320 } 301 }
321 302
322 g_signal_connect(G_OBJECT(priv->font_dialog), "response", 303 g_signal_connect(G_OBJECT(priv->font_dialog), "response",
323 G_CALLBACK(apply_font), toolbar); 304 G_CALLBACK(apply_font), toolbar);
324 g_signal_connect_after(G_OBJECT(priv->font_dialog), "realize",
325 G_CALLBACK(realize_toolbar_font), toolbar);
326 } 305 }
327 306
328 gtk_window_present(GTK_WINDOW(priv->font_dialog)); 307 gtk_window_present(GTK_WINDOW(priv->font_dialog));
329 308
330 g_free(fontname); 309 g_free(fontname);

mercurial