Commit ea5c5f05 authored by avi@chromium.org's avatar avi@chromium.org

Proactive tweaking of window shadow code to try to fix problem.

BUG=128049
TEST=hope this works for the reporter


Review URL: https://chromiumcodereview.appspot.com/10444139

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140090 0039d316-1c4b-4281-b951-d872f2087c98
parent 24b6ea7a
...@@ -120,20 +120,23 @@ void RootDidAddSubview(id self, SEL _cmd, NSView* subview) { ...@@ -120,20 +120,23 @@ void RootDidAddSubview(id self, SEL _cmd, NSView* subview) {
NSView* rootView = [[self contentView] superview]; NSView* rootView = [[self contentView] superview];
const NSRect rootBounds = [rootView bounds]; const NSRect rootBounds = [rootView bounds];
const CGFloat kEdgeInset = 16; // On 10.7/8, the bottom corners of the window are rounded by magic at a
// deeper level than the NSThemeFrame, so it is OK to have the opaques
// go all the way to the bottom.
const CGFloat kTopEdgeInset = 16;
const CGFloat kAlphaValueJustOpaqueEnough = 0.002; const CGFloat kAlphaValueJustOpaqueEnough = 0.002;
scoped_nsobject<NSView> leftOpaque([[OpaqueView alloc] initWithFrame: scoped_nsobject<NSView> leftOpaque([[OpaqueView alloc] initWithFrame:
NSMakeRect(NSMinX(rootBounds), NSMinY(rootBounds) + kEdgeInset, NSMakeRect(NSMinX(rootBounds), NSMinY(rootBounds),
1, NSHeight(rootBounds) - 2 * kEdgeInset)]); 1, NSHeight(rootBounds) - kTopEdgeInset)]);
[leftOpaque setAutoresizingMask:NSViewMaxXMargin | [leftOpaque setAutoresizingMask:NSViewMaxXMargin |
NSViewHeightSizable]; NSViewHeightSizable];
[leftOpaque setAlphaValue:kAlphaValueJustOpaqueEnough]; [leftOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
[rootView addSubview:leftOpaque]; [rootView addSubview:leftOpaque];
scoped_nsobject<NSView> rightOpaque([[OpaqueView alloc] initWithFrame: scoped_nsobject<NSView> rightOpaque([[OpaqueView alloc] initWithFrame:
NSMakeRect(NSMaxX(rootBounds) - 1, NSMinY(rootBounds) + kEdgeInset, NSMakeRect(NSMaxX(rootBounds) - 1, NSMinY(rootBounds),
1, NSHeight(rootBounds) - 2 * kEdgeInset)]); 1, NSHeight(rootBounds) - kTopEdgeInset)]);
[rightOpaque setAutoresizingMask:NSViewMinXMargin | [rightOpaque setAutoresizingMask:NSViewMinXMargin |
NSViewHeightSizable]; NSViewHeightSizable];
[rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough]; [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
......
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