Hide Zoom button for Mini Window.

Also fix 4 deprecation warnings.
CQTexperiment
Dzmitry Neviadomski 2021-01-07 07:41:58 +03:00
parent edafc3fe1f
commit 52c31c5117
1 changed files with 5 additions and 4 deletions

View File

@ -68,7 +68,7 @@
[p setResolvesAliases:YES]; [p setResolvesAliases:YES];
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) { [p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
if ( result == NSFileHandlingPanelOKButton ) { if ( result == NSModalResponseOK ) {
[self->playlistLoader willInsertURLs:[p URLs] origin:URLOriginInternal]; [self->playlistLoader willInsertURLs:[p URLs] origin:URLOriginInternal];
[self->playlistLoader didInsertURLs:[self->playlistLoader addURLs:[p URLs] sort:YES] origin:URLOriginInternal]; [self->playlistLoader didInsertURLs:[self->playlistLoader addURLs:[p URLs] sort:YES] origin:URLOriginInternal];
} else { } else {
@ -84,7 +84,7 @@
p = [NSSavePanel savePanel]; p = [NSSavePanel savePanel];
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) { [p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
if ( result == NSFileHandlingPanelOKButton ) { if ( result == NSModalResponseOK ) {
[self->playlistLoader save:[[p URL] path]]; [self->playlistLoader save:[[p URL] path]];
} else { } else {
[p close]; [p close];
@ -103,7 +103,7 @@
- (void)openURLPanelDidEnd:(OpenURLPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo - (void)openURLPanelDidEnd:(OpenURLPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
{ {
if (returnCode == NSOKButton) if (returnCode == NSModalResponseOK)
{ {
[playlistLoader willInsertURLs:[NSArray arrayWithObject:[panel url]] origin:URLOriginInternal]; [playlistLoader willInsertURLs:[NSArray arrayWithObject:[panel url]] origin:URLOriginInternal];
[playlistLoader didInsertURLs:[playlistLoader addURLs:[NSArray arrayWithObject:[panel url]] sort:NO] origin:URLOriginInternal]; [playlistLoader didInsertURLs:[playlistLoader addURLs:[NSArray arrayWithObject:[panel url]] sort:NO] origin:URLOriginInternal];
@ -170,6 +170,7 @@
} }
} }
[[miniWindow standardWindowButton:NSWindowZoomButton] setHidden:YES];
// Restore mini mode // Restore mini mode
[self setMiniMode:[[NSUserDefaults standardUserDefaults] boolForKey:@"miniMode"]]; [self setMiniMode:[[NSUserDefaults standardUserDefaults] boolForKey:@"miniMode"]];
@ -377,7 +378,7 @@
NSMutableDictionary *userDefaultsValuesDict = [NSMutableDictionary dictionary]; NSMutableDictionary *userDefaultsValuesDict = [NSMutableDictionary dictionary];
// Font defaults // Font defaults
float fFontSize = [NSFont systemFontSizeForControlSize:NSSmallControlSize]; float fFontSize = [NSFont systemFontSizeForControlSize:NSControlSizeSmall];
NSNumber *fontSize = [NSNumber numberWithFloat:fFontSize]; NSNumber *fontSize = [NSNumber numberWithFloat:fFontSize];
[userDefaultsValuesDict setObject:fontSize forKey:@"fontSize"]; [userDefaultsValuesDict setObject:fontSize forKey:@"fontSize"];