Skip to content

Commit

Permalink
Re-add titleBarContainer when setStyleMask: causes the themeFrameView…
Browse files Browse the repository at this point in the history
… to change
  • Loading branch information
Kapeli committed Oct 5, 2013
1 parent 6c41376 commit 1a8a887
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions INAppStoreWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ - (void)dealloc
[_minimizeButton release];
[_zoomButton release];
[_fullScreenButton release];
[_titleBarContainer release];
[super dealloc];
#endif
}
Expand Down Expand Up @@ -721,6 +722,12 @@ - (void)setStyleMask:(NSUInteger)styleMask
_preventWindowFrameChange = YES;
[super setStyleMask:styleMask];
_preventWindowFrameChange = NO;
if(_titleBarContainer && [_titleBarContainer superview] != [self themeFrameView])
{
NSView *firstSubview = [[[self themeFrameView] subviews] objectAtIndex:0];
[self _recalculateFrameForTitleBarContainer];
[[self themeFrameView] addSubview:_titleBarContainer positioned:NSWindowBelow relativeTo:firstSubview];
}
}

- (void)setFrame:(NSRect)frameRect display:(BOOL)flag
Expand Down Expand Up @@ -963,11 +970,10 @@ - (void)_createTitlebarView
NSView *firstSubview = [[[self themeFrameView] subviews] objectAtIndex:0];
[self _recalculateFrameForTitleBarContainer];
[[self themeFrameView] addSubview:container positioned:NSWindowBelow relativeTo:firstSubview];
#if __has_feature(objc_arc)
_titleBarContainer = container;
#if __has_feature(objc_arc)
self.titleBarView = [[INTitlebarView alloc] initWithFrame:NSZeroRect];
#else
_titleBarContainer = container;
self.titleBarView = [[[INTitlebarView alloc] initWithFrame:NSZeroRect] autorelease];
#endif
}
Expand Down

0 comments on commit 1a8a887

Please sign in to comment.