mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +00:00
refine inspector resize code a bit more
This commit is contained in:
parent
7f4b879994
commit
58950c148e
1 changed files with 9 additions and 12 deletions
|
@ -710,23 +710,20 @@
|
||||||
|
|
||||||
BOOL canResizeVertical = NO;
|
BOOL canResizeVertical = NO;
|
||||||
float height;
|
float height;
|
||||||
if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
|
if ([identifier isEqualToString: TAB_INFO_IDENT])
|
||||||
|
height = TAB_INFO_HEIGHT;
|
||||||
|
else if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
|
||||||
{
|
{
|
||||||
height = TAB_ACTIVITY_HEIGHT;
|
height = TAB_ACTIVITY_HEIGHT;
|
||||||
[fPiecesView updateView: YES];
|
[fPiecesView updateView: YES];
|
||||||
}
|
}
|
||||||
else if ([identifier isEqualToString: TAB_PEERS_IDENT] || [identifier isEqualToString: TAB_FILES_IDENT])
|
|
||||||
{
|
|
||||||
canResizeVertical = YES;
|
|
||||||
|
|
||||||
//height only needed if resize will take place
|
|
||||||
if (!fCanResizeVertical)
|
|
||||||
height = MAX(TAB_RESIZABLE_MIN_HEIGHT, [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorHeight"]);
|
|
||||||
}
|
|
||||||
else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
|
else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
|
||||||
height = TAB_OPTIONS_HEIGHT;
|
height = TAB_OPTIONS_HEIGHT;
|
||||||
else
|
else
|
||||||
height = TAB_INFO_HEIGHT;
|
{
|
||||||
|
canResizeVertical = YES;
|
||||||
|
height = MAX(TAB_RESIZABLE_MIN_HEIGHT, [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorHeight"]);
|
||||||
|
}
|
||||||
|
|
||||||
NSWindow * window = [self window];
|
NSWindow * window = [self window];
|
||||||
NSView * view = [[fTabView selectedTabViewItem] view];
|
NSView * view = [[fTabView selectedTabViewItem] view];
|
||||||
|
@ -754,8 +751,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[window setMinSize: NSMakeSize([window minSize].width, !canResizeVertical ? windowFrame.size.height
|
[window setMinSize: NSMakeSize([window minSize].width, !canResizeVertical ? windowFrame.size.height
|
||||||
: (windowFrame.size.height - [[[fTabView selectedTabViewItem] view] frame].size.height) + TAB_RESIZABLE_MIN_HEIGHT)];
|
: (windowFrame.size.height - (viewFrame.size.height + difference)) + TAB_RESIZABLE_MIN_HEIGHT)];
|
||||||
[window setMaxSize: NSMakeSize([window maxSize].width, !canResizeVertical ? windowFrame.size.height : FLT_MAX)];
|
[window setMaxSize: NSMakeSize(FLT_MAX, !canResizeVertical ? windowFrame.size.height : FLT_MAX)];
|
||||||
|
|
||||||
fCanResizeVertical = canResizeVertical;
|
fCanResizeVertical = canResizeVertical;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue