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

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 881573004: [Extensions Toolbar Mac] Adjust button threshold for hiding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/extensions/browser_actions_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
index 40a8f59563cbccea9d08c5d33ae3220d5b3379e1..040b863331524c7c67c52c6ceef55c2a0f77e150 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
@@ -631,10 +631,10 @@ void ToolbarActionsBarBridge::OnOverflowedActionWantsToRunChanged(
CGFloat intersectionWidth =
NSWidth(NSIntersectionRect([containerView_ bounds], buttonFrame));
- // Pad the threshold by 5 pixels in order to have the buttons hide more
- // easily.
+ // Hide the button if it's not "mostly" visible. "Mostly" here equates to
+ // having three or fewer pixels hidden.
if (([containerView_ grippyPinned] && intersectionWidth > 0) ||
- (intersectionWidth <= (NSWidth(buttonFrame) / 2) + 5.0)) {
+ (intersectionWidth <= NSWidth(buttonFrame) - 3.0)) {
[button setAlphaValue:0.0];
[button removeFromSuperview];
}
« 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