diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 23:29:32 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 23:29:32 +0000 |
commit | 432e5580710592e47169679d5c2cb569904c015a (patch) | |
tree | 002a607452d610e751f47c5954f27cf63849ed4d /chrome/browser/cocoa/extensions | |
parent | eef3b99f3e8a1846f2ae0f1328e61d7000b67ee7 (diff) | |
download | chromium_src-432e5580710592e47169679d5c2cb569904c015a.zip chromium_src-432e5580710592e47169679d5c2cb569904c015a.tar.gz chromium_src-432e5580710592e47169679d5c2cb569904c015a.tar.bz2 |
[Mac] Removes artificial location padding logic to fix a bug with browser action transparency.
BUG=51944
TEST=see bug. rightmost extension should not be transparent at all after resizing browser action container.
Review URL: http://codereview.chromium.org/3179011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/extensions')
-rw-r--r-- | chrome/browser/cocoa/extensions/browser_actions_controller.mm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/cocoa/extensions/browser_actions_controller.mm index 0d49b7a..768a359 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]; } |