[polari] room: Only use icons for private chats



commit 2026bb61d494db120406fd52381ecd57b4c22e4b
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Oct 17 18:40:31 2013 +0200

    room: Only use icons for private chats
    
    Repeating the same element for almost every item in the list is
    not very useful and makes it actually harder to identify private
    chats, so drop the bubble icons from rooms while keeping the
    avatar icon for direct messages.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710308

 src/lib/polari-room.c |   15 ++++-----------
 src/roomList.js       |   10 ++++++----
 2 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/src/lib/polari-room.c b/src/lib/polari-room.c
index 12611b4..a72a403 100644
--- a/src/lib/polari-room.c
+++ b/src/lib/polari-room.c
@@ -240,17 +240,10 @@ update_icon (PolariRoom *room)
 
   g_clear_object (&priv->icon);
 
-  if (priv->channel)
-    {
-      const char *icon_name;
-      gboolean is_private;
-
-      is_private = !tp_proxy_has_interface_by_id (TP_PROXY (priv->channel),
-                                                  TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP);
-      icon_name = is_private ? "avatar-default-symbolic"
-                             : "user-available-symbolic";
-      priv->icon = g_themed_icon_new (icon_name);
-    }
+  if (priv->channel &&
+      !tp_proxy_has_interface_by_id (TP_PROXY (priv->channel),
+                                     TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))
+    priv->icon = g_themed_icon_new ("avatar-default-symbolic");
 
   g_object_notify_by_pspec (G_OBJECT (room), props[PROP_ICON]);
 }
diff --git a/src/roomList.js b/src/roomList.js
index d689652..dfaff95 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -92,10 +92,12 @@ const RoomRow = new Lang.Class({
                                 margin_top: 2, margin_bottom: 2, spacing: 6 });
         this._eventBox.add(box);
 
-        let icon = new Gtk.Image({ gicon: gicon,
-                                   icon_size: Gtk.IconSize.MENU,
-                                   valign: Gtk.Align.BASELINE });
-        box.add(icon);
+        if (gicon) {
+            let icon = new Gtk.Image({ gicon: gicon,
+                                       icon_size: Gtk.IconSize.MENU,
+                                       valign: Gtk.Align.BASELINE });
+            box.add(icon);
+        }
 
         this._roomLabel = new Gtk.Label({ hexpand: true,
                                           ellipsize: Pango.EllipsizeMode.END,


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