1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-12 15:14:12 +00:00

make sure there's a screen before attempting to constrain info window size

This commit is contained in:
Mitchell Livingston 2011-12-25 22:15:13 +00:00
parent 25a5834614
commit 01590dacf3

View file

@ -301,6 +301,8 @@ typedef enum
windowRect.size.height += difference; windowRect.size.height += difference;
if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method
{
if ([window screen])
{ {
const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]); const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
if (NSHeight(windowRect) > screenHeight) if (NSHeight(windowRect) > screenHeight)
@ -311,6 +313,7 @@ typedef enum
viewRect.size.height += difference; viewRect.size.height += difference;
} }
}
[window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)]; [window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)];
[window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)]; [window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];