diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 01:57:37 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 01:57:37 +0000 |
commit | d2192e3d5b90b631abf219079d93c3453f852865 (patch) | |
tree | 99d62869eba6f7dad89bb2fac682a20806d9c02a /chrome/browser/gtk/slide_animator_gtk.cc | |
parent | c9bd64d670e6fb58d24d8251d8680a0ed1cc7cc7 (diff) | |
download | chromium_src-d2192e3d5b90b631abf219079d93c3453f852865.zip chromium_src-d2192e3d5b90b631abf219079d93c3453f852865.tar.gz chromium_src-d2192e3d5b90b631abf219079d93c3453f852865.tar.bz2 |
GTK: Fix minor slide animation bugs.
Following r27934, we might hit the code path for initial positioning *after* the AnimationProgressed positioning, causing the child widget not to show.
BUG=23902
TEST=when you switch away from a tab that has an infobar, then switch back, you can see the infobar.
Review URL: http://codereview.chromium.org/258038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28214 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/slide_animator_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/slide_animator_gtk.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/gtk/slide_animator_gtk.cc b/chrome/browser/gtk/slide_animator_gtk.cc index 7a51451f..329aaa4 100644 --- a/chrome/browser/gtk/slide_animator_gtk.cc +++ b/chrome/browser/gtk/slide_animator_gtk.cc @@ -40,11 +40,10 @@ SlideAnimatorGtk::SlideAnimatorGtk(GtkWidget* child, G_CALLBACK(OnFixedSizeAllocate), child_); } - // The size of the GtkFixed widget is set during animation. When we open - // without showing the animation, we have to call AnimationProgressed - // ourselves to properly set the size of the GtkFixed. We can't do this until - // after the child has been allocated, hence we connect to "size-allocate" on - // the child. + // We connect to this signal to set an initial position for our child widget. + // The reason we connect to this signal rather than setting the initial + // position here is that the widget is currently unallocated and may not + // even have a size request. g_signal_connect(child, "size-allocate", G_CALLBACK(OnChildSizeAllocate), this); @@ -108,7 +107,8 @@ void SlideAnimatorGtk::AnimationProgressed(const Animation* animation) { animation_->GetCurrentValue()); if (direction_ == DOWN) { gtk_fixed_move(GTK_FIXED(widget_.get()), child_, 0, - showing_height - child_->allocation.height); + showing_height - req.height); + child_needs_move_ = false; } gtk_widget_set_size_request(widget_.get(), -1, showing_height); } |