diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 05:45:50 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 05:45:50 +0000 |
commit | 72126d044d0e08028ff7055d91d4b7eb5e6fae1a (patch) | |
tree | 86dd0cf6bbb948286502ca9925ceaf8cc8a0c79b /chrome/browser/cocoa/bookmark_bar_folder_controller.mm | |
parent | ed448a7628414a78a8cff6069ecf87b76faa48f2 (diff) | |
download | chromium_src-72126d044d0e08028ff7055d91d4b7eb5e6fae1a.zip chromium_src-72126d044d0e08028ff7055d91d4b7eb5e6fae1a.tar.gz chromium_src-72126d044d0e08028ff7055d91d4b7eb5e6fae1a.tar.bz2 |
Revert 45151 - UI review followup for m5 bookmark bar deliverables
Remove border of the (empty) bookmark item.
Add arrow icons for folders in bookmark bar folder windows (but not on the bar)
Scroll wheel events now scroll the bookmark bar folder windows (mostly
works; has a little leakthru)
BUG=42026
TEST=see description
xib change: NSScrollView changes to a BookmarkBarFolderWindowScrollView
Review URL: http://codereview.chromium.org/1731001
TBR=jrg@chromium.org
Review URL: http://codereview.chromium.org/1727004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_folder_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_controller.mm | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm index 54e5c07..5aa8f12 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm @@ -29,11 +29,6 @@ const CGFloat kBookmarkBarFolderScrollAmount = 2 * (bookmarks::kBookmarkButtonHeight + bookmarks::kBookmarkVerticalPadding); -// Amount to scroll for each scroll wheel delta. -const CGFloat kBookmarkBarFolderScrollWheelAmount = - 1 * (bookmarks::kBookmarkButtonHeight + - bookmarks::kBookmarkVerticalPadding); - // When constraining a scrolling bookmark bar folder window to the // screen, shrink the "constrain" by this much vertically. Currently // this is 0.0 to avoid a problem with tracking areas leaving the @@ -90,7 +85,7 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; [super showWindow:sender]; } -- (BookmarkButtonCell*)cellForBookmarkNode:(const BookmarkNode*)child { +- (NSCell*)cellForBookmarkNode:(const BookmarkNode*)child { NSImage* image = child ? [barController_ favIconForNode:child] : nil; NSMenu* menu = child ? child->is_folder() ? folderMenu_ : buttonMenu_ : nil; BookmarkBarFolderButtonCell* cell = @@ -119,18 +114,9 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; // http://crbug.com/35966 - (BookmarkButton*)makeButtonForNode:(const BookmarkNode*)node frame:(NSRect)frame { - BookmarkButtonCell* cell = [self cellForBookmarkNode:node]; + NSCell* cell = [self cellForBookmarkNode:node]; DCHECK(cell); - // We must decide if we draw the folder arrow before we ask the cell - // how big it needs to be. - if (node && node->is_folder()) { - // Warning when combining code with bookmark_bar_controller.mm: - // this call should NOT be made for the bar buttons; only for the - // subfolder buttons. - [cell setDrawFolderArrow:YES]; - } - // The "+2" is needed because, sometimes, Cocoa is off by a tad when // returning the value it thinks it needs. CGFloat desired = [cell cellSize].width + 2; @@ -161,7 +147,6 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; } } else { [button setEnabled:NO]; - [button setBordered:NO]; } return button; } @@ -389,12 +374,8 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; windowFrame.size.height += growAmount; windowFrame.size.height = std::min(NSHeight(windowFrame), screenHeightMinusMargin); - // Don't allow scrolling to make the window smaller, ever. This - // conditional is important when processing scrollWheel events. - if (windowFrame.size.height > [[self window] frame].size.height) { - [[self window] setFrame:windowFrame display:YES]; - [self addOrUpdateScrollTracking]; - } + [[self window] setFrame:windowFrame display:YES]; + [self addOrUpdateScrollTracking]; } } @@ -826,14 +807,6 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { [super close]; } -- (void)scrollWheel:(NSEvent *)theEvent { - if (scrollable_) { - // We go negative since an NSScrollView has a flipped coordinate frame. - CGFloat amt = kBookmarkBarFolderScrollWheelAmount * -[theEvent deltaY]; - [self performOneScroll:amt]; - } -} - #pragma mark Methods Forwarded to BookmarkBarController - (IBAction)cutBookmark:(id)sender { @@ -892,5 +865,4 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { [barController_ openBookmarkInNewWindow:sender]; } - @end // BookmarkBarFolderController |