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

Unified Diff: chrome/browser/ui/cocoa/gradient_button_cell.mm

Issue 2134823002: [Material][Mac] Fix for Bookmark Subfolders Hover State (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment nit Created 4 years, 5 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/gradient_button_cell.mm
diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.mm b/chrome/browser/ui/cocoa/gradient_button_cell.mm
index 796de611e89b7efbb4e8391c65bff47f5bfb68e0..cabd8cc6fec106710300f07faab3dfb962ba30f2 100644
--- a/chrome/browser/ui/cocoa/gradient_button_cell.mm
+++ b/chrome/browser/ui/cocoa/gradient_button_cell.mm
@@ -593,18 +593,25 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4;
// Stroke the borders and appropriate fill gradient. If we're borderless, the
// only time we want to draw the inner gradient is if we're highlighted or if
- // we're drawing the focus ring manually.
+ // we're drawing the focus ring manually. In Material Design, the "border" is
+ // actually a highlight, which should be drawn if
+ // |showsBorderOnlyWhileMouseInside| is true.
+ BOOL hasMaterialHighlight =
+ [self tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback &&
+ ![self showsBorderOnlyWhileMouseInside];
if (([self isBordered] && ![self showsBorderOnlyWhileMouseInside]) ||
- pressed || [self isMouseInside] || [self isContinuousPulsing]) {
+ pressed || [self isMouseInside] || [self isContinuousPulsing] ||
+ hasMaterialHighlight) {
// When pulsing we want the bookmark to stand out a little more.
BOOL showClickedGradient = pressed ||
(pulseState_ == gradient_button_cell::kPulsingContinuous);
+ BOOL showHighlightGradient = [self isHighlighted] || hasMaterialHighlight;
[self drawBorderAndFillForTheme:themeProvider
controlView:controlView
innerPath:innerPath
showClickedGradient:showClickedGradient
- showHighlightGradient:[self isHighlighted]
+ showHighlightGradient:showHighlightGradient
hoverAlpha:[self hoverAlpha]
active:active
cellFrame:cellFrame
« 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