diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 23:51:17 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 23:51:17 +0000 |
commit | 9b5d7374459f0deee6dbf7a5aa4dc43aec25e38c (patch) | |
tree | 06f68e313e76256c0245f7082dba8e6b23d7569e /chrome/browser/cocoa/tab_controller.mm | |
parent | 15123a7ca58102854802075f6efb3c5e5cc23e23 (diff) | |
download | chromium_src-9b5d7374459f0deee6dbf7a5aa4dc43aec25e38c.zip chromium_src-9b5d7374459f0deee6dbf7a5aa4dc43aec25e38c.tar.gz chromium_src-9b5d7374459f0deee6dbf7a5aa4dc43aec25e38c.tar.bz2 |
Updates to clean up default theme and add hover states.
Patch by Cole.
BUG=http://crbug.com/18573;http://crbug.com/18574;http://crbug.com/18360;http://crbug.com/18438
TEST=none
Review URL: http://codereview.chromium.org/165499
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24700 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/tab_controller.mm | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/tab_controller.mm b/chrome/browser/cocoa/tab_controller.mm index cff9f81..96d7e5d 100644 --- a/chrome/browser/cocoa/tab_controller.mm +++ b/chrome/browser/cocoa/tab_controller.mm @@ -7,6 +7,7 @@ #import "chrome/browser/cocoa/tab_controller.h" #import "chrome/browser/cocoa/tab_controller_target.h" #import "chrome/browser/cocoa/tab_view.h" +#import "third_party/GTM/AppKit/GTMTheme.h" @interface TabController(Private) - (void)updateVisibility; @@ -53,7 +54,7 @@ selected_ = selected; [(TabView *)[self view] setState:selected]; [self updateVisibility]; - [[self view] setNeedsDisplay:YES]; + [self applyTheme]; } // Called when the tab's nib is done loading and all outlets are hooked up. @@ -61,9 +62,6 @@ // Ensure we don't show favicon if the tab is already too small to begin with. [self updateVisibility]; [(id)iconView_ setImage:nsimage_cache::ImageNamed(@"nav.pdf")]; - [[self view] addSubview:backgroundButton_ - positioned:NSWindowBelow - relativeTo:nil]; [self internalSetSelected:selected_]; } @@ -91,7 +89,7 @@ } - (void)setTitle:(NSString *)title { - [backgroundButton_ setToolTip:title]; + [[self view] setToolTip:title]; [super setTitle:title]; } @@ -119,7 +117,7 @@ } - (NSString *)toolTip { - return [backgroundButton_ toolTip]; + return [[self view] toolTip]; } // Return a rough approximation of the number of icons we could fit in the @@ -168,4 +166,20 @@ [self updateVisibility]; } +- (void)applyTheme { + GTMTheme* theme = [[self view] gtm_theme]; + NSColor* color = nil; + if (!selected_) { + color = [theme textColorForStyle:GTMThemeStyleTabBarDeselected + state:GTMThemeStateActiveWindow]; + } + // Default to the selected text color unless told otherwise. + if (!color) { + color = [theme textColorForStyle:GTMThemeStyleToolBar + state:GTMThemeStateActiveWindow]; + } + + [titleView_ setTextColor:color ? color : [NSColor textColor]]; + [[self view] setNeedsDisplay:YES]; +} @end |