Changeset 13114


Ignore:
Timestamp:
Dec 25, 2011, 10:05:18 PM (10 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r13027 r13114  
    297297    NSRect windowRect = [window frame], viewRect = [view frame];
    298298   
    299     CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor];
     299    const CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor];
    300300    windowRect.origin.y -= difference;
    301301    windowRect.size.height += difference;
     
    303303    if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method
    304304    {
     305        const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
     306        if (NSHeight(windowRect) > screenHeight)
     307        {
     308            const CGFloat difference = (screenHeight - NSHeight(windowRect)) * [window userSpaceScaleFactor];
     309            windowRect.origin.y -= difference;
     310            windowRect.size.height += difference;
     311           
     312            viewRect.size.height += difference;
     313        }
     314       
    305315        [window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)];
    306316        [window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
Note: See TracChangeset for help on using the changeset viewer.