diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-25 14:58:56 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-25 14:58:56 +0000 |
commit | 9d7995f675582e5804f644d694bf3f15a1f11d83 (patch) | |
tree | 60731b530d838ca3d1ab6457e5b48d41fced9581 | |
parent | 42d46a83e233af4c2161af47760bb654c66e9c9e (diff) | |
download | chromium_src-9d7995f675582e5804f644d694bf3f15a1f11d83.zip chromium_src-9d7995f675582e5804f644d694bf3f15a1f11d83.tar.gz chromium_src-9d7995f675582e5804f644d694bf3f15a1f11d83.tar.bz2 |
Zoom bubble: Use white on blue text on hover
In the zoom bubble, when hovering over a button the background changes
to blue but the text remains gray. This CL changes the text color to
white on hover.
BUG= 297807
TEST=Zoomed into a page. Verified that button text changes to white
on hover.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/24238010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225187 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm index 7273bb0..cc4193c 100644 --- a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm @@ -304,14 +304,26 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { - (void)drawRect:(NSRect)rect { NSRect bounds = [self bounds]; + NSAttributedString* title = [self attributedTitle]; if ([self hoverState] != kHoverStateNone) { ui::NativeTheme* nativeTheme = ui::NativeTheme::instance(); [gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor)) set]; NSRectFillUsingOperation(bounds, NSCompositeSourceOver); + + // Change the title color. + base::scoped_nsobject<NSMutableAttributedString> selectedTitle( + [[NSMutableAttributedString alloc] initWithAttributedString:title]); + NSColor* selectedTitleColor = + gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor)); + [selectedTitle addAttribute:NSForegroundColorAttributeName + value:selectedTitleColor + range:NSMakeRange(0, [title length])]; + title = selectedTitle.autorelease(); } - [[self cell] drawTitle:[self attributedTitle] + [[self cell] drawTitle:title withFrame:bounds inView:self]; } |