pidgin/gtkprefs.c

changeset 17511
a572dfadeb72
parent 17481
0187dfe85231
parent 17490
a227092a827f
child 18348
5d5887ed1e19
equal deleted inserted replaced
17481:0187dfe85231 17511:a572dfadeb72
956 956
957 gtk_widget_show_all(ret); 957 gtk_widget_show_all(ret);
958 return ret; 958 return ret;
959 } 959 }
960 960
961 #if GTK_CHECK_VERSION(2,4,0)
962 static void
963 pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul)
964 {
965 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font",
966 gtk_font_button_get_font_name(font_button));
967 }
968 #endif
969
961 static GtkWidget * 970 static GtkWidget *
962 conv_page() 971 conv_page()
963 { 972 {
964 GtkWidget *ret; 973 GtkWidget *ret;
965 GtkWidget *vbox; 974 GtkWidget *vbox;
966 GtkWidget *toolbar; 975 GtkWidget *toolbar;
967 GtkWidget *iconpref1; 976 GtkWidget *iconpref1;
968 GtkWidget *iconpref2; 977 GtkWidget *iconpref2;
978 GtkWidget *fontpref;
969 GtkWidget *imhtml; 979 GtkWidget *imhtml;
970 GtkWidget *frame; 980 GtkWidget *frame;
981
982 #if GTK_CHECK_VERSION(2,4,0)
983 GtkWidget *hbox;
984 GtkWidget *label;
985 GtkWidget *font_button;
986 const char *font_name;
987 #endif
971 988
972 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 989 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
973 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); 990 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
974 991
975 vbox = pidgin_make_frame(ret, _("Conversations")); 992 vbox = pidgin_make_frame(ret, _("Conversations"));
995 1012
996 pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox); 1013 pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox);
997 1014
998 #ifdef _WIN32 1015 #ifdef _WIN32
999 pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox); 1016 pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox);
1017 #endif
1018
1019 #if GTK_CHECK_VERSION(2,4,0)
1020 vbox = pidgin_make_frame(ret, _("Font"));
1021 if (purple_running_gnome())
1022 fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
1023 else
1024 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
1025 hbox = gtk_hbox_new(FALSE, 3);
1026 label = gtk_label_new_with_mnemonic(_("Conversation _font:"));
1027 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1028 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
1029 font_button = gtk_font_button_new_with_font(purple_prefs_get_string(font_name ? font_name : NULL));
1030 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE);
1031 gtk_box_pack_start(GTK_BOX(hbox), font_button, FALSE, FALSE, 0);
1032 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
1033 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font"))
1034 gtk_widget_set_sensitive(hbox, FALSE);
1035 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox);
1036 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL);
1000 #endif 1037 #endif
1001 1038
1002 vbox = pidgin_make_frame(ret, _("Default Formatting")); 1039 vbox = pidgin_make_frame(ret, _("Default Formatting"));
1003 1040
1004 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); 1041 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL);

mercurial