From 25a58346144f2030fba5c140f018577ff5e70caa Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 25 Dec 2011 22:05:18 +0000 Subject: [PATCH] #4683 Info window swapped view heights not constrained to screen size --- macosx/InfoWindowController.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 3c6b030e8..d60821581 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -296,12 +296,22 @@ typedef enum NSRect windowRect = [window frame], viewRect = [view frame]; - CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor]; + const CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor]; windowRect.origin.y -= difference; windowRect.size.height += difference; if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method { + const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]); + if (NSHeight(windowRect) > screenHeight) + { + const CGFloat difference = (screenHeight - NSHeight(windowRect)) * [window userSpaceScaleFactor]; + windowRect.origin.y -= difference; + windowRect.size.height += difference; + + viewRect.size.height += difference; + } + [window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)]; [window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)]; }