summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 19:28:41 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 19:28:41 +0000
commiteea0526eded56a20bad7b627717a292846c13e21 (patch)
tree188cc55138f7e9547560e8c89b568428cec384e4
parentaf5215d1f5009d383e47cca6b5a548007bec057f (diff)
downloadchromium_src-eea0526eded56a20bad7b627717a292846c13e21.zip
chromium_src-eea0526eded56a20bad7b627717a292846c13e21.tar.gz
chromium_src-eea0526eded56a20bad7b627717a292846c13e21.tar.bz2
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
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc5
-rw-r--r--chrome/browser/gtk/slide_animator_gtk.cc8
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 69b9025..4f84e77 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -242,7 +242,10 @@ void FindBarGtk::OnSizeAllocate(GtkWidget* fixed,
FindBarGtk* findbar) {
// Set the background widget to the size of |fixed|.
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_|.
diff --git a/chrome/browser/gtk/slide_animator_gtk.cc b/chrome/browser/gtk/slide_animator_gtk.cc
index 729679f..702c355 100644
--- a/chrome/browser/gtk/slide_animator_gtk.cc
+++ b/chrome/browser/gtk/slide_animator_gtk.cc
@@ -13,11 +13,11 @@ namespace {
void OnFixedSizeAllocate(GtkWidget* fixed,
GtkAllocation* allocation,
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,
- // but the height should always be |widget_height_|.
- gtk_widget_set_size_request(child, allocation->width, height);
+ // but the height should not change.
+ GtkAllocation new_allocation = child->allocation;
+ new_allocation.width = allocation->width;
+ gtk_widget_size_allocate(child, &new_allocation);
}
} // namespace