diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 637c29e55..5837bb8c5 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -2757,14 +2757,21 @@ CPTexturedBackgroundWindowMask } // The sheet starts hidden just above the top of a clip rect + // TODO : Make properly for the -1 in endY var sheetFrame = [sheet frame], sheetShadowFrame = sheet._hasShadow ? [sheet._shadowView frame] : sheetFrame, frame = [self frame], originX = frame.origin.x + FLOOR((frame.size.width - sheetFrame.size.width) / 2), startFrame = CGRectMake(originX, -sheetShadowFrame.size.height, sheetFrame.size.width, sheetFrame.size.height), - endY = [_windowView bodyOffset] - [[self contentView] frame].origin.y, + endY = -1 + [_windowView bodyOffset] - [[self contentView] frame].origin.y, endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height); + if (_toolbar && [_windowView showsToolbar] && [self isFullPlatformWindow]) + { + endY += [[_toolbar _toolbarView] frameSize].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)]; diff --git a/AppKit/CPWindow/_CPWindowView.j b/AppKit/CPWindow/_CPWindowView.j index 8cd74b0e3..0c8335494 100644 --- a/AppKit/CPWindow/_CPWindowView.j +++ b/AppKit/CPWindow/_CPWindowView.j @@ -742,7 +742,9 @@ _CPWindowViewResizeSlop = 3; - (BOOL)showsToolbar { - return YES; + var styleMaskWindow = [[self window] styleMask]; + + return styleMaskWindow & CPBorderlessWindowMask || styleMaskWindow & CPTitledWindowMask || styleMaskWindow & CPHUDBackgroundWindowMask || styleMaskWindow & CPBorderlessBridgeWindowMask; } - (CGSize)toolbarOffset