From e8abbdfc6887557b81768ddb9fd9d0c0884bd7f0 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 20 Apr 2008 20:33:53 +0000 Subject: Don't resize the window when a contact list appear if it's already big enough. svn path=/trunk/; revision=1016 --- libempathy-gtk/empathy-chat.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 6bb983a5f..85956c812 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -1283,15 +1283,19 @@ chat_set_show_contacts (EmpathyChat *chat, gboolean show) } if (show) { - if (priv->contacts_width <= 0) { - /* It's the first time we show the contact list, make - * sure the chat view don't get resized. Relax the - * size request once it's done. */ - gtk_widget_set_size_request (priv->vbox_left, - priv->vbox_left->allocation.width, - -1); - g_idle_add (chat_reset_size_request, priv->vbox_left); - } else { + gint min_width; + + /* We are adding the contact list to the chat, we don't want the + * chat view to become too small. If the chat view is already + * smaller than 250 make sure that size won't change. If the + * chat view is bigger the contact list will take some space on + * it but we make sure the chat view don't become smaller than + * 250. Relax the size request once the resize is done */ + min_width = MIN (priv->vbox_left->allocation.width, 250); + gtk_widget_set_size_request (priv->vbox_left, min_width, -1); + g_idle_add (chat_reset_size_request, priv->vbox_left); + + if (priv->contacts_width > 0) { gtk_paned_set_position (GTK_PANED (priv->hpaned), priv->contacts_width); } -- cgit v1.2.3