mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
#4683 Info window swapped view heights not constrained to screen size
This commit is contained in:
parent
a8468a7b09
commit
25a5834614
1 changed files with 11 additions and 1 deletions
|
@ -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)];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue