[empathy] use the 'user-invisible' icon if implemented



commit 242c8fda4fbf2bb57ebc3502eed4628cf81203ff
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Mar 2 12:16:52 2010 +0100

    use the 'user-invisible' icon if implemented

 libempathy-gtk/empathy-images.h   |    4 +++-
 libempathy-gtk/empathy-ui-utils.c |    8 +++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-images.h b/libempathy-gtk/empathy-images.h
index c303fe7..d5fa536 100644
--- a/libempathy-gtk/empathy-images.h
+++ b/libempathy-gtk/empathy-images.h
@@ -25,7 +25,9 @@
 G_BEGIN_DECLS
 
 #define EMPATHY_IMAGE_OFFLINE             "user-offline"
-#define EMPATHY_IMAGE_HIDDEN              "user-offline"
+/* user-invisible is not (yet?) in the naming spec but already implemented by
+ * some theme */
+#define EMPATHY_IMAGE_HIDDEN              "user-invisible"
 #define EMPATHY_IMAGE_AVAILABLE           "user-available"
 #define EMPATHY_IMAGE_BUSY                "user-busy"
 #define EMPATHY_IMAGE_AWAY                "user-away"
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index d4de211..422eb91 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -183,7 +183,13 @@ empathy_icon_name_for_presence (TpConnectionPresenceType presence)
 	case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
 		return EMPATHY_IMAGE_EXT_AWAY;
 	case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
-		return EMPATHY_IMAGE_HIDDEN;
+		if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
+					     EMPATHY_IMAGE_HIDDEN))
+			return EMPATHY_IMAGE_HIDDEN;
+
+		/* The 'hidden' icon is not an official one so we fallback to offline if
+		 * it's not implemented */
+		return EMPATHY_IMAGE_OFFLINE;
 	case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
 	case TP_CONNECTION_PRESENCE_TYPE_ERROR:
 	case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:



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