mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
Compatibility to build on the last macOS 32 bit system with its last compatible Xcode (#2844)
* Compatibility to build on the last macOS 32 bit system with its last compatible Xcode * Code review: Compatibility declarations * compatibility with `make` * Code review: headers * Avoiding dummy NSImageSymbolConfiguration implementation * clang-format * Don't force-include compat header * Remove compat header from pch header Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// It may be used under the MIT (SPDX: MIT) license.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#import "CocoaCompatibility.h"
|
||||
|
||||
#import "NSImageAdditions.h"
|
||||
|
||||
@implementation NSImage (NSImageAdditions)
|
||||
@@ -32,4 +34,17 @@
|
||||
return [NSImage imageNamed:fallbackName];
|
||||
}
|
||||
|
||||
+ (NSImage*)largeSystemSymbol:(NSString*)symbolName withFallback:(NSString*)fallbackName
|
||||
{
|
||||
#ifdef __MAC_11_0
|
||||
if (@available(macOS 11.0, *))
|
||||
{
|
||||
return [[NSImage imageWithSystemSymbolName:symbolName accessibilityDescription:nil]
|
||||
imageWithSymbolConfiguration:[NSImageSymbolConfiguration configurationWithScale:NSImageSymbolScaleLarge]];
|
||||
}
|
||||
#endif
|
||||
|
||||
return [NSImage imageNamed:fallbackName];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user