From 9129cd382cba6c7b2da4cade578a77b4c2bcd437 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 27 Feb 2024 20:02:31 -0800 Subject: [PATCH] Remove some no-longer-needed #available checks. --- Mac/AppDelegate.swift | 34 +- Mac/Base.lproj/MainWindow.storyboard | 618 ------------------ Mac/Base.lproj/UnifiedWindow.storyboard | 22 +- ...ltinSmartFeedInspectorViewController.swift | 5 +- .../FolderInspectorViewController.swift | 8 +- Mac/MainWindow/Detail/DetailWebView.swift | 38 +- .../Detail/DetailWebViewController.swift | 19 +- .../Sidebar/Cell/SidebarCellAppearance.swift | 6 +- .../Cell/TimelineCellAppearance.swift | 6 +- .../Timeline/TimelineTableRowView.swift | 26 +- .../Timeline/TimelineViewController.swift | 5 +- .../AccountsFeedbinWindowController.swift | 11 +- NetNewsWire.xcodeproj/project.pbxproj | 14 - 13 files changed, 62 insertions(+), 750 deletions(-) delete mode 100644 Mac/Base.lproj/MainWindow.storyboard diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index aa198c5b4..f4f375454 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -393,13 +393,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidat // MARK: Main Window func createMainWindowController() -> MainWindowController { - let controller: MainWindowController - if #available(macOS 11.0, *) { - controller = windowControllerWithName("UnifiedWindow") as! MainWindowController - } else { - controller = windowControllerWithName("MainWindow") as! MainWindowController - } - + let controller: MainWindowController = windowControllerWithName("UnifiedWindow") as! MainWindowController + if !(mainWindowController?.isOpen ?? false) { mainWindowControllers.removeAll() } @@ -798,33 +793,20 @@ internal extension AppDelegate { var attrs = [NSAttributedString.Key : Any]() attrs[.font] = NSFont.systemFont(ofSize: NSFont.smallSystemFontSize) attrs[.foregroundColor] = NSColor.textColor - - if #available(macOS 11.0, *) { - let titleParagraphStyle = NSMutableParagraphStyle() - titleParagraphStyle.alignment = .center - attrs[.paragraphStyle] = titleParagraphStyle - } + + let titleParagraphStyle = NSMutableParagraphStyle() + titleParagraphStyle.alignment = .center + attrs[.paragraphStyle] = titleParagraphStyle let websiteText = NSMutableAttributedString() websiteText.append(NSAttributedString(string: NSLocalizedString("Author‘s website:", comment: "Author's Website"), attributes: attrs)) - if #available(macOS 11.0, *) { - websiteText.append(NSAttributedString(string: "\n")) - } else { - websiteText.append(NSAttributedString(string: " ")) - } + websiteText.append(NSAttributedString(string: "\n")) attrs[.link] = theme.creatorHomePage websiteText.append(NSAttributedString(string: theme.creatorHomePage, attributes: attrs)) - let textViewWidth: CGFloat - if #available(macOS 11.0, *) { - textViewWidth = 200 - } else { - textViewWidth = 400 - } - - let textView = NSTextView(frame: CGRect(x: 0, y: 0, width: textViewWidth, height: 15)) + let textView = NSTextView(frame: CGRect(x: 0, y: 0, width: 200, height: 15)) textView.isEditable = false textView.drawsBackground = false textView.textStorage?.setAttributedString(websiteText) diff --git a/Mac/Base.lproj/MainWindow.storyboard b/Mac/Base.lproj/MainWindow.storyboard deleted file mode 100644 index e653a8978..000000000 --- a/Mac/Base.lproj/MainWindow.storyboard +++ /dev/null @@ -1,618 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mac/Base.lproj/UnifiedWindow.storyboard b/Mac/Base.lproj/UnifiedWindow.storyboard index 2a537adbc..6c19a07e5 100644 --- a/Mac/Base.lproj/UnifiedWindow.storyboard +++ b/Mac/Base.lproj/UnifiedWindow.storyboard @@ -1,8 +1,8 @@ - + - + @@ -90,13 +90,13 @@ - + - + @@ -119,7 +119,7 @@ - + @@ -174,7 +174,7 @@ -