mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fixes to build on Macos
This commit is contained in:
parent
9278a938d7
commit
1fbd0a5e64
5 changed files with 57 additions and 48 deletions
|
|
@ -116,13 +116,15 @@ struct WebReader: PlatformViewRepresentable {
|
|||
(webView as? OmnivoreWebView)?.updateTitle(title: item.title ?? "")
|
||||
(webView as? OmnivoreWebView)?.updateJustifyText()
|
||||
|
||||
webView.backgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.tintColor = UIColor(ThemeManager.currentHighlightColor)
|
||||
webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.scrollView.indicatorStyle = ThemeManager.currentTheme.isDark ?
|
||||
UIScrollView.IndicatorStyle.white :
|
||||
UIScrollView.IndicatorStyle.black
|
||||
#if os(iOS)
|
||||
webView.backgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.tintColor = UIColor(ThemeManager.currentHighlightColor)
|
||||
webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.scrollView.indicatorStyle = ThemeManager.currentTheme.isDark ?
|
||||
UIScrollView.IndicatorStyle.white :
|
||||
UIScrollView.IndicatorStyle.black
|
||||
#endif
|
||||
}
|
||||
|
||||
if showNavBarActionID != context.coordinator.previousShowNavBarActionID {
|
||||
|
|
|
|||
|
|
@ -288,30 +288,30 @@ struct WebReaderContainerView: View {
|
|||
|
||||
#if os(iOS)
|
||||
audioNavbarItem
|
||||
#endif
|
||||
|
||||
Button(
|
||||
action: {
|
||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||
showPreferencesFormsheet.toggle()
|
||||
} else {
|
||||
showPreferencesPopover.toggle()
|
||||
Button(
|
||||
action: {
|
||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||
showPreferencesFormsheet.toggle()
|
||||
} else {
|
||||
showPreferencesPopover.toggle()
|
||||
}
|
||||
},
|
||||
label: {
|
||||
Image(systemName: "textformat.size")
|
||||
.font(.appNavbarIcon)
|
||||
}
|
||||
},
|
||||
label: {
|
||||
Image(systemName: "textformat.size")
|
||||
.font(.appNavbarIcon)
|
||||
)
|
||||
.padding(.horizontal, 5)
|
||||
.scaleEffect(navBarVisibilityRatio)
|
||||
.popover(isPresented: $showPreferencesPopover) {
|
||||
webPreferencesPopoverView
|
||||
.frame(maxWidth: 400, maxHeight: 475)
|
||||
}
|
||||
)
|
||||
.padding(.horizontal, 5)
|
||||
.scaleEffect(navBarVisibilityRatio)
|
||||
.popover(isPresented: $showPreferencesPopover) {
|
||||
webPreferencesPopoverView
|
||||
.frame(maxWidth: 400, maxHeight: 475)
|
||||
}
|
||||
.formSheet(isPresented: $showPreferencesFormsheet, modalSize: CGSize(width: 400, height: 475)) {
|
||||
webPreferencesPopoverView
|
||||
}
|
||||
.formSheet(isPresented: $showPreferencesFormsheet, modalSize: CGSize(width: 400, height: 475)) {
|
||||
webPreferencesPopoverView
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
Spacer()
|
||||
|
|
@ -596,7 +596,9 @@ struct WebReaderContainerView: View {
|
|||
#if os(iOS)
|
||||
UIPasteboard.general.string = deepLink.absoluteString
|
||||
#else
|
||||
Pasteboard.general.string = deepLink.absoluteString
|
||||
let pasteBoard = NSPasteboard.general
|
||||
pasteBoard.clearContents()
|
||||
pasteBoard.writeObjects([deepLink.absoluteString as NSString])
|
||||
#endif
|
||||
showInSnackbar("Deeplink Copied")
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -50,19 +50,22 @@ public struct HighlightAnnotationSheet: View {
|
|||
}
|
||||
.padding()
|
||||
.navigationTitle("Note")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarItems(leading: Button(action: onCancel, label: {
|
||||
Text("Cancel")
|
||||
}))
|
||||
.navigationBarItems(trailing: Button(action: onSave, label: {
|
||||
Text("Save").bold()
|
||||
}))
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
|
||||
.navigationBarItems(leading: Button(action: onCancel, label: {
|
||||
Text("Cancel")
|
||||
}))
|
||||
.navigationBarItems(trailing: Button(action: onSave, label: {
|
||||
Text("Save").bold()
|
||||
}))
|
||||
#endif
|
||||
.listStyle(PlainListStyle())
|
||||
.alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) {
|
||||
Button(LocalText.genericOk, role: .cancel, action: {
|
||||
errorAlertMessage = nil
|
||||
showErrorAlertMessage = false
|
||||
})
|
||||
}
|
||||
.alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) {
|
||||
Button(LocalText.genericOk, role: .cancel, action: {
|
||||
errorAlertMessage = nil
|
||||
showErrorAlertMessage = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ public final class OmnivoreWebView: WKWebView {
|
|||
override public func viewDidChangeEffectiveAppearance() {
|
||||
super.viewDidChangeEffectiveAppearance()
|
||||
if ThemeManager.currentTheme == .system {
|
||||
try dispatchEvent(.updateTheme(themeName: ThemeManager.currentTheme.themeKey))
|
||||
try? dispatchEvent(.updateTheme(themeName: ThemeManager.currentTheme.themeKey))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import Utils
|
|||
|
||||
public extension View {
|
||||
func draggableItem(item: LinkedItem) -> some View {
|
||||
if #available(iOS 16.0, *), let url = item.deepLink {
|
||||
return AnyView(self.draggable(url) {
|
||||
Label(item.unwrappedTitle, systemImage: "link")
|
||||
})
|
||||
}
|
||||
#if os(iOS)
|
||||
if #available(iOS 16.0, *), let url = item.deepLink {
|
||||
return AnyView(self.draggable(url) {
|
||||
Label(item.unwrappedTitle, systemImage: "link")
|
||||
})
|
||||
}
|
||||
#endif
|
||||
return AnyView(self)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue