Fixed: Sheet window under the toolbar

Previously when using a sheet window in a fullPlatform window, the sheet window started the animation under (the layout) the toolbar.
Now, the sheet animation starts below the toolbar as in cocoa.
It also fixed that only a CPBordelessWindow/CPTitleWindow/HUD can have a toolbar.
This commit is contained in:
Alexandre Wilhelm
2013-04-29 16:16:29 -07:00
parent 6048814635
commit 2e93e4abf7
2 changed files with 12 additions and 1 deletions
+9
View File
@@ -2763,6 +2763,15 @@ CPTexturedBackgroundWindowMask
endY = [_windowView bodyOffset] - [[self contentView] frame].origin.y,
endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height);
if (_toolbar && [_windowView showsToolbar] && [self isFullPlatformWindow])
{
originX += [[_toolbar _toolbarView] frameSize].height;
endY += [[_toolbar _toolbarView] frameSize].height;
startFrame = CGRectMake(originX, -sheetShadowFrame.size.height, sheetFrame.size.width, sheetFrame.size.height);
endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height);
}
// Move the sheet offscreen before ordering front so it doesn't appear briefly
[sheet setFrameOrigin:CGPointMake(0, -13000)];
+3 -1
View File
@@ -742,7 +742,9 @@ _CPWindowViewResizeSlop = 3;
- (BOOL)showsToolbar
{
return YES;
var styleMaskWindow = [[self window] styleMask];
return styleMaskWindow & CPBorderlessWindowMask || styleMaskWindow & CPTitledWindowMask || styleMaskWindow & CPHUDBackgroundWindowMask;
}
- (CGSize)toolbarOffset