From aaeb9dc745d49afa66c1b613daa5a3123f309955 Mon Sep 17 00:00:00 2001 From: "beng@google.com" Date: Wed, 30 Jul 2008 01:32:58 +0000 Subject: Fix one more glitch when drag-attaching a tab to the tabstrip. Other tabs in the strip were instantly sized to their start size for the insert tab animation (which is their current size) but this calculation didn't take into account the fact that a newly inserted tab has a minimum size so their initial size isn't just the width / n other tabs, it's (width / n other tabs) - (min width / n other tabs) B=1285677 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tabs/tab_strip.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/browser/tabs/tab_strip.cc b/chrome/browser/tabs/tab_strip.cc index 504cd0c..e3755a4 100644 --- a/chrome/browser/tabs/tab_strip.cc +++ b/chrome/browser/tabs/tab_strip.cc @@ -166,6 +166,14 @@ class TabStrip::TabAnimation : public AnimationDelegate { void GenerateStartAndEndWidths(int start_tab_count, int end_tab_count) { tabstrip_->GetDesiredTabWidths(start_tab_count, &start_unselected_width_, &start_selected_width_); + double standard_tab_width = + static_cast(TabRenderer::GetStandardSize().width()); + if (start_tab_count < end_tab_count && + start_unselected_width_ < standard_tab_width) { + double minimum_tab_width = + static_cast(TabRenderer::GetMinimumSize().width()); + start_unselected_width_ -= minimum_tab_width / start_tab_count; + } tabstrip_->GenerateIdealBounds(); tabstrip_->GetDesiredTabWidths(end_tab_count, &end_unselected_width_, -- cgit v1.1