display signatures in grey
[claws.git] / src / textview.c
index 4de3d134742dfc835f83a4e872b94866aa74e606..d8d56362191637ae865296325564869b3b5451e8 100644 (file)
@@ -78,6 +78,13 @@ static GdkColor quote_colors[3] = {
        {(gulong)0, (gushort)0, (gushort)0, (gushort)0}
 };
 
+static GdkColor signature_color = {
+       (gulong)0,
+       (gushort)0x7fff,
+       (gushort)0x7fff,
+       (gushort)0x7fff
+};
+       
 static GdkColor uri_color = {
        (gulong)0,
        (gushort)0,
@@ -606,7 +613,11 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo,
        conv = conv_code_converter_new(charset);
 
        tmpfp = procmime_decode_content(NULL, fp, mimeinfo);
+       
+       textview->is_in_signature = FALSE;
+
        if (tmpfp) {
+               
                if (mimeinfo->mime_type == MIME_TEXT_HTML)
                        textview_show_html(textview, tmpfp, conv);
                else if (mimeinfo->mime_type == MIME_TEXT_ENRICHED)
@@ -1079,6 +1090,11 @@ static void textview_write_line(TextView *textview, const gchar *str,
        else
                fg_color = &quote_colors[quotelevel];
 
+       if (prefs_common.enable_color && (strcmp(buf,"-- \n") == 0 || textview->is_in_signature)) {
+               fg_color = &signature_color;
+               textview->is_in_signature = TRUE;
+       }
+       
        if (prefs_common.head_space && spacingfont && buf[0] != '\n')
                gtk_stext_insert(text, spacingfont, NULL, NULL, " ", 1);
 
@@ -1661,6 +1677,10 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                textview_scroll_one_line(textview,
                                         (event->state & GDK_MOD1_MASK) != 0);
                break;
+       case GDK_Delete:
+               if (summaryview)
+                       summary_pass_key_press_event(summaryview, event);
+               break;
        case GDK_n:
        case GDK_N:
        case GDK_p: