diff options
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 27 | ||||
-rw-r--r-- | libempathy-gtk/empathy-chat.glade | 4 |
2 files changed, 23 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index c40548b19..6bb983a5f 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -1264,6 +1264,14 @@ chat_members_changed_cb (EmpathyTpChat *tp_chat, } } +static gboolean +chat_reset_size_request (gpointer widget) +{ + gtk_widget_set_size_request (widget, -1, -1); + + return FALSE; +} + static void chat_set_show_contacts (EmpathyChat *chat, gboolean show) { @@ -1275,9 +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 { + gtk_paned_set_position (GTK_PANED (priv->hpaned), + priv->contacts_width); + } 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); @@ -1383,13 +1401,11 @@ chat_create_ui (EmpathyChat *chat) gtk_container_add (GTK_CONTAINER (priv->scrolled_window_contacts), GTK_WIDGET (priv->view)); gtk_widget_show (GTK_WIDGET (priv->view)); + chat_set_show_contacts (chat, priv->remote_contact == NULL); /* 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); @@ -1605,6 +1621,7 @@ empathy_chat_init (EmpathyChat *chat) priv->is_first_char = TRUE; priv->log_manager = empathy_log_manager_new (); priv->default_window_height = -1; + priv->contacts_width = -1; priv->vscroll_visible = FALSE; priv->sent_messages = NULL; priv->sent_messages_index = -1; diff --git a/libempathy-gtk/empathy-chat.glade b/libempathy-gtk/empathy-chat.glade index 9428474b5..f313c2f55 100644 --- a/libempathy-gtk/empathy-chat.glade +++ b/libempathy-gtk/empathy-chat.glade @@ -57,8 +57,6 @@ <property name="can_focus">True</property> <child> <widget class="GtkVBox" id="vbox_left"> - <property name="width_request">600</property> - <property name="height_request">500</property> <property name="visible">True</property> <property name="spacing">6</property> <child> @@ -107,7 +105,7 @@ </child> </widget> <packing> - <property name="resize">True</property> + <property name="resize">False</property> <property name="shrink">True</property> </packing> </child> |