2007-01-13 [colin] 2.7.0cvs21
[claws.git] / src / prefs_compose_writing.c
index 9aadf1618cfc33c45a9529a16517b89c145257cd..3641713d560ceb9bde558bae8994388521335766 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2005-2006 Colin Leroy <colin@colino.net> & The Claws Mail Team
+ * Copyright (C) 2005-2007 Colin Leroy <colin@colino.net> & The Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -135,12 +135,7 @@ void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window,
        PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
                           _("when re-editing"));
 
-       PACK_FRAME(vbox1, frame, _("Forwarding"));
-       
-       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox2);
-       gtk_container_add (GTK_CONTAINER (frame), vbox2);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);      
+       vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Forwarding"));
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_forward_as_attachment,
                           _("Forward as attachment"));
@@ -148,12 +143,7 @@ void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window,
        PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
                           _("Keep the original 'From' header when redirecting"));
 
-       PACK_FRAME(vbox1, frame, _("Editing"));
-
-       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox2);
-       gtk_container_add (GTK_CONTAINER (frame), vbox2);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+       vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Editing"));
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
                           _("Automatically launch the external editor"));
@@ -222,14 +212,10 @@ void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window,
        SET_TOGGLE_SENSITIVITY (checkbtn_autosave, spinbtn_autosave_length);
        SET_TOGGLE_SENSITIVITY (checkbtn_autosave, label_autosave_length);
 
-       PACK_CHECK_BUTTON (vbox1, checkbtn_compose_with_format, _("Use format when composing new messages"));
+       PACK_CHECK_BUTTON (vbox1, checkbtn_compose_with_format, 
+                          _("Use format when composing new messages"));
 
-       PACK_FRAME (vbox1, frame_format, _("New message format"));
-
-       vbox_format = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_format);
-       gtk_container_add (GTK_CONTAINER (frame_format), vbox_format);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_format), 8);
+       vbox_format = gtkut_get_options_frame(vbox1, &frame_format, _("New message format"));
 
        hbox_format = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox_format);
@@ -255,6 +241,16 @@ void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window,
                (GTK_SCROLLED_WINDOW (scrolledwin_format), GTK_SHADOW_IN);
 
        text_format = gtk_text_view_new ();
+       if (prefs_common.textfont) {
+               PangoFontDescription *font_desc;
+
+               font_desc = pango_font_description_from_string
+                                               (prefs_common.textfont);
+               if (font_desc) {
+                       gtk_widget_modify_font(text_format, font_desc);
+                       pango_font_description_free(font_desc);
+               }
+       }
        gtk_widget_show (text_format);
        gtk_container_add(GTK_CONTAINER(scrolledwin_format), text_format);
        gtk_text_view_set_editable (GTK_TEXT_VIEW (text_format), TRUE);
@@ -275,6 +271,8 @@ void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window,
        g_signal_connect(G_OBJECT(btn_formatdesc), "clicked",
                         G_CALLBACK(quote_fmt_quote_description), GTK_WIDGET(window));
 
+       SET_TOGGLE_SENSITIVITY(checkbtn_compose_with_format, frame_format);
+
        prefs_writing->checkbtn_autoextedit = checkbtn_autoextedit;
 
        prefs_writing->checkbtn_reply_account_autosel   = checkbtn_reply_account_autosel;