Remove and resize after sheet disappears.

This commit is contained in:
Mitchell Livingston 2006-07-22 18:25:11 +00:00
parent 777968a524
commit 7ec2ba693b
4 changed files with 9 additions and 9 deletions

View File

@ -180,7 +180,7 @@
- (void) setAutoSize: (NSNotification *) notification;
- (void) setWindowSizeToFit;
- (NSRect) windowFrameFor: (int) count;
- (NSRect) windowFrameForAmount: (int) amount;
- (void) showMainWindow: (id) sender;
- (void) linkHomepage: (id) sender;

View File

@ -665,7 +665,7 @@ static void sleepCallBack(void * controller, io_service_t y,
}
NSBeginAlertSheet(title, @"Remove", @"Cancel", nil, fWindow, self,
@selector(removeSheetDidEnd:returnCode:contextInfo:), nil, dict, message);
nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), dict, message);
return;
}
}
@ -2120,7 +2120,7 @@ static void sleepCallBack(void * controller, io_service_t y,
- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
{
return [self windowFrameFor: [fFilteredTorrents count]];
return [self windowFrameForAmount: [fFilteredTorrents count]];
}
- (void) setAutoSize: (NSNotification *) notification
@ -2132,14 +2132,14 @@ static void sleepCallBack(void * controller, io_service_t y,
- (void) setWindowSizeToFit
{
if ([fDefaults boolForKey: @"AutoSize"])
[fWindow setFrame: [self windowFrameFor: [fTorrents count]] display: YES animate: YES];
[fWindow setFrame: [self windowFrameForAmount: [fTorrents count]] display: YES animate: YES];
}
- (NSRect) windowFrameFor: (int) count
- (NSRect) windowFrameForAmount: (int) amount
{
NSRect frame = [fWindow frame];
float newHeight = frame.size.height - [fScrollView frame].size.height
+ count * ([fTableView rowHeight] + [fTableView intercellSpacing].height);
+ amount * ([fTableView rowHeight] + [fTableView intercellSpacing].height);
float minHeight = [fWindow minSize].height;
if (newHeight < minHeight)

View File

@ -11,7 +11,7 @@
<key>1480</key>
<string>366 546 420 63 0 0 1152 842 </string>
<key>1603</key>
<string>337 544 477 67 0 0 1152 842 </string>
<string>360 371 477 67 0 0 1152 842 </string>
<key>29</key>
<string>9 780 451 44 0 0 1152 842 </string>
<key>456</key>
@ -31,9 +31,9 @@
<integer>3</integer>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>1041</integer>
<integer>1603</integer>
<integer>21</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>

Binary file not shown.