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

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

Issue 2200303004: [Mac][Material Design] Adjust bookmark spacing and folder menu drawing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests, changes for icon-only items. Created 4 years, 4 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 a2501080a4674d5946de73a7ad7bd7ef9af875a5..51750aee4547586cafd743b3ef439a5a06348416 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -32,8 +32,8 @@ int HierarchyButtonLeftPadding() {
}
const int kIconTextSpacer = 4;
-const int kTextRightPadding = 1;
-const int kIconLeftPadding = 1;
+const int kTextRightPadding = 4;
+const int kIconLeftPadding = 4;
const int kDefaultFontSize = 12;
@@ -355,7 +355,7 @@ const int kDefaultFontSize = 12;
kIconTextSpacer + std::ceil(textWidth) + kTextRightPadding;
} else {
// Make buttons without visible titles 20pts wide (18 plus padding).
- cellSize.width = 18;
+ cellSize.width += kIconLeftPadding;
}
}
@@ -373,9 +373,7 @@ const int kDefaultFontSize = 12;
// left edge, but only if there's a visible title.
if (ui::MaterialDesignController::IsModeMaterial()) {
imageRect.origin.y -= 1;
- if ([[self visibleTitle] length] > 0) {
- imageRect.origin.x += kIconLeftPadding;
- }
+ imageRect.origin.x = kIconLeftPadding;
}
return imageRect;
}
@@ -443,8 +441,8 @@ const int kDefaultFontSize = 12;
// In Material Design on Retina, and not in a folder menu, nudge the hover
// background by 1px.
const CGFloat kLineWidth = [controlView cr_lineWidth];
- if ([self tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback &&
- ![self isFolderButtonCell] && kLineWidth < 1) {
+ if ([self isMaterialDesignButtonType] && ![self isFolderButtonCell] &&
+ kLineWidth < 1) {
return -kLineWidth;
}
return 0.0;
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm ('k') | chrome/browser/ui/cocoa/gradient_button_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698