diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index eb1e03336..a2201d631 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -98,10 +98,6 @@ struct AppAssets { return RSImage(named: "extensionPointTwitter")! }() - static var extensionPreference: RSImage? = { - return RSImage(contentsOfFile: "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns") - }() - static var faviconTemplateImage: RSImage = { return RSImage(named: "faviconTemplateImage")! }() @@ -146,6 +142,38 @@ struct AppAssets { return NSImage(systemSymbolName: "safari", accessibilityDescription: nil)! }() + static var preferencesToolbarAccountsImage: RSImage = { + if #available(macOS 10.16, *) { + return NSImage(systemSymbolName: "at", accessibilityDescription: nil)! + } else { + return NSImage(named: NSImage.userAccountsName)! + } + }() + + static var preferencesToolbarExtensionsImage: RSImage = { + if #available(macOS 10.16, *) { + return NSImage(named: "preferencesToolbarExtensions")! + } else { + return NSImage(contentsOfFile: "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns")! + } + }() + + static var preferencesToolbarGeneralImage: RSImage = { + if #available(macOS 10.16, *) { + return NSImage(systemSymbolName: "gearshape", accessibilityDescription: nil)! + } else { + return NSImage(named: NSImage.preferencesGeneralName)! + } + }() + + static var preferencesToolbarAdvancedImage: RSImage = { + if #available(macOS 10.16, *) { + return NSImage(systemSymbolName: "gearshape.2", accessibilityDescription: nil)! + } else { + return NSImage(named: NSImage.advancedName)! + } + }() + @available(macOS 10.16, *) static var readClosedImage: RSImage = { return NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! diff --git a/Mac/Preferences/PreferencesWindowController.swift b/Mac/Preferences/PreferencesWindowController.swift index 143425ce5..738aa5d81 100644 --- a/Mac/Preferences/PreferencesWindowController.swift +++ b/Mac/Preferences/PreferencesWindowController.swift @@ -36,13 +36,13 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate { var specs = [PreferencesToolbarItemSpec]() specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General, name: NSLocalizedString("General", comment: "Preferences"), - image: NSImage(named: NSImage.preferencesGeneralName))] + image: AppAssets.preferencesToolbarGeneralImage)] specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts, name: NSLocalizedString("Accounts", comment: "Preferences"), - image: NSImage(named: NSImage.userAccountsName))] + image: AppAssets.preferencesToolbarAccountsImage)] specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Extensions, name: NSLocalizedString("Extensions", comment: "Preferences"), - image: AppAssets.extensionPreference)] + image: AppAssets.preferencesToolbarExtensionsImage)] // Omit the Advanced Preferences for now because the Software Update related functionality is // forbidden/non-applicable, and we can rely upon Apple to some extent for crash reports. We @@ -51,7 +51,7 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate { #if !MAC_APP_STORE specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced, name: NSLocalizedString("Advanced", comment: "Preferences"), - image: NSImage(named: NSImage.advancedName))] + image: AppAssets.preferencesToolbarAdvancedImage)] #endif return specs }() diff --git a/Mac/Resources/Assets.xcassets/preferencesToolbarExtensions.imageset/Contents.json b/Mac/Resources/Assets.xcassets/preferencesToolbarExtensions.imageset/Contents.json new file mode 100644 index 000000000..86f387514 --- /dev/null +++ b/Mac/Resources/Assets.xcassets/preferencesToolbarExtensions.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "filename" : "extensions.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" + } +} diff --git a/Mac/Resources/Assets.xcassets/preferencesToolbarExtensions.imageset/extensions.pdf b/Mac/Resources/Assets.xcassets/preferencesToolbarExtensions.imageset/extensions.pdf new file mode 100644 index 000000000..c15379568 Binary files /dev/null and b/Mac/Resources/Assets.xcassets/preferencesToolbarExtensions.imageset/extensions.pdf differ