mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Target macOS 13
• `xcconfig` `MACOSX_DEPLOYMENT_TARGET` updated to 13.0 • Removed `@available` annotations for macOS < 13.0 • Removed for Big Sur fixes. This has been built and doesn’t trigger any build settings should be `xcconfig` options.
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
import Html
|
||||
|
||||
@available(macOS 12, *)
|
||||
struct AboutHTML: LoadableAboutData {
|
||||
|
||||
private func stylesheet() -> StaticString {
|
||||
|
||||
@@ -10,7 +10,6 @@ import SwiftUI
|
||||
import WebKit
|
||||
import Html
|
||||
|
||||
@available(macOS 12, *)
|
||||
fileprivate struct WebView: NSViewRepresentable {
|
||||
|
||||
var htmlString: String
|
||||
@@ -50,7 +49,6 @@ fileprivate struct WebView: NSViewRepresentable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 12, *)
|
||||
struct AboutNewNewsWireView: View, LoadableAboutData {
|
||||
var body: some View {
|
||||
VStack(spacing: 4) {
|
||||
@@ -85,7 +83,7 @@ struct AboutNewNewsWireView: View, LoadableAboutData {
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 12, *)
|
||||
|
||||
struct AboutNetNewsWireView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AboutNewNewsWireView()
|
||||
|
||||
@@ -16,7 +16,6 @@ extension NSUserInterfaceItemIdentifier {
|
||||
|
||||
// MARK: - AboutWindowController
|
||||
|
||||
@available(macOS 12, *)
|
||||
class AboutWindowController: NSWindowController {
|
||||
|
||||
var hostingController: AboutHostingController
|
||||
@@ -44,7 +43,6 @@ class AboutWindowController: NSWindowController {
|
||||
|
||||
// MARK: - AboutHostingController
|
||||
|
||||
@available(macOS 12, *)
|
||||
class AboutHostingController: NSHostingController<AnyView> {
|
||||
|
||||
override init(rootView: AnyView) {
|
||||
|
||||
@@ -53,51 +53,10 @@ import RSCore
|
||||
override func viewDidEndLiveResize() {
|
||||
super.viewDidEndLiveResize()
|
||||
evaluateJavaScript("document.body.style.overflow = 'visible';", completionHandler: nil)
|
||||
bigSurOffsetFix()
|
||||
}
|
||||
|
||||
override func setFrameSize(_ newSize: NSSize) {
|
||||
super.setFrameSize(newSize)
|
||||
if (!inLiveResize) {
|
||||
bigSurOffsetFix()
|
||||
}
|
||||
}
|
||||
|
||||
private var inBigSurOffsetFix = false
|
||||
|
||||
@available(macOS, obsoleted: 12, message: "when minimum deployment > macOS 11 remove bigSurOffsetFix() and calls to it.")
|
||||
private func bigSurOffsetFix() {
|
||||
/*
|
||||
On macOS 11, when a user exits full screen
|
||||
or exits zoomed mode by disconnecting an external display
|
||||
the webview's `origin.y` is offset by a sizeable amount.
|
||||
|
||||
This code adjusts the height of the window by -1pt/+1pt,
|
||||
which puts the webview back in the correct place.
|
||||
|
||||
This code is only executed if currently running on macOS 11
|
||||
*/
|
||||
|
||||
if #unavailable(macOS 12) {
|
||||
guard var frame = window?.frame else {
|
||||
return
|
||||
}
|
||||
|
||||
guard !inBigSurOffsetFix else {
|
||||
return
|
||||
}
|
||||
|
||||
inBigSurOffsetFix = true
|
||||
|
||||
defer {
|
||||
inBigSurOffsetFix = false
|
||||
}
|
||||
|
||||
frame.size = NSSize(width: window!.frame.width, height: window!.frame.height - 1)
|
||||
window!.setFrame(frame, display: false)
|
||||
frame.size = NSSize(width: frame.width, height: frame.height + 1)
|
||||
window!.setFrame(frame, display: false)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: NSTextFinderClient
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
import Foundation
|
||||
|
||||
@available(iOS 15, *)
|
||||
@available(macOS 12, *)
|
||||
protocol LoadableAboutData {
|
||||
var about: AboutData { get }
|
||||
}
|
||||
|
||||
@available(iOS 15, *)
|
||||
@available(macOS 12, *)
|
||||
extension LoadableAboutData {
|
||||
|
||||
var about: AboutData {
|
||||
@@ -30,7 +28,6 @@ extension LoadableAboutData {
|
||||
}
|
||||
|
||||
@available(iOS 15, *)
|
||||
@available(macOS 12, *)
|
||||
struct AboutData: Codable {
|
||||
var PrimaryContributors: [Contributor]
|
||||
var AdditionalContributors: [Contributor]
|
||||
|
||||
@@ -40,7 +40,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE
|
||||
GCC_WARN_UNUSED_FUNCTION = YES
|
||||
GCC_WARN_UNUSED_VARIABLE = YES
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.0
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.0
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0
|
||||
//SDKROOT = macosx
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Off
|
||||
|
||||
@@ -6,5 +6,5 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
|
||||
COMBINE_HIDPI_IMAGES = YES
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.0
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.0
|
||||
SDKROOT = macosx;
|
||||
|
||||
Reference in New Issue
Block a user