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

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

Issue 2089653002: [Mac][Material Design] Fix bookmark chevron button focus ring location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « chrome/app/nibs/BookmarkBar.xib ('k') | 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 67f2aa5433f113d3b391ed3f95b5982fa315a21b..a2501080a4674d5946de73a7ad7bd7ef9af875a5 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -39,7 +39,19 @@ const int kDefaultFontSize = 12;
}; // namespace
+@interface OffTheSideButtonCell : BookmarkButtonCell
+@end
+@implementation OffTheSideButtonCell
+
+- (BOOL)isOffTheSideButtonCell {
+ return YES;
+}
+
+@end
+
@interface BookmarkButtonCell(Private)
+// Returns YES if the cell is the offTheSide button cell.
+- (BOOL)isOffTheSideButtonCell;
- (void)configureBookmarkButtonCell;
- (void)applyTextColor;
// Returns the title the button cell displays. Note that a button cell can
@@ -143,6 +155,10 @@ const int kDefaultFontSize = 12;
return NO;
}
+- (BOOL)isOffTheSideButtonCell {
+ return NO;
+}
+
// Perform all normal init routines specific to the BookmarkButtonCell.
- (void)configureBookmarkButtonCell {
[self setButtonType:NSMomentaryPushInButton];
@@ -373,11 +389,17 @@ const int kDefaultFontSize = 12;
- (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;
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ // In Material Design we have to move the focus ring over by 2 pts to get it
+ // to line up with the image.
+ if ([self visibleTitle].length > 0) {
+ cellFrame.origin.x += 2;
+ }
+
+ // We also have to nudge the chevron button's focus ring up 2pts.
+ if ([self isOffTheSideButtonCell]) {
+ cellFrame.origin.y -= 2;
+ }
}
[super drawFocusRingMaskWithFrame:cellFrame inView:controlView];
}
« no previous file with comments | « chrome/app/nibs/BookmarkBar.xib ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698