Disable the zoom button if auto resize is enabled.

This commit is contained in:
Mitchell Livingston 2006-07-22 18:02:48 +00:00
parent 8226ef9d50
commit 777968a524
2 changed files with 9 additions and 6 deletions

View File

@ -178,6 +178,7 @@
- (void) toggleAdvancedBar: (id) sender;
- (void) setAutoSize: (NSNotification *) notification;
- (void) setWindowSizeToFit;
- (NSRect) windowFrameFor: (int) count;

View File

@ -309,7 +309,7 @@ static void sleepCallBack(void * controller, io_service_t y,
[nc addObserver: self selector: @selector(autoImportChange:)
name: @"AutoImportSettingChange" object: nil];
[nc addObserver: self selector: @selector(setWindowSizeToFit)
[nc addObserver: self selector: @selector(setAutoSize:)
name: @"AutoSizeSettingChange" object: nil];
//check to start another because of stopped torrent
@ -349,7 +349,7 @@ static void sleepCallBack(void * controller, io_service_t y,
[[NSRunLoop currentRunLoop] addTimer: fAutoImportTimer forMode: NSDefaultRunLoopMode];
[self applyFilter: nil];
[self setWindowSizeToFit];
[self setAutoSize: nil];
[fWindow makeKeyAndOrderFront: nil];
@ -2120,13 +2120,15 @@ static void sleepCallBack(void * controller, io_service_t y,
- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
{
//don't resize if set to auto size
if ([fDefaults boolForKey: @"AutoSize"])
return [fWindow frame];
return [self windowFrameFor: [fFilteredTorrents count]];
}
- (void) setAutoSize: (NSNotification *) notification
{
[[fWindow standardWindowButton: NSWindowZoomButton] setEnabled: ![fDefaults boolForKey: @"AutoSize"]];
[self setWindowSizeToFit];
}
- (void) setWindowSizeToFit
{
if ([fDefaults boolForKey: @"AutoSize"])