diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 21:34:01 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 21:34:01 +0000 |
commit | 778b07162832ede8794dc72f859534d7ff6849a2 (patch) | |
tree | 022ada195a96df1771103332ae25ad9f729a4b2b /chrome/browser | |
parent | 306b3d6160197f1c807266719057338808ad97c6 (diff) | |
download | chromium_src-778b07162832ede8794dc72f859534d7ff6849a2.zip chromium_src-778b07162832ede8794dc72f859534d7ff6849a2.tar.gz chromium_src-778b07162832ede8794dc72f859534d7ff6849a2.tar.bz2 |
Nukes changing the size of the icon on hover, and instead changes
the size of the icon when the tab is in the background and the title
changes.
BUG=37333
TEST=none
Review URL: http://codereview.chromium.org/974003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 1697d79..6b5e1f9 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -87,8 +87,9 @@ const double kMiniTitleChangeThrobOpacity = 0.75; // Duration for when the title of an inactive mini-tab changes. const int kMiniTitleChangeThrobDuration = 1000; -// Size to render the favicon at when the mouse is over a mini-tab. -static const int kMiniTabHoverFavIconSize = 24; +// When the title of a mini-tab in the background changes the size of the icon +// animates. This is the max size we let the icon go to. +static const int kMiniTitleChangeMaxFaviconSize = 22; namespace { @@ -416,13 +417,13 @@ void TabRenderer::PaintIcon(gfx::Canvas* canvas) { int x = favicon_bounds_.x(); int y = favicon_bounds_.y() + fav_icon_hiding_offset_; int size = kFavIconSize; - if (mini() && (hover_animation_->IsAnimating() || - hover_animation_->IsShowing())) { - int hover_size = hover_animation_->CurrentValueBetween( - size, kMiniTabHoverFavIconSize); - x -= (hover_size - size) / 2; - y -= (hover_size - size) / 2; - size = hover_size; + if (mini() && mini_title_animation_.get() && + mini_title_animation_->IsAnimating()) { + int throb_size = mini_title_animation_->CurrentValueBetween( + size, kMiniTitleChangeMaxFaviconSize); + x -= (throb_size - size) / 2; + y -= (throb_size - size) / 2; + size = throb_size; } canvas->DrawBitmapInt(data_.favicon, 0, 0, data_.favicon.width(), @@ -824,10 +825,6 @@ double TabRenderer::GetThrobValue() { if (pulse_animation_->IsAnimating()) return pulse_animation_->GetCurrentValue() * kHoverOpacity; - if (mini_title_animation_.get() && mini_title_animation_->IsAnimating()) - return mini_title_animation_->GetCurrentValue() * - kMiniTitleChangeThrobOpacity; - return hover_animation_.get() ? kHoverOpacity * hover_animation_->GetCurrentValue() : 0; } |