From 973ed82609ec0105d0fa8e4de8865bf75771c39b Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 7 Oct 2007 02:28:09 +0000 Subject: [PATCH] clean up a little inspector code --- macosx/InfoTabButtonCell.h | 2 ++ macosx/InfoWindowController.m | 60 ----------------------------------- 2 files changed, 2 insertions(+), 60 deletions(-) diff --git a/macosx/InfoTabButtonCell.h b/macosx/InfoTabButtonCell.h index 66e0b7748..ac390c8f0 100644 --- a/macosx/InfoTabButtonCell.h +++ b/macosx/InfoTabButtonCell.h @@ -29,4 +29,6 @@ NSImage * fRegularImage, * fSelectedImage; } +- (void) setSelectedTab: (BOOL) selected; + @end diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 18ee6e12a..a83c60a92 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -755,66 +755,6 @@ typedef enum return windowRect; } -/*- (void) tabView: (NSTabView *) tabView didSelectTabViewItem: (NSTabViewItem *) tabViewItem -{ - NSString * identifier = [tabViewItem identifier]; - [self setWindowForTab: identifier animate: YES]; - [[NSUserDefaults standardUserDefaults] setObject: identifier forKey: @"InspectorSelected"]; -}*/ - -/*- (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate -{ - [self updateInfoStats]; - - BOOL canResizeVertical = NO; - float height; - if ([identifier isEqualToString: TAB_INFO_IDENT]) - height = TAB_INFO_HEIGHT; - else if ([identifier isEqualToString: TAB_ACTIVITY_IDENT]) - { - height = TAB_ACTIVITY_HEIGHT; - [fPiecesView updateView: YES]; - } - else if ([identifier isEqualToString: TAB_OPTIONS_IDENT]) - height = TAB_OPTIONS_HEIGHT; - else - { - canResizeVertical = YES; - height = MAX(TAB_RESIZABLE_MIN_HEIGHT, [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorHeight"]); - } - - NSWindow * window = [self window]; - NSView * view = [[fTabView selectedTabViewItem] view]; - NSRect windowFrame = [window frame], viewFrame = [view frame]; - - //save previous size - if (fCanResizeVertical && !canResizeVertical) - [[NSUserDefaults standardUserDefaults] setFloat: viewFrame.size.height forKey: @"InspectorHeight"]; - - float difference = (height - viewFrame.size.height) * [window userSpaceScaleFactor]; - windowFrame.origin.y -= difference; - windowFrame.size.height += difference; - - //actually do resize - if (!fCanResizeVertical || !canResizeVertical) - { - if (animate) - { - [view setHidden: YES]; - [window setFrame: windowFrame display: YES animate: YES]; - [view setHidden: NO]; - } - else - [window setFrame: windowFrame display: YES]; - } - - [window setMinSize: NSMakeSize([window minSize].width, !canResizeVertical ? windowFrame.size.height - : (windowFrame.size.height - (viewFrame.size.height + difference)) + TAB_RESIZABLE_MIN_HEIGHT)]; - [window setMaxSize: NSMakeSize(FLT_MAX, !canResizeVertical ? windowFrame.size.height : FLT_MAX)]; - - fCanResizeVertical = canResizeVertical; -}*/ - - (void) setTab: (id) sender { [self updateInfoStats];