clean up a little inspector code
This commit is contained in:
parent
9e8dbcfe3e
commit
973ed82609
|
@ -29,4 +29,6 @@
|
||||||
NSImage * fRegularImage, * fSelectedImage;
|
NSImage * fRegularImage, * fSelectedImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setSelectedTab: (BOOL) selected;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -755,66 +755,6 @@ typedef enum
|
||||||
return windowRect;
|
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
|
- (void) setTab: (id) sender
|
||||||
{
|
{
|
||||||
[self updateInfoStats];
|
[self updateInfoStats];
|
||||||
|
|
Loading…
Reference in New Issue