mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
Min size now changes for minimal view.
This commit is contained in:
@@ -111,12 +111,6 @@ static void sleepCallBack(void * controller, io_service_t y,
|
||||
[fWindow setToolbar: fToolbar];
|
||||
[fWindow setDelegate: self];
|
||||
|
||||
//window min height
|
||||
NSSize contentMinSize = [fWindow contentMinSize];
|
||||
contentMinSize.height = [[fWindow contentView] frame].size.height - [fScrollView frame].size.height
|
||||
+ [fTableView rowHeight] + [fTableView intercellSpacing].height;
|
||||
[fWindow setContentMinSize: contentMinSize];
|
||||
|
||||
//set table size
|
||||
if ([fDefaults boolForKey: @"SmallView"])
|
||||
{
|
||||
@@ -124,6 +118,12 @@ static void sleepCallBack(void * controller, io_service_t y,
|
||||
[fSmallViewItem setState: NSOnState];
|
||||
}
|
||||
|
||||
//window min height
|
||||
NSSize contentMinSize = [fWindow contentMinSize];
|
||||
contentMinSize.height = [[fWindow contentView] frame].size.height - [fScrollView frame].size.height
|
||||
+ [fTableView rowHeight] + [fTableView intercellSpacing].height;
|
||||
[fWindow setContentMinSize: contentMinSize];
|
||||
|
||||
//set info keyboard shortcuts
|
||||
unichar ch = NSRightArrowFunctionKey;
|
||||
[fNextInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & ch length: 1]];
|
||||
@@ -1478,6 +1478,26 @@ static void sleepCallBack(void * controller, io_service_t y,
|
||||
[fSmallViewItem setState: makeSmall];
|
||||
|
||||
[fDefaults setBool: makeSmall forKey: @"SmallView"];
|
||||
|
||||
//window min height
|
||||
NSSize contentMinSize = [fWindow contentMinSize],
|
||||
contentSize = [[fWindow contentView] frame].size;
|
||||
contentMinSize.height = contentSize.height - [fScrollView frame].size.height
|
||||
+ [fTableView rowHeight] + [fTableView intercellSpacing].height;
|
||||
[fWindow setContentMinSize: contentMinSize];
|
||||
|
||||
//resize for larger min height
|
||||
if (!makeSmall && contentSize.height < contentMinSize.height)
|
||||
{
|
||||
NSRect frame = [fWindow frame];
|
||||
float heightChange = contentMinSize.height - contentSize.height;
|
||||
frame.size.height += heightChange;
|
||||
frame.origin.y -= heightChange;
|
||||
|
||||
[fWindow setFrame: frame display: YES animate: NO];
|
||||
|
||||
[fTableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) toggleStatusBar: (id) sender
|
||||
|
||||
Reference in New Issue
Block a user