2006-04-10 [colin] 2.1.0cvs27
authorColin Leroy <colin@colino.net>
Mon, 10 Apr 2006 19:16:31 +0000 (19:16 +0000)
committerColin Leroy <colin@colino.net>
Mon, 10 Apr 2006 19:16:31 +0000 (19:16 +0000)
* src/compose.c
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_msg_colors.c
* src/textview.c
Allow optional background color in quotes
Patch by Rafal Weglarz <tokoloshe@users.sf.net>
GTK+-2.8.x feature

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/prefs_common.c
src/prefs_common.h
src/prefs_msg_colors.c
src/textview.c

index f519ae6..ed7b918 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-04-10 [colin]     2.1.0cvs27
+
+       * src/compose.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_msg_colors.c
+       * src/textview.c
+               Allow optional background color in quotes
+               Patch by Rafal Weglarz <tokoloshe@users.sf.net>
+               GTK+-2.8.x feature
+
 2006-04-10 [colin]     2.1.0cvs26
 
        * src/main.c
index d8c6539..5eea565 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.204.2.81 -r 1.204.2.82 src/prefs_common.c;  ) > 2.1.0cvs24.patchset
 ( cvs diff -u -r 1.1.2.8 -r 1.1.2.9 manual/plugins.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/fr/plugins.xml;  ) > 2.1.0cvs25.patchset
 ( cvs diff -u -r 1.115.2.78 -r 1.115.2.79 src/main.c;  cvs diff -u -r 1.274.2.106 -r 1.274.2.107 src/mainwindow.c;  cvs diff -u -r 1.39.2.15 -r 1.39.2.16 src/mainwindow.h;  ) > 2.1.0cvs26.patchset
+( cvs diff -u -r 1.382.2.260 -r 1.382.2.261 src/compose.c;  cvs diff -u -r 1.204.2.82 -r 1.204.2.83 src/prefs_common.c;  cvs diff -u -r 1.103.2.46 -r 1.103.2.47 src/prefs_common.h;  cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/prefs_msg_colors.c;  cvs diff -u -r 1.96.2.108 -r 1.96.2.109 src/textview.c;  ) > 2.1.0cvs27.patchset
index fbb2184..0f305c2 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=26
+EXTRA_VERSION=27
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 32c3580..0785686 100644 (file)
@@ -793,6 +793,9 @@ static gboolean compose_put_existing_to_front(MsgInfo *info)
 static GdkColor quote_color = 
        {(gulong)0, (gushort)0, (gushort)0, (gushort)0};
 
+static GdkColor quote_bgcolor = 
+       {(gulong)0, (gushort)0, (gushort)0, (gushort)0};
+
 static GdkColor signature_color = {
        (gulong)0,
        (gushort)0x7fff,
@@ -826,14 +829,24 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
                signature_color = quote_color = uri_color = black;
        }
 
-       gtk_text_buffer_create_tag(buffer, "quote",
-                                  "foreground-gdk", &quote_color,
-                                  NULL);
+       if (prefs_common.enable_color && prefs_common.enable_bgcolor) {
+               gtkut_convert_int_to_gdk_color(prefs_common.quote_level1_bgcol,
+                                                  &quote_bgcolor);
+               gtk_text_buffer_create_tag(buffer, "quote",
+                                          "foreground-gdk", &quote_color,
+                                          "paragraph-background-gdk", &quote_bgcolor,
+                                          NULL);
+       } else {
+               gtk_text_buffer_create_tag(buffer, "quote",
+                                          "foreground-gdk", &quote_color,
+                                          NULL);
+       }
+
        gtk_text_buffer_create_tag(buffer, "signature",
                                   "foreground-gdk", &signature_color,
                                   NULL);
        gtk_text_buffer_create_tag(buffer, "link",
-                                        "foreground-gdk", &uri_color,
+                                       "foreground-gdk", &uri_color,
                                         NULL);
        compose->no_wrap_tag = gtk_text_buffer_create_tag(buffer, "no_wrap", NULL);
        compose->no_join_tag = gtk_text_buffer_create_tag(buffer, "no_join", NULL);
index 297fcb2..72a7424 100644 (file)
@@ -522,6 +522,14 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_COLOR,
         NULL, NULL, NULL},
+       {"enable_bgcolor", "FALSE", &prefs_common.enable_bgcolor, P_BOOL,
+        NULL, NULL, NULL},
+       {"quote_level1_bgcolor", "13421772", &prefs_common.quote_level1_bgcol, P_COLOR,
+        NULL, NULL, NULL},
+       {"quote_level2_bgcolor", "13882323", &prefs_common.quote_level2_bgcol, P_COLOR,
+        NULL, NULL, NULL},
+       {"quote_level3_bgcolor", "14540253", &prefs_common.quote_level3_bgcol, P_COLOR,
+        NULL, NULL, NULL},
        {"uri_color", "32512", &prefs_common.uri_col, P_COLOR,
         NULL, NULL, NULL},
        {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_COLOR,
index c4aeebd..4e9bc11 100644 (file)
@@ -235,9 +235,13 @@ struct _PrefsCommon
 
        /* Message */
        gboolean enable_color;
+       gboolean enable_bgcolor;
        gulong quote_level1_col;
        gulong quote_level2_col;
        gulong quote_level3_col;
+       gulong quote_level1_bgcol;
+       gulong quote_level2_bgcol;
+       gulong quote_level3_bgcol;
        gulong uri_col;
        gulong tgt_folder_col;
        gulong signature_col;
index 1ea7d25..b7cf2f2 100644 (file)
@@ -48,6 +48,9 @@ static struct MessageColorButtons {
        GtkWidget *quote_level1_btn;
        GtkWidget *quote_level2_btn;
        GtkWidget *quote_level3_btn;
+       GtkWidget *quote_level1_bg_btn;
+       GtkWidget *quote_level2_bg_btn;
+       GtkWidget *quote_level3_bg_btn;
        GtkWidget *uri_btn;
        GtkWidget *tgt_folder_btn;
        GtkWidget *signature_btn;
@@ -63,6 +66,7 @@ typedef struct _MsgColorsPage
        GtkWidget *window;
        
        GtkWidget *chkbtn_enablecol;
+       GtkWidget *chkbtn_enablebgcol;
        GtkWidget *chkbtn_recycle_colors;
 
        /* custom colors */
@@ -96,6 +100,10 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *quotelevel1_label;
        GtkWidget *quotelevel2_label;
        GtkWidget *quotelevel3_label;
+       GtkWidget *chkbtn_enablebgcol;
+       GtkWidget *quotelevel1_bglabel;
+       GtkWidget *quotelevel2_bglabel;
+       GtkWidget *quotelevel3_bglabel;
        GtkWidget *uri_label;
        GtkWidget *signature_label;
        GtkWidget *tgt_folder_label;
@@ -104,6 +112,9 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *color_new_label;
        GtkWidget *msg_frame;
        GtkWidget *folder_frame;
+       GtkWidget *hbox_quote;
+       GtkWidget *vbox_quotefg;
+       GtkWidget *vbox_quotebg;
        /* custom colors */
        GtkWidget *vbox_custom_colors;
        GtkWidget *frame_custom_colors;
@@ -124,16 +135,29 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_container_add (GTK_CONTAINER (msg_frame), vbox2);
        gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
 
+
        hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
+       hbox_quote = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show (hbox_quote);
+       vbox_quotefg = gtk_vbox_new(FALSE, 8);
+       gtk_widget_show (vbox_quotefg);
+       vbox_quotebg = gtk_vbox_new(FALSE, 8);
+#if GTK_CHECK_VERSION(2, 8, 0)
+       gtk_widget_show (vbox_quotebg);
+#endif 
+       
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox_quote, FALSE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (hbox_quote), vbox_quotefg, FALSE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (hbox_quote), vbox_quotebg, FALSE, TRUE, 0);
 
+       gtk_box_pack_start (GTK_BOX (vbox_quotefg), hbox, FALSE, TRUE, 0);
        PACK_CHECK_BUTTON (hbox, chkbtn_enablecol,
                           _("Enable coloration of message text"));
 
        hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox_quotefg), hbox, FALSE, TRUE, 0);
 
        color_buttons.quote_level1_btn = gtk_button_new();
        gtk_widget_show(color_buttons.quote_level1_btn);
@@ -150,7 +174,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                
        hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox_quotefg), hbox, FALSE, TRUE, 0);
 
        color_buttons.quote_level2_btn = gtk_button_new();
        gtk_widget_show(color_buttons.quote_level2_btn);
@@ -167,7 +191,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 
        hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox_quotefg), hbox, FALSE, TRUE, 0);
 
        color_buttons.quote_level3_btn = gtk_button_new();
        gtk_widget_show(color_buttons.quote_level3_btn);
@@ -182,6 +206,66 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                            FALSE, FALSE, 0);
        SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, quotelevel3_label);
 
+
+       hbox = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show (hbox);
+       gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
+
+       PACK_CHECK_BUTTON (hbox, chkbtn_enablebgcol,
+                          _("Enable coloration of background text"));
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, chkbtn_enablebgcol);
+
+       hbox = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show (hbox);
+       gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
+       
+       color_buttons.quote_level1_bg_btn = gtk_button_new();
+       gtk_widget_show(color_buttons.quote_level1_bg_btn);
+       gtk_widget_set_size_request (color_buttons.quote_level1_bg_btn, 30, 20);
+       gtk_box_pack_start (GTK_BOX(hbox), color_buttons.quote_level1_bg_btn, 
+                           FALSE, FALSE, 0);
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, color_buttons.quote_level1_bg_btn);
+
+       quotelevel1_bglabel = gtk_label_new (_(" Background"));
+       gtk_widget_show(quotelevel1_bglabel);
+       gtk_box_pack_start (GTK_BOX(hbox), quotelevel1_bglabel, 
+                           FALSE, FALSE, 0);
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, quotelevel1_bglabel);
+
+       hbox = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show (hbox);
+       gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
+       
+       color_buttons.quote_level2_bg_btn = gtk_button_new();
+       gtk_widget_show(color_buttons.quote_level2_bg_btn);
+       gtk_widget_set_size_request (color_buttons.quote_level2_bg_btn, 30, 20);
+       gtk_box_pack_start (GTK_BOX(hbox), color_buttons.quote_level2_bg_btn, 
+                           FALSE, FALSE, 0);
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, color_buttons.quote_level2_bg_btn);
+
+       quotelevel2_bglabel = gtk_label_new (_(" Background"));
+       gtk_widget_show(quotelevel2_bglabel);
+       gtk_box_pack_start (GTK_BOX(hbox), quotelevel2_bglabel, 
+                           FALSE, FALSE, 0);
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, quotelevel2_bglabel);
+
+       hbox = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show (hbox);
+       gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
+       
+       color_buttons.quote_level3_bg_btn = gtk_button_new();
+       gtk_widget_show(color_buttons.quote_level3_bg_btn);
+       gtk_widget_set_size_request (color_buttons.quote_level3_bg_btn, 30, 20);
+       gtk_box_pack_start (GTK_BOX(hbox), color_buttons.quote_level3_bg_btn, 
+                           FALSE, FALSE, 0);
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, color_buttons.quote_level3_bg_btn);
+
+       quotelevel3_bglabel = gtk_label_new (_(" Background"));
+       gtk_widget_show(quotelevel3_bglabel);
+       gtk_box_pack_start (GTK_BOX(hbox), quotelevel3_bglabel, 
+                           FALSE, FALSE, 0);
+       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, quotelevel3_bglabel);
+
        hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show (hbox);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
@@ -297,6 +381,12 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                         G_CALLBACK(quote_color_set_dialog), "LEVEL2");
        g_signal_connect(G_OBJECT(color_buttons.quote_level3_btn), "clicked",
                         G_CALLBACK(quote_color_set_dialog), "LEVEL3");
+       g_signal_connect(G_OBJECT(color_buttons.quote_level1_bg_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "LEVEL1BG");
+       g_signal_connect(G_OBJECT(color_buttons.quote_level2_bg_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "LEVEL2BG");
+       g_signal_connect(G_OBJECT(color_buttons.quote_level3_bg_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "LEVEL3BG");
        g_signal_connect(G_OBJECT(color_buttons.uri_btn), "clicked",
                         G_CALLBACK(quote_color_set_dialog), "URI");
        g_signal_connect(G_OBJECT(color_buttons.tgt_folder_btn), "clicked",
@@ -320,6 +410,12 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                            prefs_common.quote_level2_col);
        set_button_bg_color(color_buttons.quote_level3_btn,
                            prefs_common.quote_level3_col);
+       set_button_bg_color(color_buttons.quote_level1_bg_btn,
+                           prefs_common.quote_level1_bgcol);
+       set_button_bg_color(color_buttons.quote_level2_bg_btn,
+                           prefs_common.quote_level2_bgcol);
+       set_button_bg_color(color_buttons.quote_level3_bg_btn,
+                           prefs_common.quote_level3_bgcol);
        set_button_bg_color(color_buttons.uri_btn,
                            prefs_common.uri_col);
        set_button_bg_color(color_buttons.tgt_folder_btn,
@@ -338,10 +434,13 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_enablecol),
                                     prefs_common.enable_color);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_enablebgcol),
+                                    prefs_common.enable_bgcolor);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_recycle_colors),
                                     prefs_common.recycle_quote_colors);
 
        prefs_msg_colors->chkbtn_enablecol      = chkbtn_enablecol;
+       prefs_msg_colors->chkbtn_enablebgcol    = chkbtn_enablebgcol;
        prefs_msg_colors->chkbtn_recycle_colors = chkbtn_recycle_colors;
        /* custom colors */
        for (c = 0; c < COLORLABELS; c++) {
@@ -379,6 +478,15 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
                } else if(g_ascii_strcasecmp(type, "LEVEL3") == 0) {
                        title = g_strdup(_("Pick color for quotation level 3"));
                        rgbvalue = prefs_common.quote_level3_col;
+               } else if(g_ascii_strcasecmp(type, "LEVEL1BG") == 0) {
+                       title = g_strdup(_("Pick color for quotation level 1 background"));
+                       rgbvalue = prefs_common.quote_level1_bgcol;
+               } else if(g_ascii_strcasecmp(type, "LEVEL2BG") == 0) {
+                       title = g_strdup(_("Pick color for quotation level 2 background"));
+                       rgbvalue = prefs_common.quote_level2_bgcol;
+               } else if(g_ascii_strcasecmp(type, "LEVEL3BG") == 0) {
+                       title = g_strdup(_("Pick color for quotation level 3 background"));
+                       rgbvalue = prefs_common.quote_level3_bgcol;
                } else if(g_ascii_strcasecmp(type, "URI") == 0) {
                        title = g_strdup(_("Pick color for URI"));
                        rgbvalue = prefs_common.uri_col;
@@ -459,6 +567,15 @@ static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
                } else if (g_ascii_strcasecmp(type, "LEVEL3") == 0) {
                        prefs_common.quote_level3_col = rgbvalue;
                        set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
+               } else if (g_ascii_strcasecmp(type, "LEVEL1BG") == 0) {
+                       prefs_common.quote_level1_bgcol = rgbvalue;
+                       set_button_bg_color(color_buttons.quote_level1_bg_btn, rgbvalue);
+               } else if (g_ascii_strcasecmp(type, "LEVEL2BG") == 0) {
+                       prefs_common.quote_level2_bgcol = rgbvalue;
+                       set_button_bg_color(color_buttons.quote_level2_bg_btn, rgbvalue);
+               } else if (g_ascii_strcasecmp(type, "LEVEL3BG") == 0) {
+                       prefs_common.quote_level3_bgcol = rgbvalue;
+                       set_button_bg_color(color_buttons.quote_level3_bg_btn, rgbvalue);
                } else if (g_ascii_strcasecmp(type, "URI") == 0) {
                        prefs_common.uri_col = rgbvalue;
                        set_button_bg_color(color_buttons.uri_btn, rgbvalue);
@@ -535,6 +652,8 @@ void prefs_msg_colors_save(PrefsPage *_page)
 
        prefs_common.enable_color = 
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->chkbtn_enablecol));
+       prefs_common.enable_bgcolor = 
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->chkbtn_enablebgcol));
        prefs_common.recycle_quote_colors =
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->chkbtn_recycle_colors));
 
index 26eaa6d..90bde7a 100644 (file)
@@ -79,6 +79,11 @@ static GdkColor quote_colors[3] = {
        {(gulong)0, (gushort)0, (gushort)0, (gushort)0}
 };
 
+static GdkColor quote_bgcolors[3] = {
+       {(gulong)0, (gushort)0, (gushort)0, (gushort)0},
+       {(gulong)0, (gushort)0, (gushort)0, (gushort)0},
+       {(gulong)0, (gushort)0, (gushort)0, (gushort)0}
+};
 static GdkColor signature_color = {
        (gulong)0,
        (gushort)0x7fff,
@@ -390,28 +395,43 @@ static void textview_create_tags(GtkTextView *text, TextView *textview)
        gtk_text_buffer_create_tag(buffer, "header_title",
                                   "font-desc", bold_font_desc,
                                   NULL);
-       gtk_text_buffer_create_tag(buffer, "quote0",
-                                  "foreground-gdk", &quote_colors[0],
-                                  NULL);
-       gtk_text_buffer_create_tag(buffer, "quote1",
-                                  "foreground-gdk", &quote_colors[1],
-                                  NULL);
-       gtk_text_buffer_create_tag(buffer, "quote2",
-                                  "foreground-gdk", &quote_colors[2],
-                                  NULL);
+       if (prefs_common.enable_bgcolor) {
+               gtk_text_buffer_create_tag(buffer, "quote0",
+                               "foreground-gdk", &quote_colors[0],
+                               "paragraph-background-gdk", &quote_bgcolors[0],
+                               NULL);
+               gtk_text_buffer_create_tag(buffer, "quote1",
+                               "foreground-gdk", &quote_colors[1],
+                               "paragraph-background-gdk", &quote_bgcolors[1],
+                               NULL);
+               gtk_text_buffer_create_tag(buffer, "quote2",
+                               "foreground-gdk", &quote_colors[2],
+                               "paragraph-background-gdk", &quote_bgcolors[2],
+                               NULL);
+       } else {
+               gtk_text_buffer_create_tag(buffer, "quote0",
+                               "foreground-gdk", &quote_colors[0],
+                               NULL);
+               gtk_text_buffer_create_tag(buffer, "quote1",
+                               "foreground-gdk", &quote_colors[1],
+                               NULL);
+               gtk_text_buffer_create_tag(buffer, "quote2",
+                               "foreground-gdk", &quote_colors[2],
+                               NULL);
+       }
        gtk_text_buffer_create_tag(buffer, "emphasis",
-                                  "foreground-gdk", &emphasis_color,
-                                  NULL);
-       gtk_text_buffer_create_tag(buffer, "signature",
-                                  "foreground-gdk", &signature_color,
-                                  NULL);
-       tag = gtk_text_buffer_create_tag(buffer, "link",
-                                        "foreground-gdk", &uri_color,
-                                        NULL);
+                       "foreground-gdk", &emphasis_color,
+                       NULL);
+       gtk_text_buffer_create_tag(buffer, "signature",
+                       "foreground-gdk", &signature_color,
+                       NULL);
+       tag = gtk_text_buffer_create_tag(buffer, "link",
+                       "foreground-gdk", &uri_color,
+                       NULL);
        gtk_text_buffer_create_tag(buffer, "link-hover",
-                                  "foreground-gdk", &uri_color,
-                                  "underline", PANGO_UNDERLINE_SINGLE,
-                                  NULL);
+                       "foreground-gdk", &uri_color,
+                       "underline", PANGO_UNDERLINE_SINGLE,
+                       NULL);
        g_signal_connect(G_OBJECT(tag), "event",
                          G_CALLBACK(textview_uri_button_pressed), textview);
  }
@@ -431,10 +451,10 @@ void textview_init(TextView *textview)
        textview_create_tags(GTK_TEXT_VIEW(textview->text), textview);
 }
 
-#define CHANGE_TAG_COLOR(tagname, color) { \
+#define CHANGE_TAG_COLOR(tagname, colorfg, colorbg) { \
        tag = gtk_text_tag_table_lookup(tags, tagname); \
        if (tag) \
-               g_object_set(G_OBJECT(tag), "foreground-gdk", color, NULL); \
+               g_object_set(G_OBJECT(tag), "foreground-gdk", colorfg, "paragraph-background-gdk", colorbg, NULL); \
 }
 
 static void textview_update_message_colors(TextView *textview)
@@ -446,6 +466,10 @@ static void textview_update_message_colors(TextView *textview)
        GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(buffer);
        GtkTextTag *tag = NULL;
 
+       quote_bgcolors[0] = quote_bgcolors[1] = quote_bgcolors[2] = black;
+       quote_colors[0] = quote_colors[1] = quote_colors[2] = 
+               uri_color = emphasis_color = signature_color = black;
+
        if (prefs_common.enable_color) {
                /* grab the quote colors, converting from an int to a GdkColor */
                gtkut_convert_int_to_gdk_color(prefs_common.quote_level1_col,
@@ -459,18 +483,27 @@ static void textview_update_message_colors(TextView *textview)
                gtkut_convert_int_to_gdk_color(prefs_common.signature_col,
                                               &signature_color);
                emphasis_color = colored_emphasis;
+       }
+       if (prefs_common.enable_color && prefs_common.enable_bgcolor) {
+               gtkut_convert_int_to_gdk_color(prefs_common.quote_level1_bgcol,
+                                                  &quote_bgcolors[0]);
+               gtkut_convert_int_to_gdk_color(prefs_common.quote_level2_bgcol,
+                                                  &quote_bgcolors[1]);
+               gtkut_convert_int_to_gdk_color(prefs_common.quote_level3_bgcol,
+                                                  &quote_bgcolors[2]);
+               CHANGE_TAG_COLOR("quote0", &quote_colors[0], &quote_bgcolors[0]);
+               CHANGE_TAG_COLOR("quote1", &quote_colors[1], &quote_bgcolors[1]);
+               CHANGE_TAG_COLOR("quote2", &quote_colors[2], &quote_bgcolors[2]);
        } else {
-               quote_colors[0] = quote_colors[1] = quote_colors[2] = 
-                       uri_color = emphasis_color = signature_color = black;
+               CHANGE_TAG_COLOR("quote0", &quote_colors[0], NULL);
+               CHANGE_TAG_COLOR("quote1", &quote_colors[1], NULL);
+               CHANGE_TAG_COLOR("quote2", &quote_colors[2], NULL);
        }
-       CHANGE_TAG_COLOR("quote0", &quote_colors[0]);
-       CHANGE_TAG_COLOR("quote1", &quote_colors[1]);
-       CHANGE_TAG_COLOR("quote2", &quote_colors[2]);
-       CHANGE_TAG_COLOR("emphasis", &emphasis_color);
-       CHANGE_TAG_COLOR("signature", &signature_color);
-       CHANGE_TAG_COLOR("link", &uri_color);
-       CHANGE_TAG_COLOR("link-hover", &uri_color);
 
+       CHANGE_TAG_COLOR("emphasis", &emphasis_color, NULL);
+       CHANGE_TAG_COLOR("signature", &signature_color, NULL);
+       CHANGE_TAG_COLOR("link", &uri_color, NULL);
+       CHANGE_TAG_COLOR("link-hover", &uri_color, NULL);
 }
 #undef CHANGE_TAG_COLOR