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:
Stuart Breckenridge
2023-05-30 09:15:08 +08:00
parent ac403050b8
commit e2eeed8f99
7 changed files with 3 additions and 52 deletions

View File

@@ -8,7 +8,6 @@
import Html
@available(macOS 12, *)
struct AboutHTML: LoadableAboutData {
private func stylesheet() -> StaticString {

View File

@@ -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()

View File

@@ -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) {

View File

@@ -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