From f23ebbd8db13e25a3f8f0f300e2cfc4623263327 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 8 Aug 2020 18:15:45 -0500 Subject: [PATCH] Use SF Symbols for icons in the Sidebar when on Big Sur Issue #2323 --- Mac/AppAssets.swift | 32 ++++++++++++++-- .../AccentColor.colorset/Contents.json | 38 +++++++++++++++++++ Mac/Resources/Assets.xcassets/Contents.json | 6 +-- .../StarColor.colorset/Contents.json | 20 ++++++++++ 4 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 Mac/Resources/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Mac/Resources/Assets.xcassets/StarColor.colorset/Contents.json diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index f56c31354..e9be4a115 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -118,7 +118,13 @@ struct AppAssets { }() static var masterFolderImage: IconImage = { - return IconImage(RSImage(named: NSImage.folderName)!) + if #available(macOS 10.16, *) { + let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)! + let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!) + return IconImage(coloredImage, isSymbol: true) + } else { + return IconImage(RSImage(named: NSImage.folderName)!) + } }() static var searchFeedImage: IconImage = { @@ -126,7 +132,13 @@ struct AppAssets { }() static var starredFeedImage: IconImage = { - return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) + if #available(macOS 10.16, *) { + let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! + let coloredImage = image.tinted(with: NSColor(named: "StarColor")!) + return IconImage(coloredImage, isSymbol: true) + } else { + return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) + } }() static var timelineStar: RSImage! = { @@ -134,11 +146,23 @@ struct AppAssets { }() static var todayFeedImage: IconImage = { - return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) + if #available(macOS 10.16, *) { + let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)! + let coloredImage = image.tinted(with: .orange) + return IconImage(coloredImage, isSymbol: true) + } else { + return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) + } }() static var unreadFeedImage: IconImage = { - return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) + if #available(macOS 10.16, *) { + let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! + let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!) + return IconImage(coloredImage, isSymbol: true) + } else { + return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) + } }() static var swipeMarkReadImage: RSImage = { diff --git a/Mac/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/Mac/Resources/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..4f1440c52 --- /dev/null +++ b/Mac/Resources/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.933", + "green" : "0.416", + "red" : "0.031" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.620", + "red" : "0.369" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Mac/Resources/Assets.xcassets/Contents.json b/Mac/Resources/Assets.xcassets/Contents.json index da4a164c9..73c00596a 100644 --- a/Mac/Resources/Assets.xcassets/Contents.json +++ b/Mac/Resources/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Mac/Resources/Assets.xcassets/StarColor.colorset/Contents.json b/Mac/Resources/Assets.xcassets/StarColor.colorset/Contents.json new file mode 100644 index 000000000..c464941a7 --- /dev/null +++ b/Mac/Resources/Assets.xcassets/StarColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.204", + "green" : "0.776", + "red" : "0.976" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}