Changeset 2812


Ignore:
Timestamp:
Aug 17, 2007, 1:29:46 AM (15 years ago)
Author:
livings124
Message:

don't resize the inspector unnecessarily

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.h

    r2448 r2812  
    3333    NSArray * fTorrents, * fPeers, * fFiles;
    3434    NSImage * fAppIcon, * fDotGreen, * fDotRed;
     35   
     36    BOOL fCanResizeVertical;
    3537   
    3638    IBOutlet NSTabView * fTabView;
  • trunk/macosx/InfoWindowController.m

    r2811 r2812  
    7272        fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
    7373        fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
     74       
     75        fCanResizeVertical = NO;
    7476    }
    7577    return self;
     
    699701    [self updateInfoStats];
    700702   
    701     BOOL canResizeHor = NO;
     703    BOOL canResizeVertical = NO;
    702704    float height;
    703705    if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
     
    709711    {
    710712        height = TAB_PEERS_HEIGHT;
    711         canResizeHor = YES;
     713        canResizeVertical = YES;
    712714    }
    713715    else if ([identifier isEqualToString: TAB_FILES_IDENT])
    714716    {
    715717        height = TAB_FILES_HEIGHT;
    716         canResizeHor = YES;
     718        canResizeVertical = YES;
    717719    }
    718720    else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
     
    729731    frame.size.height += difference;
    730732   
    731     if (animate)
    732     {
    733         [view setHidden: YES];
    734         [window setFrame: frame display: YES animate: YES];
    735         [view setHidden: NO];
    736     }
    737     else
    738         [window setFrame: frame display: YES];
     733    if (!fCanResizeVertical || !canResizeVertical)
     734    {
     735        if (animate)
     736        {
     737            [view setHidden: YES];
     738            [window setFrame: frame display: YES animate: YES];
     739            [view setHidden: NO];
     740        }
     741        else
     742            [window setFrame: frame display: YES];
     743    }
    739744   
    740745    [window setMinSize: NSMakeSize([window minSize].width, frame.size.height)];
    741     [window setMaxSize: NSMakeSize([window maxSize].width, canResizeHor ? FLT_MAX : frame.size.height)];
     746    [window setMaxSize: NSMakeSize([window maxSize].width, canResizeVertical ? FLT_MAX : frame.size.height)];
     747   
     748    fCanResizeVertical = canResizeVertical;
    742749}
    743750
Note: See TracChangeset for help on using the changeset viewer.