Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljungberg committed Mar 9, 2012
1 parent 3acfa14 commit 8e81be0
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions AppKit/CPShadowView.j
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ var LIGHT_LEFT_INSET = 3.0,
/*!
@ingroup appkit
*/

@implementation CPShadowView : CPView
{
CPShadowWeight _weight;
Expand Down Expand Up @@ -99,22 +98,22 @@ var LIGHT_LEFT_INSET = 3.0,
+ (id)shadowViewEnclosingView:(CPView)aView withWeight:(CPShadowWeight)aWeight
{
var shadowView = [[self alloc] initWithFrame:[aView frame]];

if (shadowView)
{
[shadowView setWeight:aWeight];
var size = [shadowView frame].size,
width = size.width - [shadowView leftInset] - [shadowView rightInset],
height = size.height - [shadowView topInset] - [shadowView bottomInset],
enclosingView = [aView superview];
[shadowView setHitTests:[aView hitTests]];
[shadowView setAutoresizingMask:[aView autoresizingMask]];
[aView removeFromSuperview];
[shadowView addSubview:aView];
[aView setFrame:CGRectMake([shadowView leftInset], [shadowView topInset], width, height)]
[enclosingView addSubview:shadowView];
[shadowView setWeight:aWeight];

var size = [shadowView frame].size,
width = size.width - [shadowView leftInset] - [shadowView rightInset],
height = size.height - [shadowView topInset] - [shadowView bottomInset],
enclosingView = [aView superview];

[shadowView setHitTests:[aView hitTests]];
[shadowView setAutoresizingMask:[aView autoresizingMask]];
[aView removeFromSuperview];
[shadowView addSubview:aView];
[aView setFrame:CGRectMake([shadowView leftInset], [shadowView topInset], width, height)]
[enclosingView addSubview:shadowView];
}

return shadowView;
Expand Down

0 comments on commit 8e81be0

Please sign in to comment.