mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
don't resize the inspector unnecessarily
This commit is contained in:
parent
7fb27df36d
commit
c8d88af6f2
2 changed files with 19 additions and 10 deletions
|
@ -33,6 +33,8 @@
|
|||
NSArray * fTorrents, * fPeers, * fFiles;
|
||||
NSImage * fAppIcon, * fDotGreen, * fDotRed;
|
||||
|
||||
BOOL fCanResizeVertical;
|
||||
|
||||
IBOutlet NSTabView * fTabView;
|
||||
|
||||
IBOutlet NSImageView * fImageView;
|
||||
|
|
|
@ -71,6 +71,8 @@
|
|||
fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"];
|
||||
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
|
||||
fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
|
||||
|
||||
fCanResizeVertical = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -698,7 +700,7 @@
|
|||
{
|
||||
[self updateInfoStats];
|
||||
|
||||
BOOL canResizeHor = NO;
|
||||
BOOL canResizeVertical = NO;
|
||||
float height;
|
||||
if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
|
||||
{
|
||||
|
@ -708,12 +710,12 @@
|
|||
else if ([identifier isEqualToString: TAB_PEERS_IDENT])
|
||||
{
|
||||
height = TAB_PEERS_HEIGHT;
|
||||
canResizeHor = YES;
|
||||
canResizeVertical = YES;
|
||||
}
|
||||
else if ([identifier isEqualToString: TAB_FILES_IDENT])
|
||||
{
|
||||
height = TAB_FILES_HEIGHT;
|
||||
canResizeHor = YES;
|
||||
canResizeVertical = YES;
|
||||
}
|
||||
else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
|
||||
height = TAB_OPTIONS_HEIGHT;
|
||||
|
@ -728,6 +730,8 @@
|
|||
frame.origin.y -= difference;
|
||||
frame.size.height += difference;
|
||||
|
||||
if (!fCanResizeVertical || !canResizeVertical)
|
||||
{
|
||||
if (animate)
|
||||
{
|
||||
[view setHidden: YES];
|
||||
|
@ -736,9 +740,12 @@
|
|||
}
|
||||
else
|
||||
[window setFrame: frame display: YES];
|
||||
}
|
||||
|
||||
[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
|
||||
|
|
Loading…
Reference in a new issue