From 847a2ea867f4006e75ee26ba16cc96ba6b26a5ed Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Wed, 27 Jun 2012 10:43:21 +0100 Subject: Boxes theme: implement set_show_avatars https://bugzilla.gnome.org/show_bug.cgi?id=627948 --- libempathy-gtk/empathy-theme-boxes.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'libempathy-gtk') 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) @@ -362,6 +367,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) { @@ -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; +} -- cgit v1.2.3