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

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

Issue 3179011: [Mac] Removes artificial location padding logic to fix a bug with browser action transparency. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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
« 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/cocoa/extensions/browser_actions_controller.mm
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/cocoa/extensions/browser_actions_controller.mm
index 0d49b7adc1614f7e2f7200d7f8583d429db1f0ea..768a35975c922f90b65d9fb3d4778e5de76695a9 100644
--- a/chrome/browser/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/cocoa/extensions/browser_actions_controller.mm
@@ -33,9 +33,7 @@ NSString* const kBrowserActionVisibilityChangedNotification =
namespace {
const CGFloat kAnimationDuration = 0.2;
-// When determining the opacity during a drag, we artificially reduce the
-// distance to the edge in order to make the fade more apparent.
-const CGFloat kButtonOpacityLeadPadding = 5.0;
+
const CGFloat kChevronWidth = 14.0;
// Image used for the overflow button.
@@ -543,7 +541,6 @@ class ExtensionsServiceObserverBridge : public NotificationObserver,
- (void)updateButtonOpacity {
for (BrowserActionButton* button in [buttons_ allValues]) {
NSRect buttonFrame = [button frame];
- buttonFrame.origin.x += kButtonOpacityLeadPadding;
if (NSContainsRect([containerView_ bounds], buttonFrame)) {
if ([button alphaValue] != 1.0)
[button setAlphaValue:1.0];
@@ -552,8 +549,7 @@ class ExtensionsServiceObserverBridge : public NotificationObserver,
}
CGFloat intersectionWidth =
NSWidth(NSIntersectionRect([containerView_ bounds], buttonFrame));
- CGFloat alpha = std::max(0.0f,
- (intersectionWidth - kButtonOpacityLeadPadding) / NSWidth(buttonFrame));
+ CGFloat alpha = std::max(0.0f, intersectionWidth / NSWidth(buttonFrame));
[button setAlphaValue:alpha];
[button setNeedsDisplay:YES];
}
« 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