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

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

Issue 1988223002: [Mac][Material Design] Bring bookmark hover background up to spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. 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
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 0e45c7b769e96f731962a5e9d8d9e713edb5894e..6557848058251ae891453ee7c359b2aa40f31dab 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -24,7 +24,7 @@ namespace {
const int kHierarchyButtonXMargin = 4;
const int kIconTextSpacer = 4;
-const int kTextRightPadding = 1;
+const int kTextRightPadding = 3;
const int kIconLeftPadding = 3;
const int kDefaultFontSize = 12;
@@ -322,7 +322,7 @@ const int kDefaultFontSize = 12;
// Return the space needed to display the image and title, with a little
// distance between them.
cellSize = NSMakeSize(kIconLeftPadding + [[self image] size].width,
- bookmarks::kMaterialBookmarkButtonHeight);
+ bookmarks::kBookmarkButtonHeight);
NSString* title = [self visibleTitle];
if ([title length] > 0) {
CGFloat textWidth =
@@ -342,9 +342,11 @@ const int kDefaultFontSize = 12;
NSRect imageRect = [super imageRectForBounds:theRect];
// In Material Design, add a little space between the image and the button's
// left edge, but only if there's a visible title.
- if ([[self visibleTitle] length] &&
- ui::MaterialDesignController::IsModeMaterial()) {
- imageRect.origin.x += kIconLeftPadding;
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ imageRect.origin.y -= 1;
+ if ([[self visibleTitle] length]) {
+ imageRect.origin.x += kIconLeftPadding;
+ }
}
return imageRect;
}
@@ -385,7 +387,10 @@ const int kDefaultFontSize = 12;
}
- (int)verticalTextOffset {
- return 0;
+ if (!ui::MaterialDesignController::IsModeMaterial()) {
+ return 0;
+ }
+ return -1;
}
@end

Powered by Google App Engine
This is Rietveld 408576698