Commit 6fd65634 authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

[Extensions Toolbar Mac] Adjust button threshold for hiding

Since the toolbar frame now includes the proper padding,
icons are a little too eager to show after adjusting the
chevron.  Make them a bit more shy again (hide them if they
have >= 3px not displayed when adjusting the toolbar).

BUG=452475

Review URL: https://codereview.chromium.org/881573004

Cr-Commit-Position: refs/heads/master@{#313730}
parent 29cbd973
...@@ -631,10 +631,10 @@ void ToolbarActionsBarBridge::OnOverflowedActionWantsToRunChanged( ...@@ -631,10 +631,10 @@ void ToolbarActionsBarBridge::OnOverflowedActionWantsToRunChanged(
CGFloat intersectionWidth = CGFloat intersectionWidth =
NSWidth(NSIntersectionRect([containerView_ bounds], buttonFrame)); NSWidth(NSIntersectionRect([containerView_ bounds], buttonFrame));
// Pad the threshold by 5 pixels in order to have the buttons hide more // Hide the button if it's not "mostly" visible. "Mostly" here equates to
// easily. // having three or fewer pixels hidden.
if (([containerView_ grippyPinned] && intersectionWidth > 0) || if (([containerView_ grippyPinned] && intersectionWidth > 0) ||
(intersectionWidth <= (NSWidth(buttonFrame) / 2) + 5.0)) { (intersectionWidth <= NSWidth(buttonFrame) - 3.0)) {
[button setAlphaValue:0.0]; [button setAlphaValue:0.0];
[button removeFromSuperview]; [button removeFromSuperview];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment