diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-08 19:00:24 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-08 19:00:24 +0000 |
commit | 8a09dd59af03959f79a7f87dca6735bef7745170 (patch) | |
tree | 6a6430a406eeaafbddd31373ce0326cb88516f53 /chrome/browser/views | |
parent | 08816d0d2f0373d066558e3b60783924f6b69aa3 (diff) | |
download | chromium_src-8a09dd59af03959f79a7f87dca6735bef7745170.zip chromium_src-8a09dd59af03959f79a7f87dca6735bef7745170.tar.gz chromium_src-8a09dd59af03959f79a7f87dca6735bef7745170.tar.bz2 |
Fixes bug during tab close that results in all tabs after closed tab
getting shifted to the left by one pixel. Forcing another layout (by
resizing window or such) results in everything fixing itself.
When closing a tab we resize the closed tabs width to
Tab::GetMinimumUnselectedSize().width(). Subsequent tabs are
positioned at width +
kTabHOffset. Tab::GetMinimumUnselectedSize().width() is 15, where as
kTabHOffset is -16, resulting in all subsequent tabs shifting to the
left by 1.
You'll have to tell me if this is the right fix. I suspect this could
also be fixed by changing Tab::GetMinimumUnselectedSize().width() to
be kTabHOffset, but I'm not sure what the effects of that are. We
could also enforce next x not shifting back in AnimationLayout
BUG=none
TEST=create two tabs, select the first and close it. Resize the window
a bit and make sure the tab doesn't shift to the right.
Review URL: http://codereview.chromium.org/13625
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index eb344c0..5569de3 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -293,8 +293,11 @@ class RemoveTabAnimation : public TabStrip::TabAnimation { // of the animation. // Removed animated Tabs are never selected. double start_width = start_unselected_width_; + // Make sure target_width is at least abs(kTabHOffset), otherwise if + // less than kTabHOffset during layout tabs get negatively offset. double target_width = - Tab::GetMinimumUnselectedSize().width() + kTabHOffset; + std::max(abs(kTabHOffset), + Tab::GetMinimumUnselectedSize().width() + kTabHOffset); double delta = start_width - target_width; return start_width - (delta * animation_.GetCurrentValue()); } |