Merge pull request #2160 from omnivore-app/fix/ios-theme-caret-color

Set the iOS caret colour based on theme
This commit is contained in:
Jackson Harper 2023-05-04 16:34:49 +08:00 committed by GitHub
commit 9ce5b0fa6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 5 deletions

View file

@ -1490,7 +1490,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.26.0;
MARKETING_VERSION = 1.27.0;
PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app;
PRODUCT_NAME = Omnivore;
PROVISIONING_PROFILE_SPECIFIER = "";
@ -1831,7 +1831,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.26.0;
MARKETING_VERSION = 1.27.0;
PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app;
PRODUCT_NAME = Omnivore;
PROVISIONING_PROFILE_SPECIFIER = "";

View file

@ -371,7 +371,7 @@ public struct ShareExtensionView: View {
viewModel.submitTitleEdit(dataService: viewModel.services.dataService,
itemID: linkedItem.unwrappedID,
title: viewModel.title,
description: linkedItem.description)
description: linkedItem.descriptionText ?? "")
}
}
viewState = .mainView

View file

@ -55,6 +55,7 @@ struct WebReader: PlatformViewRepresentable {
#if os(iOS)
webView.isOpaque = false
webView.tintColor = UIColor(ThemeManager.currentHighlightColor)
webView.backgroundColor = UIColor(ThemeManager.currentBgColor)
webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor)
webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor)
@ -116,6 +117,7 @@ struct WebReader: PlatformViewRepresentable {
(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 ?

View file

@ -143,8 +143,9 @@ extension WebReaderCoordinator: WKNavigationDelegate {
func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool {
scrollView.contentInset.top = readerViewNavBarHeight
let navBarVisible = navBarVisibilityRatio == 1
navBarVisibilityRatio = 1
return false
return navBarVisible
}
}
#endif

View file

@ -124,7 +124,7 @@
"welcomeSignupAgreement" = "Al registrarte, aceptas de Omnivore:\n";
"welcomeTitleTermsOfService" = "Términos del Servicio";
"welcomeTitleAndJoiner" = " y ";
"welcomeTitleEmailContinue" = "Continuar con el correo electrónico;
"welcomeTitleEmailContinue" = "Continuar con el correo electrónico";
// Keyboard Commands
"keyboardCommandDecreaseFont" = "Disminuir tamaño de fuente";

View file

@ -31,6 +31,20 @@ public enum Theme: String, CaseIterable {
}
}
public var highlightColor: Color {
switch self {
case .light, .sepia:
return Color(red: 255 / 255.0, green: 210 / 255.0, blue: 52 / 255.0)
case .dark, .apollo:
return Color(red: 134 / 255.0, green: 109 / 255.0, blue: 21 / 255.0)
case .system:
if Color.isDarkMode {
return Color(red: 134 / 255.0, green: 109 / 255.0, blue: 21 / 255.0)
}
return Color(red: 255 / 255.0, green: 210 / 255.0, blue: 52 / 255.0)
}
}
public var keyColor: Color {
switch self {
case .light:
@ -79,4 +93,8 @@ public enum ThemeManager {
public static var currentBgColor: Color {
currentTheme.bgColor
}
public static var currentHighlightColor: Color {
currentTheme.highlightColor
}
}