[evolution/webkit: 121/123] Make short headers aweare of text reading direction



commit 5fabb0d3c10b78bf291d73af064e879d2992b7bf
Author: Dan VrÃtil <dan progdan cz>
Date:   Wed Jan 18 22:03:20 2012 +0100

    Make short headers aweare of text reading direction

 mail/em-format-html.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 1be81f7..a190cd9 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -2167,6 +2167,7 @@ efh_format_short_headers (EMFormatHTML *efh,
 	struct _camel_header_address *addrs = NULL;
 	struct _camel_header_raw *header;
 	GString *from;
+        gboolean is_rtl;
 
 	if (cancellable && g_cancellable_is_cancelled (cancellable))
 		return;
@@ -2209,11 +2210,20 @@ efh_format_short_headers (EMFormatHTML *efh,
 		header = header->next;
 	}
 
-	g_string_append_printf (
-		buffer,
-		"<tr><td><strong>%s</strong> %s%s%s</td></tr>",
-		subject ? subject : _("(no subject)"),
-		from->len ? "(" : "", from->str, from->len ? ")" : "");
+	is_rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
+        if (is_rtl) {
+                g_string_append_printf (
+                        buffer,
+                        "<tr><td width=\"100%%\" align=\"right\">%s%s%s <strong>%s</strong></td></tr>",
+                        from->len ? "(" : "", from->str, from->len ? ")" : "",
+                        subject ? subject : _("(no subject)"));
+        } else {
+                g_string_append_printf (
+                        buffer,
+                        "<tr><td><strong>%s</strong> %s%s%s</td></tr>",
+                        subject ? subject : _("(no subject)"),
+                        from->len ? "(" : "", from->str, from->len ? ")" : "");
+        }
 
 	g_string_append (buffer, "</table>");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]