diff --git a/AppKit/CPMenu.j b/AppKit/CPMenu.j index c343273ab..52376975f 100644 --- a/AppKit/CPMenu.j +++ b/AppKit/CPMenu.j @@ -1017,6 +1017,8 @@ var STICKY_TIME_INTERVAL = 500, [_moreBelowView setFrameSize:[_CPMenuWindowMoreBelowImage size]]; [contentView addSubview:_moreBelowView]; + + [self setShadowStyle:CPWindowShadowStyleMenu]; } return self; diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 21202eb85..7dc79c3ca 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -178,6 +178,11 @@ CPWindowDidResignMainNotification = @"CPWindowDidResignMainNotification"; CPWindowDidMoveNotification = @"CPWindowDidMoveNotification"; +CPWindowShadowStyleStandard = 0; +CPWindowShadowStyleMenu = 1; +CPWindowShadowStylePanel = 2; + + var SHADOW_MARGIN_LEFT = 20.0, SHADOW_MARGIN_RIGHT = 19.0, SHADOW_MARGIN_TOP = 10.0, @@ -247,6 +252,7 @@ var CPWindowSaveImage = nil, BOOL _isAnimating; BOOL _hasShadow; BOOL _isMovableByWindowBackground; + unsigned _shadowStyle; BOOL _supportsMultipleDocuments; BOOL _isDocumentEdited; @@ -983,6 +989,12 @@ CPTexturedBackgroundWindowMask } } +- (void)setShadowStyle:(unsigned)aStyle +{ + _shadowStyle = aStyle; + [[self platformWindow] setShadowStyle:_shadowStyle]; +} + /*! Sets the delegate for the window. Passing \c nil will just remove the window's current delegate. @param aDelegate an object to respond to the various delegate methods of CPWindow diff --git a/AppKit/Platform/CPPlatformWindow.j b/AppKit/Platform/CPPlatformWindow.j index e11f598cc..c0194a7f9 100644 --- a/AppKit/Platform/CPPlatformWindow.j +++ b/AppKit/Platform/CPPlatformWindow.j @@ -4,7 +4,6 @@ #import "Platform.h" #import "../CoreGraphics/CGGeometry.h" - var PrimaryPlatformWindow = NULL; @implementation CPPlatformWindow : CPObject @@ -13,6 +12,7 @@ var PrimaryPlatformWindow = NULL; CPInteger _level; BOOL _hasShadow; + unsigned _shadowStyle; #if PLATFORM(DOM) DOMWindow _DOMWindow; @@ -169,6 +169,16 @@ var PrimaryPlatformWindow = NULL; #endif } +- (void)setShadowStyle:(int)aStyle +{ + _shadowStyle = aStyle; + +#if PLATFORM(DOM) + if (_DOMWindow && _DOMWindow.cpSetShadowStyle) + _shadowStyle.cpSetShadowStyle(aStyle); +#endif +} + - (BOOL)supportsFullPlatformWindows { return [CPPlatform isBrowser]; diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index aa7350b04..49a4cab15 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -334,8 +334,10 @@ var supportsNativeDragAndDrop = [CPPlatform supportsDragAndDrop]; if (![CPPlatform isBrowser]) { + _DOMWindow.cpSetFrame(_contentRect); _DOMWindow.cpSetLevel(_level); _DOMWindow.cpSetHasShadow(_hasShadow); + _DOMWindow.cpSetShadowStyle(_shadowStyle); } [self registerDOMWindow];