diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index a2201d631..d5220bc1e 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -40,7 +40,7 @@ struct AppAssets { return RSImage(named: "accountNewsBlur") }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var addNewSidebarItemImage: RSImage = { return NSImage(systemSymbolName: "plus", accessibilityDescription: nil)! }() @@ -77,7 +77,7 @@ struct AppAssets { return RSImage(named: "articleExtractorProgress4") }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var cleanUpImage: RSImage = { return NSImage(systemSymbolName: "wind", accessibilityDescription: nil)! }() @@ -119,7 +119,7 @@ struct AppAssets { }() static var masterFolderImage: IconImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)! let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!) return IconImage(coloredImage, isSymbol: true) @@ -132,18 +132,18 @@ struct AppAssets { return RSImage(named: "markAllAsRead")! }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var nextUnreadImage: RSImage = { return NSImage(systemSymbolName: "chevron.down.circle", accessibilityDescription: nil)! }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var openInBrowserImage: RSImage = { return NSImage(systemSymbolName: "safari", accessibilityDescription: nil)! }() static var preferencesToolbarAccountsImage: RSImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { return NSImage(systemSymbolName: "at", accessibilityDescription: nil)! } else { return NSImage(named: NSImage.userAccountsName)! @@ -151,7 +151,7 @@ struct AppAssets { }() static var preferencesToolbarExtensionsImage: RSImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { return NSImage(named: "preferencesToolbarExtensions")! } else { return NSImage(contentsOfFile: "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns")! @@ -159,7 +159,7 @@ struct AppAssets { }() static var preferencesToolbarGeneralImage: RSImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { return NSImage(systemSymbolName: "gearshape", accessibilityDescription: nil)! } else { return NSImage(named: NSImage.preferencesGeneralName)! @@ -167,24 +167,24 @@ struct AppAssets { }() static var preferencesToolbarAdvancedImage: RSImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { return NSImage(systemSymbolName: "gearshape.2", accessibilityDescription: nil)! } else { return NSImage(named: NSImage.advancedName)! } }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var readClosedImage: RSImage = { return NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var readOpenImage: RSImage = { return NSImage(systemSymbolName: "circle", accessibilityDescription: nil)! }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var refreshImage: RSImage = { return NSImage(systemSymbolName: "arrow.clockwise", accessibilityDescription: nil)! }() @@ -193,23 +193,23 @@ struct AppAssets { return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true) }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var shareImage: RSImage = { return NSImage(systemSymbolName: "square.and.arrow.up", accessibilityDescription: nil)! }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var starClosedImage: RSImage = { return NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! }() - @available(macOS 10.16, *) + @available(macOS 11.0, *) static var starOpenImage: RSImage = { return NSImage(systemSymbolName: "star", accessibilityDescription: nil)! }() static var starredFeedImage: IconImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! let coloredImage = image.tinted(with: NSColor(named: "StarColor")!) return IconImage(coloredImage, isSymbol: true) @@ -219,7 +219,7 @@ struct AppAssets { }() static var timelineStar: RSImage! = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! let coloredImage = image.tinted(with: NSColor(named: "StarColor")!) return coloredImage @@ -229,7 +229,7 @@ struct AppAssets { }() static var todayFeedImage: IconImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)! let coloredImage = image.tinted(with: .orange) return IconImage(coloredImage, isSymbol: true) @@ -239,7 +239,7 @@ struct AppAssets { }() static var unreadFeedImage: IconImage = { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!) return IconImage(coloredImage, isSymbol: true) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 855f85adf..33960838d 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -351,7 +351,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, func createMainWindowController() -> MainWindowController { let controller: MainWindowController - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let storyboard = NSStoryboard(name: NSStoryboard.Name("MainWindow"), bundle: nil) controller = storyboard.instantiateController(withIdentifier: "UnifiedWindowController") as! MainWindowController } else { diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index 7f0ed93d6..f7d0d2657 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -61,7 +61,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations { sharingServicePickerDelegate = SharingServicePickerDelegate(self.window) - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { DispatchQueue.main.async { let toolbar = NSToolbar(identifier: "MainWindowToolbar") toolbar.allowsUserCustomization = true @@ -714,7 +714,7 @@ extension NSToolbarItem.Identifier { extension MainWindowController: NSToolbarDelegate { func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { switch itemIdentifier { @@ -779,7 +779,7 @@ extension MainWindowController: NSToolbarDelegate { } func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { return [ .refresh, .newSidebarItemMenu, @@ -816,7 +816,7 @@ extension MainWindowController: NSToolbarDelegate { } func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { return [ .refresh, .newSidebarItemMenu, @@ -860,7 +860,7 @@ extension MainWindowController: NSToolbarDelegate { button.sendAction(on: .leftMouseDown) } - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { if item.itemIdentifier == .search, let searchItem = item as? NSSearchToolbarItem { searchItem.searchField.delegate = self searchItem.searchField.target = self @@ -882,7 +882,7 @@ extension MainWindowController: NSToolbarDelegate { return } - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { if item.itemIdentifier == .search, let searchItem = item as? NSSearchToolbarItem { searchItem.searchField.delegate = nil searchItem.searchField.target = nil @@ -1007,7 +1007,7 @@ private extension MainWindowController { menuItem.title = commandName } - if #available(macOS 10.16, *), let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { + if #available(macOS 11.0, *), let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { button.image = markingRead ? AppAssets.readClosedImage : AppAssets.readOpenImage } @@ -1094,7 +1094,7 @@ private extension MainWindowController { menuItem.title = commandName } - if #available(macOS 10.16, *), let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { + if #available(macOS 11.0, *), let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { button.image = starring ? AppAssets.starOpenImage : AppAssets.starClosedImage } @@ -1168,7 +1168,7 @@ private extension MainWindowController { if displayName != nil { window?.title = displayName! - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { window?.subtitle = "\(unreadCount ?? 0) unread" } } else { diff --git a/Mac/MainWindow/Sidebar/Cell/SidebarCellAppearance.swift b/Mac/MainWindow/Sidebar/Cell/SidebarCellAppearance.swift index 88b6e77b3..c228d2255 100644 --- a/Mac/MainWindow/Sidebar/Cell/SidebarCellAppearance.swift +++ b/Mac/MainWindow/Sidebar/Cell/SidebarCellAppearance.swift @@ -23,7 +23,7 @@ struct SidebarCellAppearance: Equatable { textFieldFontSize = 11 case .large: imageSize = CGSize(width: 24, height: 24) - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { textFieldFontSize = 15 } else { textFieldFontSize = 13 diff --git a/Shared/Article Rendering/ArticleRenderer.swift b/Shared/Article Rendering/ArticleRenderer.swift index 39cf38b5d..0abdb3e5a 100644 --- a/Shared/Article Rendering/ArticleRenderer.swift +++ b/Shared/Article Rendering/ArticleRenderer.swift @@ -266,7 +266,7 @@ private extension ArticleRenderer { func styleSubstitutions() -> [String: String] { var d = [String: String]() - if #available(macOS 10.16, *) { + if #available(macOS 11.0, *) { let bodyFont = NSFont.preferredFont(forTextStyle: .body) d["font-size"] = String(describing: Int(round(bodyFont.pointSize * 1.33))) }