1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

don't resize the inspector unnecessarily

This commit is contained in:
Mitchell Livingston 2007-08-17 01:29:46 +00:00
parent 7fb27df36d
commit c8d88af6f2
2 changed files with 19 additions and 10 deletions

View file

@ -33,6 +33,8 @@
NSArray * fTorrents, * fPeers, * fFiles; NSArray * fTorrents, * fPeers, * fFiles;
NSImage * fAppIcon, * fDotGreen, * fDotRed; NSImage * fAppIcon, * fDotGreen, * fDotRed;
BOOL fCanResizeVertical;
IBOutlet NSTabView * fTabView; IBOutlet NSTabView * fTabView;
IBOutlet NSImageView * fImageView; IBOutlet NSImageView * fImageView;

View file

@ -71,6 +71,8 @@
fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"]; fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"];
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"]; fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
fDotRed = [NSImage imageNamed: @"RedDot.tiff"]; fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
fCanResizeVertical = NO;
} }
return self; return self;
} }
@ -698,7 +700,7 @@
{ {
[self updateInfoStats]; [self updateInfoStats];
BOOL canResizeHor = NO; BOOL canResizeVertical = NO;
float height; float height;
if ([identifier isEqualToString: TAB_ACTIVITY_IDENT]) if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
{ {
@ -708,12 +710,12 @@
else if ([identifier isEqualToString: TAB_PEERS_IDENT]) else if ([identifier isEqualToString: TAB_PEERS_IDENT])
{ {
height = TAB_PEERS_HEIGHT; height = TAB_PEERS_HEIGHT;
canResizeHor = YES; canResizeVertical = YES;
} }
else if ([identifier isEqualToString: TAB_FILES_IDENT]) else if ([identifier isEqualToString: TAB_FILES_IDENT])
{ {
height = TAB_FILES_HEIGHT; height = TAB_FILES_HEIGHT;
canResizeHor = YES; canResizeVertical = YES;
} }
else if ([identifier isEqualToString: TAB_OPTIONS_IDENT]) else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
height = TAB_OPTIONS_HEIGHT; height = TAB_OPTIONS_HEIGHT;
@ -728,6 +730,8 @@
frame.origin.y -= difference; frame.origin.y -= difference;
frame.size.height += difference; frame.size.height += difference;
if (!fCanResizeVertical || !canResizeVertical)
{
if (animate) if (animate)
{ {
[view setHidden: YES]; [view setHidden: YES];
@ -736,9 +740,12 @@
} }
else else
[window setFrame: frame display: YES]; [window setFrame: frame display: YES];
}
[window setMinSize: NSMakeSize([window minSize].width, frame.size.height)]; [window setMinSize: NSMakeSize([window minSize].width, frame.size.height)];
[window setMaxSize: NSMakeSize([window maxSize].width, canResizeHor ? FLT_MAX : frame.size.height)]; [window setMaxSize: NSMakeSize([window maxSize].width, canResizeVertical ? FLT_MAX : frame.size.height)];
fCanResizeVertical = canResizeVertical;
} }
- (void) setNextTab - (void) setNextTab