[Xfce4-commits] <postler:master> Render contact edit icon from stock item

Christian Dywan noreply at xfce.org
Wed Jan 19 02:58:03 CET 2011


Updating branch refs/heads/master
         to 6a2a340a9e79612477146c0356f436d1e7c0dfc3 (commit)
       from ce1ef37ffdaf008833751b29216e767af8fe3963 (commit)

commit 6a2a340a9e79612477146c0356f436d1e7c0dfc3
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jan 19 00:31:52 2011 +0100

    Render contact edit icon from stock item

 postler/postler-content.vala |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 733af5f..111d7e0 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -189,7 +189,7 @@ public class Postler.Content : WebKit.WebView {
     internal static string linkify_address (string addresses, string? arguments)
         requires (arguments == null || !arguments.contains ("<")) {
         var linkified = new StringBuilder ();
-        string data_uri = icon_name_to_data_uri ("bookmark-new");
+        string data_uri = icon_name_to_data_uri ("not-starred");
         foreach (string address in addresses.split (",")) {
             if (address == "")
                 continue;
@@ -202,7 +202,8 @@ public class Postler.Content : WebKit.WebView {
                linkified.append (", ");
             linkified.append ("<a href=\"" + quoted + (arguments != null ? arguments : "") +
                 "\" title=\"" + original + "\">" + name + "</a>");
-            linkified.append (" <a href=\"contact:%s:%s\"><img src=\"%s\"><b>←</b></a>".printf (
+            linkified.append ((" <a href=\"contact:%s:%s\">"
+                             + "<img src=\"%s\" alt=\"←\"></a>").printf (
                 name, quoted, data_uri));
         }
         return linkified.str;
@@ -317,11 +318,17 @@ public class Postler.Content : WebKit.WebView {
 
     static string? icon_name_to_data_uri (string icon_name) {
         Gdk.Pixbuf? pixbuf = null;
-        try {
-            pixbuf = Gtk.IconTheme.get_for_screen (
-                Gdk.Screen.get_default ()).load_icon (icon_name,
-                    Gtk.IconSize.MENU, Gtk.IconLookupFlags.FORCE_SIZE);
-        } catch (GLib.Error error) { }
+        var toplevels = Gtk.Window.list_toplevels ();
+        if (toplevels.nth_data (0) != null)
+            pixbuf = toplevels.nth_data (0).render_icon (icon_name,
+                Gtk.IconSize.MENU, null);
+        if (pixbuf == null) {
+            try {
+                pixbuf = Gtk.IconTheme.get_for_screen (
+                    Gdk.Screen.get_default ()).load_icon (icon_name,
+                        Gtk.IconSize.MENU, Gtk.IconLookupFlags.FORCE_SIZE);
+            } catch (GLib.Error error) { }
+        }
         if (pixbuf == null) {
             return null;
         }



More information about the Xfce4-commits mailing list