aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-06-27 17:43:21 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-28 16:56:30 +0800
commit847a2ea867f4006e75ee26ba16cc96ba6b26a5ed (patch)
tree48d7c185418c40a1ecd3327e3e258d5babd7271e
parentdb4d1607aa0ee6988399f99efc09bed5e7133dc8 (diff)
downloadgsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.tar
gsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.tar.gz
gsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.tar.bz2
gsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.tar.lz
gsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.tar.xz
gsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.tar.zst
gsoc2013-empathy-847a2ea867f4006e75ee26ba16cc96ba6b26a5ed.zip
Boxes theme: implement set_show_avatars
https://bugzilla.gnome.org/show_bug.cgi?id=627948
-rw-r--r--libempathy-gtk/empathy-theme-boxes.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-theme-boxes.c b/libempathy-gtk/empathy-theme-boxes.c
index cf0c65268..a678c3e1c 100644
--- a/libempathy-gtk/empathy-theme-boxes.c
+++ b/libempathy-gtk/empathy-theme-boxes.c
@@ -48,7 +48,12 @@ typedef struct {
gboolean show_avatars;
} EmpathyThemeBoxesPriv;
-G_DEFINE_TYPE (EmpathyThemeBoxes, empathy_theme_boxes, EMPATHY_TYPE_CHAT_TEXT_VIEW);
+static void chat_text_view_iface_init (EmpathyChatViewIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (EmpathyThemeBoxes, empathy_theme_boxes,
+ EMPATHY_TYPE_CHAT_TEXT_VIEW,
+ G_IMPLEMENT_INTERFACE (EMPATHY_TYPE_CHAT_VIEW,
+ chat_text_view_iface_init));
static void
theme_boxes_create_tags (EmpathyThemeBoxes *theme)
@@ -363,6 +368,16 @@ theme_boxes_append_message (EmpathyChatTextView *view,
}
static void
+theme_boxes_set_show_avatars (EmpathyChatView *view,
+ gboolean show_avatars)
+{
+ EmpathyThemeBoxes *self = EMPATHY_THEME_BOXES (view);
+ EmpathyThemeBoxesPriv *priv = GET_PRIV (self);
+
+ priv->show_avatars = show_avatars;
+}
+
+static void
empathy_theme_boxes_class_init (EmpathyThemeBoxesClass *class)
{
GObjectClass *object_class;
@@ -384,8 +399,7 @@ empathy_theme_boxes_init (EmpathyThemeBoxes *theme)
theme->priv = priv;
- /* This is just hard-coded to TRUE until someone adds a tickybox in the
- * Theme tab for it. */
+ /* Show avatars by default. */
priv->show_avatars = TRUE;
theme_boxes_create_tags (theme);
@@ -405,3 +419,8 @@ empathy_theme_boxes_new (void)
NULL);
}
+static void
+chat_text_view_iface_init (EmpathyChatViewIface *iface)
+{
+ iface->set_show_avatars = theme_boxes_set_show_avatars;
+}