summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-25 01:19:10 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-25 01:19:10 +0000
commitbc9607488c5755bb3dc6536f75b496e8c6a2516b (patch)
tree2887bc8784135730b3788374b54154bd12da63b2 /chrome/browser
parent494c06ed7762ad06d70d83ce2c3c459944b3dfcd (diff)
downloadchromium_src-bc9607488c5755bb3dc6536f75b496e8c6a2516b.zip
chromium_src-bc9607488c5755bb3dc6536f75b496e8c6a2516b.tar.gz
chromium_src-bc9607488c5755bb3dc6536f75b496e8c6a2516b.tar.bz2
Stop drawing the status bubble text highlight because it sucks for themes.
BUG=none TEST=none Review URL: http://codereview.chromium.org/159292 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/views/status_bubble_views.cc39
1 files changed, 16 insertions, 23 deletions
diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc
index ecaba94..500a274 100644
--- a/chrome/browser/views/status_bubble_views.cc
+++ b/chrome/browser/views/status_bubble_views.cc
@@ -41,19 +41,12 @@ static const int kBubbleCornerRadius = 4;
// off-screen.
static const int kMousePadding = 20;
-// The color of the text
-static const SkColor kTextColor = SkColorSetRGB(100, 100, 100);
-
-// The color of the highlight text
-static const SkColor kTextHighlightColor = SkColorSetRGB(242, 250, 255);
-
// The horizontal offset of the text within the status bubble, not including the
// outer shadow ring.
static const int kTextPositionX = 3;
// The minimum horizontal space between the (right) end of the text and the edge
-// of the status bubble, not including the outer shadow ring, or a 1 px gap we
-// leave so we can shit all the text by 1 px to produce a "highlight" effect.
+// of the status bubble, not including the outer shadow ring.
static const int kTextHorizPadding = 1;
// Delays before we start hiding or showing the bubble after we receive a
@@ -337,8 +330,9 @@ void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setFlags(SkPaint::kAntiAlias_Flag);
- paint.setColor(
- theme_provider_->GetColor(BrowserThemeProvider::COLOR_TOOLBAR));
+ SkColor toolbar_color =
+ theme_provider_->GetColor(BrowserThemeProvider::COLOR_TOOLBAR);
+ paint.setColor(toolbar_color);
gfx::Rect popup_bounds;
popup_->GetBounds(&popup_bounds, true);
@@ -426,27 +420,26 @@ void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) {
// Draw highlight text and then the text body. In order to make sure the text
// is aligned to the right on RTL UIs, we mirror the text bounds if the
// locale is RTL.
- // The "- 1" on the end of the width and height ensures that when we add one
- // to x() and y() for the highlight text, we still won't overlap the shadow.
int text_width = std::min(views::Label::GetFont().GetStringWidth(text_),
- width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1);
- int text_height = height - (kShadowThickness * 2) - 1;
+ width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding);
+ int text_height = height - (kShadowThickness * 2);
gfx::Rect body_bounds(kShadowThickness + kTextPositionX,
kShadowThickness,
std::max(0, text_width),
std::max(0, text_height));
body_bounds.set_x(MirroredLeftPointForRect(body_bounds));
+ SkColor text_color =
+ theme_provider_->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT);
+
+ // DrawStringInt doesn't handle alpha, so we'll do the blending ourselves.
+ text_color = SkColorSetARGB(
+ SkColorGetA(text_color),
+ (SkColorGetR(text_color) + SkColorGetR(toolbar_color)) / 2,
+ (SkColorGetG(text_color) + SkColorGetR(toolbar_color)) / 2,
+ (SkColorGetB(text_color) + SkColorGetR(toolbar_color)) / 2);
canvas->DrawStringInt(text_,
views::Label::GetFont(),
- kTextHighlightColor,
- body_bounds.x() + 1,
- body_bounds.y() + 1,
- body_bounds.width(),
- body_bounds.height());
-
- canvas->DrawStringInt(text_,
- views::Label::GetFont(),
- kTextColor,
+ text_color,
body_bounds.x(),
body_bounds.y(),
body_bounds.width(),