Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: chrome/browser/cocoa/tab_controller.mm

Issue 165499: Updates to clean up default theme and add hover states (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/tab_controller.h ('k') | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_controller.mm
===================================================================
--- chrome/browser/cocoa/tab_controller.mm (revision 24798)
+++ chrome/browser/cocoa/tab_controller.mm (working copy)
@@ -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
« no previous file with comments | « chrome/browser/cocoa/tab_controller.h ('k') | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698