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

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

Issue 2315933002: [Mac][Material Design] Fix regression in position of chevron icon. (Closed)
Patch Set: Created 4 years, 3 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 51750aee4547586cafd743b3ef439a5a06348416..330f6547d4ebac50b962905be5e63bfe11e3e782 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -47,6 +47,21 @@ const int kDefaultFontSize = 12;
return YES;
}
+- (NSString*)accessibilityTitle {
+ return l10n_util::GetNSString(IDS_ACCNAME_BOOKMARKS_CHEVRON);
+}
+
+- (NSRect)imageRectForBounds:(NSRect)theRect {
+ NSRect imageRect = [super imageRectForBounds:theRect];
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ // Make sure the chevron icon stays centered. Normally a bookmark bar item
+ // with no label has its icon placed at a fixed x-position.
+ CGFloat totalWidth = NSMaxX(theRect);
+ imageRect.origin.x = (totalWidth - [self image].size.width) / 2;
+ }
+ return imageRect;
+}
+
@end
@interface BookmarkButtonCell(Private)
« 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