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

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

Issue 1987203003: [Mac][Material Design] Add MD hover to bookmark items in menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uploaded__bookmark_title_baseline_fix
Patch Set: 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 6557848058251ae891453ee7c359b2aa40f31dab..e38e4a2d6261caba3c685c6d3c5e8f7c47e44907 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -12,6 +12,7 @@
#include "chrome/grit/generated_resources.h"
#import "components/bookmarks/browser/bookmark_model.h"
#include "content/public/browser/user_metrics.h"
+#import "ui/base/cocoa/nsview_additions.h"
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
@@ -393,4 +394,16 @@ const int kDefaultFontSize = 12;
return -1;
}
+- (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView {
+ // 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) {
+ return -kLineWidth;
+ }
+ return 0.0;
+}
+
+
@end
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.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