1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-02 12:32:54 +00:00

Method parameter isn't really needed.

This commit is contained in:
Mitchell Livingston 2006-07-23 21:50:41 +00:00
parent f2ffb6698b
commit 8c3e4f9337
2 changed files with 6 additions and 6 deletions

View file

@ -179,7 +179,7 @@
- (void) toggleAdvancedBar: (id) sender; - (void) toggleAdvancedBar: (id) sender;
- (void) setWindowSizeToFit; - (void) setWindowSizeToFit;
- (NSRect) windowFrameForAmount: (int) amount; - (NSRect) sizedWindowFrame;
- (void) showMainWindow: (id) sender; - (void) showMainWindow: (id) sender;
- (void) linkHomepage: (id) sender; - (void) linkHomepage: (id) sender;

View file

@ -2116,8 +2116,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame - (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
{ {
NSRect frame = [fDefaults boolForKey: @"AutoSize"] ? [window frame] //if auto size is enabled, the current frame shouldn't need to change
: [self windowFrameForAmount: [fFilteredTorrents count]]; NSRect frame = [fDefaults boolForKey: @"AutoSize"] ? [window frame] : [self sizedWindowFrame];
frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : WINDOW_REGULAR_WIDTH; frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : WINDOW_REGULAR_WIDTH;
return frame; return frame;
@ -2126,14 +2126,14 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
- (void) setWindowSizeToFit - (void) setWindowSizeToFit
{ {
if ([fDefaults boolForKey: @"AutoSize"]) if ([fDefaults boolForKey: @"AutoSize"])
[fWindow setFrame: [self windowFrameForAmount: [fFilteredTorrents count]] display: YES animate: YES]; [fWindow setFrame: [self sizedWindowFrame] display: YES animate: YES];
} }
- (NSRect) windowFrameForAmount: (int) amount - (NSRect) sizedWindowFrame
{ {
NSRect frame = [fWindow frame]; NSRect frame = [fWindow frame];
float newHeight = frame.size.height - [fScrollView frame].size.height float newHeight = frame.size.height - [fScrollView frame].size.height
+ amount * ([fTableView rowHeight] + [fTableView intercellSpacing].height); + [fFilteredTorrents count] * ([fTableView rowHeight] + [fTableView intercellSpacing].height);
float minHeight = [fWindow minSize].height; float minHeight = [fWindow minSize].height;
if (newHeight < minHeight) if (newHeight < minHeight)