summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-26 20:03:04 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-26 20:03:04 +0000
commit1aa93f19d8f551b1fbcf3912a33082963e8fd4be (patch)
tree4e9b4d826e41969dd8cee68627537abb8229c6b7 /chrome/browser/cocoa
parentcb0fc545664a5dd3c2d61f83b433197b8db4fdb4 (diff)
downloadchromium_src-1aa93f19d8f551b1fbcf3912a33082963e8fd4be.zip
chromium_src-1aa93f19d8f551b1fbcf3912a33082963e8fd4be.tar.gz
chromium_src-1aa93f19d8f551b1fbcf3912a33082963e8fd4be.tar.bz2
fix button cell to use cell's tag for appearance, not the button's cell which is reserved for command dispatch
Review URL: http://codereview.chromium.org/18773 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8653 0039d316-1c4b-4281-b951-d872f2087c98
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;