summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/toolbar_button_cell.h11
-rw-r--r--chrome/browser/cocoa/toolbar_button_cell.mm10
2 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/cocoa/toolbar_button_cell.h b/chrome/browser/cocoa/toolbar_button_cell.h
index cb7c6f4..a46cfff 100644
--- a/chrome/browser/cocoa/toolbar_button_cell.h
+++ b/chrome/browser/cocoa/toolbar_button_cell.h
@@ -8,7 +8,16 @@
#import <Cocoa/Cocoa.h>
// A button cell that handles drawing/highlighting of buttons in the
-// toolbar bar.
+// toolbar bar. The appearance is determined by setting the cell's tag (not the
+// view's) to one of the constants below (ButtonType).
+
+enum {
+ kLeftButtonType = -1,
+ kLeftButtonWithShadowType = -2,
+ kStandardButtonType = 0,
+ kRightButtonType = 1,
+};
+typedef NSInteger ButtonType;
@interface ToolbarButtonCell : NSButtonCell {
}
diff --git a/chrome/browser/cocoa/toolbar_button_cell.mm b/chrome/browser/cocoa/toolbar_button_cell.mm
index d8b0baf..54b2f7c 100644
--- a/chrome/browser/cocoa/toolbar_button_cell.mm
+++ b/chrome/browser/cocoa/toolbar_button_cell.mm
@@ -4,14 +4,6 @@
#include "chrome/browser/cocoa/toolbar_button_cell.h"
-enum {
- kLeftButtonType = -1,
- kLeftButtonWithShadowType = -2,
- kStandardButtonType = 0,
- kRightButtonType = 1,
-};
-typedef NSInteger ButtonType;
-
@implementation ToolbarButtonCell
- (NSBackgroundStyle)interiorBackgroundStyle {
@@ -21,7 +13,7 @@ typedef NSInteger ButtonType;
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView{
NSRect drawFrame = NSInsetRect(cellFrame, 1.5, 1.5);
- ButtonType type = [controlView tag];
+ ButtonType type = [[(NSControl*)controlView cell] tag];
switch (type) {
case kRightButtonType:
drawFrame.origin.x -= 20;