diff --git a/data/webview.css b/data/webview.css
index 8d4c3397c2..f28ed3d668 100644
--- a/data/webview.css
+++ b/data/webview.css
@@ -72,6 +72,50 @@ object { /* GtkWidgets */
font-weight: bold;
}
+/**** HEADERS ****/
+
+table.header {
+ border-spacing: 0px;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ width: 100%;
+}
+
+tr.header {
+ vertical-align: top;
+ width: 100%;
+}
+
+th.header {
+ white-space: nowrap;
+}
+
+td.header {
+ width: inherit;
+}
+
+.ltr {
+ text-align: left;
+}
+
+th.ltr {
+ padding-right: 6px;
+ text-align: right;
+ width: auto;
+}
+
+.rtl {
+ text-align: right;
+}
+
+th.rtl {
+ padding-left: 6px;
+ text-align: left;
+ width: auto;
+}
+
/***** PRINTING *******/
.printing-header {
diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c
index 89ac5f677a..a3d7b20680 100644
--- a/em-format/e-mail-formatter-headers.c
+++ b/em-format/e-mail-formatter-headers.c
@@ -54,6 +54,7 @@ format_short_headers (EMailFormatter *formatter,
guint32 flags,
GCancellable *cancellable)
{
+ GtkTextDirection direction;
const gchar *charset;
CamelContentType *ct;
gchar *hdr_charset;
@@ -62,11 +63,12 @@ format_short_headers (EMailFormatter *formatter,
struct _camel_header_address *addrs = NULL;
struct _camel_header_raw *header;
GString *from;
- gboolean is_rtl;
if (g_cancellable_is_cancelled (cancellable))
return;
+ direction = gtk_widget_get_default_direction ();
+
ct = camel_mime_part_get_content_type ((CamelMimePart *) part);
charset = camel_content_type_param (ct, "charset");
charset = camel_iconv_charset_name (charset);
@@ -79,9 +81,9 @@ format_short_headers (EMailFormatter *formatter,
g_string_append_printf (
buffer,
- "
");
@@ -257,10 +249,23 @@ format_full_headers (EMailFormatter *formatter,
gboolean mail_from_delegate = FALSE;
gchar *hdr_charset;
gchar *evolution_imagesdir;
+ const gchar *direction;
if (g_cancellable_is_cancelled (cancellable))
return;
+ switch (gtk_widget_get_default_direction ()) {
+ case GTK_TEXT_DIR_RTL:
+ direction = "rtl";
+ break;
+ case GTK_TEXT_DIR_LTR:
+ direction = "ltr";
+ break;
+ default:
+ direction = "inherit";
+ break;
+ }
+
ct = camel_mime_part_get_content_type ((CamelMimePart *) part);
charset = camel_content_type_param (ct, "charset");
charset = camel_iconv_charset_name (charset);
@@ -272,9 +277,12 @@ format_full_headers (EMailFormatter *formatter,
g_string_append_printf (
buffer,
- "",
- flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED ? "none" : "block");
+ "",
+ flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED ? "none" : "table",
+ direction);
header = ((CamelMimePart *) part)->headers;
while (header != NULL) {
@@ -356,7 +364,7 @@ format_full_headers (EMailFormatter *formatter,
g_string_append (
buffer,
"| "
- " |