diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-31 22:02:49 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-31 22:02:49 +0000 |
commit | 324ad2f3d320abff71801dd3b4af2ff02100da40 (patch) | |
tree | ce61a71c7d20ce630e0f3984b6c0809b0085c4f2 /chrome/browser/cocoa/bookmark_button_cell.mm | |
parent | c8f67b0d6ceb690fbf02f15777356fbe03af9ac2 (diff) | |
download | chromium_src-324ad2f3d320abff71801dd3b4af2ff02100da40.zip chromium_src-324ad2f3d320abff71801dd3b4af2ff02100da40.tar.gz chromium_src-324ad2f3d320abff71801dd3b4af2ff02100da40.tar.bz2 |
Make the "off the side" menu (chevron) behave like the other bookmark
bar folders. E.g. supports DragAndDrop.
BUG=34910
TEST=Make sure you can DnD items to/from the "off the side" chevron.
Make sure context menus on those buttons work as well (e.g. delete).
Make sure the chevron is NOT draggable.
Make sure the chevron works properly as a "hover open" button when
dragging something else around; e.g. it pops open if you hover over
it. (It's small so this may take patience).
Drop a folder from the bar into itself. Make sure we don't crash.
xib change:
- chevron button is now BookmarkButton, not MenuButton.
Also has BookmarkButtonCell in it.
- "off the side" menu removed.
Review URL: http://codereview.chromium.org/1520003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_button_cell.mm')
-rw-r--r-- | chrome/browser/cocoa/bookmark_button_cell.mm | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/chrome/browser/cocoa/bookmark_button_cell.mm b/chrome/browser/cocoa/bookmark_button_cell.mm index e7f7656..7125a5c 100644 --- a/chrome/browser/cocoa/bookmark_button_cell.mm +++ b/chrome/browser/cocoa/bookmark_button_cell.mm @@ -7,28 +7,46 @@ #import "chrome/browser/cocoa/bookmark_button_cell.h" #import "chrome/browser/cocoa/bookmark_menu.h" + +@interface BookmarkButtonCell(Private) +- (void)configureBookmarkButtonCell; +@end + + @implementation BookmarkButtonCell +@synthesize startingChildIndex = startingChildIndex_; + - (id)initTextCell:(NSString*)string { if ((self = [super initTextCell:string])) { - [self setButtonType:NSMomentaryPushInButton]; - [self setBezelStyle:NSShadowlessSquareBezelStyle]; - [self setShowsBorderOnlyWhileMouseInside:YES]; - [self setControlSize:NSSmallControlSize]; - [self setAlignment:NSLeftTextAlignment]; - [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; - [self setWraps:NO]; - // NSLineBreakByTruncatingMiddle seems more common on OSX but let's - // try to match Windows for a bit to see what happens. - [self setLineBreakMode:NSLineBreakByTruncatingTail]; - - // Theming doesn't work for bookmark buttons yet (text chucked). - [super setShouldTheme:NO]; - + [self configureBookmarkButtonCell]; } return self; } +// Used by the off-the-side menu, the only case where a +// BookmarkButtonCell is loaded from a nib. +- (void)awakeFromNib { + [self configureBookmarkButtonCell]; +} + +// Perform all normal init routines specific to the BookmarkButtonCell. +- (void)configureBookmarkButtonCell { + [self setButtonType:NSMomentaryPushInButton]; + [self setBezelStyle:NSShadowlessSquareBezelStyle]; + [self setShowsBorderOnlyWhileMouseInside:YES]; + [self setControlSize:NSSmallControlSize]; + [self setAlignment:NSLeftTextAlignment]; + [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [self setWraps:NO]; + // NSLineBreakByTruncatingMiddle seems more common on OSX but let's + // try to match Windows for a bit to see what happens. + [self setLineBreakMode:NSLineBreakByTruncatingTail]; + + // Theming doesn't work for bookmark buttons yet (cell text is chucked). + [super setShouldTheme:NO]; +} + - (BOOL)empty { return empty_; } |