Commit eea0526e authored by estade@chromium.org's avatar estade@chromium.org

GTK: Directly allocate widgets that are children of GtkFixed.

BUG=11190

Review URL: http://codereview.chromium.org/99243

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14973 0039d316-1c4b-4281-b951-d872f2087c98
parent af5215d1
...@@ -242,7 +242,10 @@ void FindBarGtk::OnSizeAllocate(GtkWidget* fixed, ...@@ -242,7 +242,10 @@ void FindBarGtk::OnSizeAllocate(GtkWidget* fixed,
FindBarGtk* findbar) { FindBarGtk* findbar) {
// Set the background widget to the size of |fixed|. // Set the background widget to the size of |fixed|.
if (findbar->border_->allocation.width != allocation->width) { if (findbar->border_->allocation.width != allocation->width) {
gtk_widget_set_size_request(findbar->border_, allocation->width, 1); // Typically it's not a good idea to use this function outside of container
// implementations, but GtkFixed doesn't do any sizing on its children so
// in this case it's safe.
gtk_widget_size_allocate(findbar->border_, allocation);
} }
// Reposition |container_|. // Reposition |container_|.
......
...@@ -13,11 +13,11 @@ namespace { ...@@ -13,11 +13,11 @@ namespace {
void OnFixedSizeAllocate(GtkWidget* fixed, void OnFixedSizeAllocate(GtkWidget* fixed,
GtkAllocation* allocation, GtkAllocation* allocation,
GtkWidget* child) { GtkWidget* child) {
gint height;
gtk_widget_get_size_request(child, NULL, &height);
// The size of the GtkFixed has changed. We want |child_| to match widths, // The size of the GtkFixed has changed. We want |child_| to match widths,
// but the height should always be |widget_height_|. // but the height should not change.
gtk_widget_set_size_request(child, allocation->width, height); GtkAllocation new_allocation = child->allocation;
new_allocation.width = allocation->width;
gtk_widget_size_allocate(child, &new_allocation);
} }
} // namespace } // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment