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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm

Issue 6257005: Adjustments to bookmark bar folder menu placement issues.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "app/mac/nsimage_cache.h" 8 #include "app/mac/nsimage_cache.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
11 #import "chrome/browser/bookmarks/bookmark_model.h" 11 #import "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 [super drawInteriorWithFrame:cellFrame inView:controlView]; 224 [super drawInteriorWithFrame:cellFrame inView:controlView];
225 225
226 // If asked to do so, and if a folder, draw the arrow. 226 // If asked to do so, and if a folder, draw the arrow.
227 if (!drawFolderArrow_) 227 if (!drawFolderArrow_)
228 return; 228 return;
229 BookmarkButton* button = static_cast<BookmarkButton*>([self controlView]); 229 BookmarkButton* button = static_cast<BookmarkButton*>([self controlView]);
230 DCHECK([button respondsToSelector:@selector(isFolder)]); 230 DCHECK([button respondsToSelector:@selector(isFolder)]);
231 if ([button isFolder]) { 231 if ([button isFolder]) {
232 NSRect imageRect = NSZeroRect; 232 NSRect imageRect = NSZeroRect;
233 imageRect.size = [arrowImage_ size]; 233 imageRect.size = [arrowImage_ size];
234 NSRect drawRect = NSOffsetRect(imageRect, 234 const CGFloat kArrowOffset = 1.0; // Required for proper centering.
235 NSWidth(cellFrame) - NSWidth(imageRect), 235 CGFloat dX = NSWidth(cellFrame) - NSWidth(imageRect);
236 (NSHeight(cellFrame) / 2.0) - 236 CGFloat dY = (NSHeight(cellFrame) / 2.0) - (NSHeight(imageRect) / 2.0) +
237 (NSHeight(imageRect) / 2.0)); 237 kArrowOffset;
238 NSRect drawRect = NSOffsetRect(imageRect, dX, dY);
238 [arrowImage_ drawInRect:drawRect 239 [arrowImage_ drawInRect:drawRect
239 fromRect:imageRect 240 fromRect:imageRect
240 operation:NSCompositeSourceOver 241 operation:NSCompositeSourceOver
241 fraction:[self isEnabled] ? 1.0 : 0.5 242 fraction:[self isEnabled] ? 1.0 : 0.5
242 neverFlipped:YES]; 243 neverFlipped:YES];
243 } 244 }
244 } 245 }
245 246
246 @end 247 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698