Changeset 2889


Ignore:
Timestamp:
Aug 21, 2007, 5:03:53 AM (15 years ago)
Author:
livings124
Message:

refine inspector resize code a bit more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r2888 r2889  
    711711    BOOL canResizeVertical = NO;
    712712    float height;
    713     if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
     713    if ([identifier isEqualToString: TAB_INFO_IDENT])
     714        height = TAB_INFO_HEIGHT;
     715    else if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
    714716    {
    715717        height = TAB_ACTIVITY_HEIGHT;
    716718        [fPiecesView updateView: YES];
    717719    }
    718     else if ([identifier isEqualToString: TAB_PEERS_IDENT] || [identifier isEqualToString: TAB_FILES_IDENT])
    719     {
    720         canResizeVertical = YES;
    721        
    722         //height only needed if resize will take place
    723         if (!fCanResizeVertical)
    724             height = MAX(TAB_RESIZABLE_MIN_HEIGHT, [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorHeight"]);
    725     }
    726720    else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
    727721        height = TAB_OPTIONS_HEIGHT;
    728722    else
    729         height = TAB_INFO_HEIGHT;
     723    {
     724        canResizeVertical = YES;
     725        height = MAX(TAB_RESIZABLE_MIN_HEIGHT, [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorHeight"]);
     726    }
    730727   
    731728    NSWindow * window = [self window];
     
    755752   
    756753    [window setMinSize: NSMakeSize([window minSize].width, !canResizeVertical ? windowFrame.size.height
    757             : (windowFrame.size.height - [[[fTabView selectedTabViewItem] view] frame].size.height) + TAB_RESIZABLE_MIN_HEIGHT)];
    758     [window setMaxSize: NSMakeSize([window maxSize].width, !canResizeVertical ? windowFrame.size.height : FLT_MAX)];
     754                            : (windowFrame.size.height - (viewFrame.size.height + difference)) + TAB_RESIZABLE_MIN_HEIGHT)];
     755    [window setMaxSize: NSMakeSize(FLT_MAX, !canResizeVertical ? windowFrame.size.height : FLT_MAX)];
    759756   
    760757    fCanResizeVertical = canResizeVertical;
Note: See TracChangeset for help on using the changeset viewer.