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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm

Issue 2030233003: [Mac][Material Design] Fix MD bookmarks button focus ring regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
index 9a3799ac826631348634e1a02e87d2367e476be7..67f2aa5433f113d3b391ed3f95b5982fa315a21b 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -371,6 +371,17 @@ const int kDefaultFontSize = 12;
return kIconLeftPadding + [[self image] size].width + kIconTextSpacer;
}
+- (void)drawFocusRingMaskWithFrame:(NSRect)cellFrame
+ inView:(NSView*)controlView {
+ // In Material Design we have to move the focus ring over by 2 pts to get it
+ // to line up with the image.
+ if (ui::MaterialDesignController::IsModeMaterial() &&
+ [self visibleTitle].length > 0) {
+ cellFrame.origin.x += 2;
+ }
+ [super drawFocusRingMaskWithFrame:cellFrame inView:controlView];
+}
+
// Override cell drawing to add a submenu arrow like a real menu.
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
// First draw "everything else".
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698