|
|
@@ -10,22 +10,27 @@ import Capacitor
|
|
|
import UIKit
|
|
|
|
|
|
@objc public class AppViewController: CAPBridgeViewController {
|
|
|
- override public func capacitorDidLoad() {
|
|
|
- bridge?.registerPluginInstance(UILocalPlugin())
|
|
|
- bridge?.registerPluginInstance(NativeTopBarPlugin())
|
|
|
- bridge?.registerPluginInstance(LiquidTabsPlugin())
|
|
|
- bridge?.registerPluginInstance(NativeBottomSheetPlugin())
|
|
|
- }
|
|
|
+ override public func capacitorDidLoad() {
|
|
|
+ bridge?.registerPluginInstance(UILocalPlugin())
|
|
|
+ bridge?.registerPluginInstance(NativeTopBarPlugin())
|
|
|
+ bridge?.registerPluginInstance(LiquidTabsPlugin())
|
|
|
+ bridge?.registerPluginInstance(NativeBottomSheetPlugin())
|
|
|
+ }
|
|
|
|
|
|
public override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
|
|
|
|
// initial setup
|
|
|
- applyLogseqBackground()
|
|
|
+ applyLogseqTheme()
|
|
|
}
|
|
|
|
|
|
- private func applyLogseqBackground() {
|
|
|
+ // MARK: - Theme application (background + tint)
|
|
|
+
|
|
|
+ private func applyLogseqTheme() {
|
|
|
let bg = UIColor.logseqBackground
|
|
|
+ let tint = UIColor.logseqTint
|
|
|
+
|
|
|
+ // Background
|
|
|
view.backgroundColor = bg
|
|
|
|
|
|
if let webView = self.webView {
|
|
|
@@ -36,6 +41,21 @@ import UIKit
|
|
|
// Sometimes WKWebView uses an internal subview for its background
|
|
|
webView.scrollView.subviews.first?.backgroundColor = bg
|
|
|
}
|
|
|
+
|
|
|
+ // Tint
|
|
|
+ view.tintColor = tint
|
|
|
+ webView?.tintColor = tint
|
|
|
+ webView?.scrollView.tintColor = tint
|
|
|
+
|
|
|
+ // Propagate to container UI if possible
|
|
|
+ navigationController?.view.tintColor = tint
|
|
|
+ navigationController?.navigationBar.tintColor = tint
|
|
|
+ navigationController?.tabBarController?.tabBar.tintColor = tint
|
|
|
+
|
|
|
+ // Global window tint (affects many UIKit + SwiftUI bits)
|
|
|
+ if let window = view.window {
|
|
|
+ window.tintColor = tint
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
|
|
@@ -47,6 +67,6 @@ import UIKit
|
|
|
}
|
|
|
|
|
|
// Re-apply dynamic colors when light/dark changes
|
|
|
- applyLogseqBackground()
|
|
|
+ applyLogseqTheme()
|
|
|
}
|
|
|
}
|