]> git.0d.be Git - empathy.git/commitdiff
EmpathyChatView: add vfunc for showing/hiding avatars
authorWill Thompson <will.thompson@collabora.co.uk>
Wed, 27 Jun 2012 09:29:16 +0000 (10:29 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 28 Jun 2012 08:56:30 +0000 (10:56 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=627948

libempathy-gtk/empathy-chat-view.c
libempathy-gtk/empathy-chat-view.h

index f5d6ddf095deba9f09a1c3332edefa484a3e0e5e..7d35efb62a4250bf2325713793226d45d26d57f5 100644 (file)
@@ -253,3 +253,23 @@ empathy_chat_view_message_acknowledged (EmpathyChatView *view,
        }
 }
 
+/*
+ * empathy_chat_view_set_show_avatars:
+ * @view: a chat view
+ * @show_avatars: TRUE if contacts' avatars should be shown alongside their name
+ *
+ * At present, this is only called on freshly-constructed chat views based on
+ * whether or not the protocol supports avatars at all. Hence, themes don't
+ * have to worry about retroactively showing or hiding avatars in the
+ * scrollback.
+ */
+void
+empathy_chat_view_set_show_avatars (EmpathyChatView *view,
+                                   gboolean show_avatars)
+{
+       g_return_if_fail (EMPATHY_IS_CHAT_VIEW (view));
+
+       if (EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->set_show_avatars) {
+               EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->set_show_avatars (view, show_avatars);
+       }
+}
index 2c47e042929a96f892053fce29737f8ddb70d2b3..b263219b250164c016f0fa9b5abb12a178c62151 100644 (file)
@@ -78,6 +78,8 @@ struct _EmpathyChatViewIface {
                                                  gboolean         has_focus);
        void             (*message_acknowledged) (EmpathyChatView *view,
                                                  EmpathyMessage  *message);
+       void             (*set_show_avatars)     (EmpathyChatView *view,
+                                                 gboolean         show_avatars);
 };
 
 GType            empathy_chat_view_get_type             (void) G_GNUC_CONST;
@@ -117,6 +119,8 @@ void             empathy_chat_view_focus_toggled        (EmpathyChatView *view,
                                                         gboolean         has_focus);
 void             empathy_chat_view_message_acknowledged (EmpathyChatView *view,
                                                         EmpathyMessage  *message);
+void             empathy_chat_view_set_show_avatars     (EmpathyChatView *view,
+                                                        gboolean         show_avatars);
 
 G_END_DECLS