[evolution/webkit: 121/182] Make short headers aweare of text reading direction
- From: Dan VrÃtil <dvratil src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit: 121/182] Make short headers aweare of text reading direction
- Date: Tue, 6 Mar 2012 16:18:53 +0000 (UTC)
commit 6c054d1ab1bd04b0e747770009c959d91778702c
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 9615596..f3c402d 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -2161,6 +2161,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;
@@ -2203,11 +2204,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]