entry-completion: set size request on the toplevel window

Instead of setting it on the child scrolled window. This is needed
because the whole window's allocation must be equal to the one of the
entry (in case the popup-set-width property is TRUE); if we set the size
request on a children of the window, there might be other children with
borders/paddings in between the toplevel and the child we set the size
request too, which will break alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=672947
This commit is contained in:
Cosimo Cecchi 2012-03-27 14:23:48 -04:00
parent 644070b551
commit 5a8e2b5995

View File

@ -1535,14 +1535,11 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
gtk_tree_view_columns_autosize (GTK_TREE_VIEW (completion->priv->tree_view));
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (completion->priv->scrolled_window), width);
gtk_widget_set_size_request (completion->priv->scrolled_window, width, -1);
gtk_widget_set_size_request (completion->priv->popup_window, width, -1);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (completion->priv->scrolled_window), items * height);
if (actions)
{
gtk_widget_show (completion->priv->action_view);
gtk_widget_set_size_request (completion->priv->action_view, width, -1);
}
gtk_widget_show (completion->priv->action_view);
else
gtk_widget_hide (completion->priv->action_view);