macOS: Fix compilation
This commit is contained in:
parent
83dad76b82
commit
107c4b0d72
|
@ -1329,7 +1329,7 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_ENTITLEMENTS = Gemini/Gemini.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Gemini/Gemini.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"Gemini/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"Gemini/Preview Content\"";
|
||||||
|
@ -1355,7 +1355,7 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_ENTITLEMENTS = Gemini/Gemini.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Gemini/Gemini.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"Gemini/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"Gemini/Preview Content\"";
|
||||||
|
|
|
@ -108,8 +108,8 @@ extension BrowserWindowController: NSToolbarDelegate {
|
||||||
item.label = "Go Back"
|
item.label = "Go Back"
|
||||||
item.paletteLabel = "Go Back"
|
item.paletteLabel = "Go Back"
|
||||||
item.toolTip = "Go to the previous page"
|
item.toolTip = "Go to the previous page"
|
||||||
item.target = navigator
|
item.target = self
|
||||||
item.action = #selector(NavigationManager.back)
|
item.action = #selector(back)
|
||||||
item.isBordered = true
|
item.isBordered = true
|
||||||
if #available(macOS 10.16, *) {
|
if #available(macOS 10.16, *) {
|
||||||
item.isNavigational = true
|
item.isNavigational = true
|
||||||
|
@ -127,8 +127,8 @@ extension BrowserWindowController: NSToolbarDelegate {
|
||||||
item.label = "Go Forward"
|
item.label = "Go Forward"
|
||||||
item.paletteLabel = "Go Forward"
|
item.paletteLabel = "Go Forward"
|
||||||
item.toolTip = "Go to the next page"
|
item.toolTip = "Go to the next page"
|
||||||
item.target = navigator
|
item.target = self
|
||||||
item.action = #selector(NavigationManager.forward)
|
item.action = #selector(forward)
|
||||||
item.isBordered = true
|
item.isBordered = true
|
||||||
if #available(macOS 10.16, *) {
|
if #available(macOS 10.16, *) {
|
||||||
item.isNavigational = true
|
item.isNavigational = true
|
||||||
|
@ -136,14 +136,22 @@ extension BrowserWindowController: NSToolbarDelegate {
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func back() {
|
||||||
|
navigator.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc private func forward() {
|
||||||
|
navigator.forward()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NavigationManager: NSToolbarItemValidation {
|
extension BrowserWindowController: NSToolbarItemValidation {
|
||||||
public func validateToolbarItem(_ item: NSToolbarItem) -> Bool {
|
public func validateToolbarItem(_ item: NSToolbarItem) -> Bool {
|
||||||
if item.itemIdentifier == .goBack {
|
if item.itemIdentifier == .goBack {
|
||||||
return !backStack.isEmpty
|
return !navigator.backStack.isEmpty
|
||||||
} else if item.itemIdentifier == .goForward {
|
} else if item.itemIdentifier == .goForward {
|
||||||
return !forwardStack.isEmpty
|
return !navigator.forwardStack.isEmpty
|
||||||
} else {
|
} else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,8 +72,7 @@ struct RenderingBlockView: View {
|
||||||
self.changeURL?(url)
|
self.changeURL?(url)
|
||||||
} label: {
|
} label: {
|
||||||
HStack(alignment: .firstTextBaseline, spacing: 4) {
|
HStack(alignment: .firstTextBaseline, spacing: 4) {
|
||||||
Image(systemName: imageName)
|
maybeLinkImage(name: imageName)
|
||||||
.frame(minWidth: 23, alignment: .leading)
|
|
||||||
|
|
||||||
Text(verbatim: text)
|
Text(verbatim: text)
|
||||||
.font(.documentBody)
|
.font(.documentBody)
|
||||||
|
@ -90,6 +89,15 @@ struct RenderingBlockView: View {
|
||||||
return button.maybeHelp(url.absoluteString)
|
return button.maybeHelp(url.absoluteString)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func maybeLinkImage(name: String) -> AnyView {
|
||||||
|
// can't use availability check inside view body, since buildLimitedAvailability was introduced in iOS 14 :/
|
||||||
|
if #available(iOS 13.0, macOS 11.0, *) {
|
||||||
|
return AnyView(Image(systemName: name).frame(minWidth: 23, alignment: .leading))
|
||||||
|
} else {
|
||||||
|
return AnyView(EmptyView())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func preformatted(_ text: String) -> some View {
|
private func preformatted(_ text: String) -> some View {
|
||||||
ScrollView(.horizontal) {
|
ScrollView(.horizontal) {
|
||||||
Text(verbatim: text)
|
Text(verbatim: text)
|
||||||
|
|
Loading…
Reference in New Issue