aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-14 22:00:18 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-14 22:00:18 +0800
commit82dc265d727215af29471fcee699b9437adcc819 (patch)
treea98d436df664c6c3e969b13e52345ff1d02624b7
parent7e7b3651a0dfc97358dcefeb176a1f8807269601 (diff)
downloadgsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.tar
gsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.tar.gz
gsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.tar.bz2
gsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.tar.lz
gsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.tar.xz
gsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.tar.zst
gsoc2013-empathy-82dc265d727215af29471fcee699b9437adcc819.zip
Show/Hide contact list if we have/haven't a remote_contact.
svn path=/trunk/; revision=940
-rw-r--r--libempathy-gtk/empathy-chat.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 3dbda9aea..34bd39831 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -79,6 +79,7 @@ struct _EmpathyChatPriv {
guint block_events_timeout_id;
TpHandleType handle_type;
gpointer token;
+ gint contacts_width;
GtkWidget *widget;
GtkWidget *hpaned;
@@ -275,6 +276,7 @@ chat_destroy_cb (EmpathyTpChat *tp_chat,
if (priv->tp_chat) {
g_object_unref (priv->tp_chat);
priv->tp_chat = NULL;
+ g_object_notify (G_OBJECT (chat), "tp-chat");
}
empathy_chat_view_append_event (chat->view, _("Disconnected"));
@@ -1256,6 +1258,26 @@ chat_members_changed_cb (EmpathyTpChat *tp_chat,
}
static void
+chat_set_show_contacts (EmpathyChat *chat, gboolean show)
+{
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+
+ if (!priv->scrolled_window_contacts ||
+ GTK_WIDGET_VISIBLE (priv->scrolled_window_contacts) == show) {
+ return;
+ }
+
+ if (show) {
+ gtk_widget_show (priv->scrolled_window_contacts);
+ gtk_paned_set_position (GTK_PANED (priv->hpaned),
+ priv->contacts_width);
+ } else {
+ priv->contacts_width = gtk_paned_get_position (GTK_PANED (priv->hpaned));
+ gtk_widget_hide (priv->scrolled_window_contacts);
+ }
+}
+
+static void
chat_remote_contact_changed_cb (EmpathyChat *chat)
{
EmpathyChatPriv *priv = GET_PRIV (chat);
@@ -1270,6 +1292,8 @@ chat_remote_contact_changed_cb (EmpathyChat *chat)
g_object_ref (priv->remote_contact);
}
+ chat_set_show_contacts (chat, priv->remote_contact == NULL);
+
g_object_notify (G_OBJECT (chat), "remote-contact");
}
@@ -1356,6 +1380,9 @@ chat_create_ui (EmpathyChat *chat)
/* Initialy hide the topic, will be shown if not empty */
gtk_widget_hide (priv->hbox_topic);
+ /* Show/Hide contact list */
+ chat_set_show_contacts (chat, priv->remote_contact == NULL);
+
/* Set widget focus order */
list = g_list_append (NULL, priv->scrolled_window_input);
gtk_container_set_focus_chain (GTK_CONTAINER (priv->vbox_left), list);