[Xfce4-commits] <postler:master> Only inherit link color specifically for %sender%

Christian Dywan noreply at xfce.org
Thu Jun 30 03:46:01 CEST 2011


Updating branch refs/heads/master
         to ab098c2a8c74e0a2b7036007195d27d7afbd225b (commit)
       from efd11b6451dbb02d6564a01592882073e09a9511 (commit)

commit ab098c2a8c74e0a2b7036007195d27d7afbd225b
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Jun 30 01:19:20 2011 +0200

    Only inherit link color specifically for %sender%

 postler/postler-content.vala |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 403e1e8..314ec57 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -116,10 +116,6 @@ public class Postler.Content : WebKit.WebView {
         .actions {
             float: right;
         }
-        /* Do inherit colors, to match Adium and Empathy */
-        a, a[href] {
-            color: inherit;
-        }
         /* Dynamically sized and visible statusbar */
         a[href^=http]:hover:after {
             content: attr(href);
@@ -195,7 +191,7 @@ public class Postler.Content : WebKit.WebView {
             .replace ("<", "<").replace (">", ">");
     }
 
-    internal static string linkify_address (string addresses, string? arguments) {
+    internal static string linkify_address (string addresses, string? arguments, bool inherit=false) {
         var linkified = new StringBuilder ();
 
         string edit_icon = "";
@@ -225,8 +221,11 @@ public class Postler.Content : WebKit.WebView {
                 continue;
             if (linkified.len > 0)
                linkified.append (", ");
-            linkified.append ("<a href=\"mailto:" + quoted + (arguments != null ? arguments : "") +
-                "\" title=\"" + quoted + "\">" + name + "</a>");
+            linkified.append_printf ("<a href=\"mailto:%s\"",
+                quoted + (arguments != null ? arguments : ""));
+            if (inherit)
+                 linkified.append (" style=\"color:inherit\"");
+            linkified.append ("\" title=\"" + quoted + "\">" + name + "</a>");
             if (edit_icon != "")
                 linkified.append ((" <a href=\"contact:%s:%s\">%s</a>").printf (
                                   name, html_escape (parsed[1]), edit_icon));
@@ -730,7 +729,8 @@ public class Postler.Content : WebKit.WebView {
                 else
                     reply_markup = content_template.replace ("%message%", reply_chunk.str);
                 reply_markup = reply_markup.replace ("\"%sender%\"", ("\"" + child.sender + "\""));
-                reply_markup = reply_markup.replace ("%sender%", linkify_address (child.sender, null));
+                /* Do inherit colors, to match Adium and Empathy */
+                reply_markup = reply_markup.replace ("%sender%", linkify_address (child.sender, null, true));
                 reply_markup = reply_markup.replace ("%time{%X}%", format_date (child.date));
                 string avatar_uri = "Incoming/buddy_icon.png";
                 if (child.avatar != null && child.avatar.get_path () != null) {



More information about the Xfce4-commits mailing list