Changeset 3301


Ignore:
Timestamp:
Oct 7, 2007, 2:28:09 AM (15 years ago)
Author:
livings124
Message:

clean up a little inspector code

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoTabButtonCell.h

    r3300 r3301  
    3030}
    3131
     32- (void) setSelectedTab: (BOOL) selected;
     33
    3234@end
  • trunk/macosx/InfoWindowController.m

    r3300 r3301  
    755755    return windowRect;
    756756}
    757 
    758 /*- (void) tabView: (NSTabView *) tabView didSelectTabViewItem: (NSTabViewItem *) tabViewItem
    759 {
    760     NSString * identifier = [tabViewItem identifier];
    761     [self setWindowForTab: identifier animate: YES];
    762     [[NSUserDefaults standardUserDefaults] setObject: identifier forKey: @"InspectorSelected"];
    763 }*/
    764 
    765 /*- (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate
    766 {
    767     [self updateInfoStats];
    768    
    769     BOOL canResizeVertical = NO;
    770     float height;
    771     if ([identifier isEqualToString: TAB_INFO_IDENT])
    772         height = TAB_INFO_HEIGHT;
    773     else if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
    774     {
    775         height = TAB_ACTIVITY_HEIGHT;
    776         [fPiecesView updateView: YES];
    777     }
    778     else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
    779         height = TAB_OPTIONS_HEIGHT;
    780     else
    781     {
    782         canResizeVertical = YES;
    783         height = MAX(TAB_RESIZABLE_MIN_HEIGHT, [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorHeight"]);
    784     }
    785    
    786     NSWindow * window = [self window];
    787     NSView * view = [[fTabView selectedTabViewItem] view];
    788     NSRect windowFrame = [window frame], viewFrame = [view frame];
    789    
    790     //save previous size
    791     if (fCanResizeVertical && !canResizeVertical)
    792         [[NSUserDefaults standardUserDefaults] setFloat: viewFrame.size.height forKey: @"InspectorHeight"];
    793    
    794     float difference = (height - viewFrame.size.height) * [window userSpaceScaleFactor];
    795     windowFrame.origin.y -= difference;
    796     windowFrame.size.height += difference;
    797    
    798     //actually do resize
    799     if (!fCanResizeVertical || !canResizeVertical)
    800     {
    801         if (animate)
    802         {
    803             [view setHidden: YES];
    804             [window setFrame: windowFrame display: YES animate: YES];
    805             [view setHidden: NO];
    806         }
    807         else
    808             [window setFrame: windowFrame display: YES];
    809     }
    810    
    811     [window setMinSize: NSMakeSize([window minSize].width, !canResizeVertical ? windowFrame.size.height
    812                             : (windowFrame.size.height - (viewFrame.size.height + difference)) + TAB_RESIZABLE_MIN_HEIGHT)];
    813     [window setMaxSize: NSMakeSize(FLT_MAX, !canResizeVertical ? windowFrame.size.height : FLT_MAX)];
    814    
    815     fCanResizeVertical = canResizeVertical;
    816 }*/
    817757
    818758- (void) setTab: (id) sender
Note: See TracChangeset for help on using the changeset viewer.