summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-24 20:29:43 +0000
committerrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-24 20:29:43 +0000
commit79307e4448f376352a896d5e92f25f94e16d0870 (patch)
treec9f444b6cf49f2db08de64fa58be89413b6805ac
parent75885308023880452699d5fe0e3888ab5554faaf (diff)
downloadchromium_src-79307e4448f376352a896d5e92f25f94e16d0870.zip
chromium_src-79307e4448f376352a896d5e92f25f94e16d0870.tar.gz
chromium_src-79307e4448f376352a896d5e92f25f94e16d0870.tar.bz2
Adding in a constant for hover slide opacity so that the hover is more visible in different windows variations (e.g., aero).
Also fixing an issue where the hover glow would disappear immediately on mouse out rather than fading with the rest of the tab. BUG=none TEST=visual, ui_tests Review URL: http://codereview.chromium.org/6250011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72377 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/tabs/tab.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index b65df36..d6bf9a9 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -52,6 +52,7 @@ static const int kMiniTabRendererAsNormalTabWidth =
// How opaque to make the hover state (out of 1).
static const double kHoverOpacity = 0.33;
+static const double kHoverSlideOpacity = 0.5;
Tab::TabImage Tab::tab_alpha_ = {0};
Tab::TabImage Tab::tab_active_ = {0};
@@ -503,7 +504,8 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
canvas->DrawBitmapInt(background_canvas.ExtractBitmap(), 0, 0);
if (!GetThemeProvider()->HasCustomImage(tab_id) &&
- hover_animation() && hover_animation()->IsShowing()) {
+ hover_animation() &&
+ (hover_animation()->IsShowing() || hover_animation()->is_animating())) {
SkBitmap hover_glow = DrawHoverGlowBitmap(width(), height());
// Draw the hover glow clipped to the background into hover_image.
SkBitmap hover_image = SkBitmapOperations::CreateMaskedBitmap(
@@ -580,8 +582,8 @@ SkBitmap Tab::DrawHoverGlowBitmap(int width_input, int height_input) {
const ui::SlideAnimation* hover_slide = hover_animation();
int hover_alpha = 0;
if (hover_slide) {
- hover_alpha =
- static_cast<int>(255 * kHoverOpacity * hover_slide->GetCurrentValue());
+ hover_alpha = static_cast<int>(255 * kHoverSlideOpacity *
+ hover_slide->GetCurrentValue());
}
colors[0] = SkColorSetARGB(hover_alpha, 255, 255, 255);
colors[1] = SkColorSetARGB(0, 255, 255, 255);