1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

#4683 Info window swapped view heights not constrained to screen size

This commit is contained in:
Mitchell Livingston 2011-12-25 22:05:18 +00:00
parent a8468a7b09
commit 25a5834614

View file

@ -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)];
}