mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-05 19:57:31 +00:00
Make webview transparent to fix flash-of-white when in dark mode. Fixes #5587.
This commit is contained in:
1 parent
5c50d7b97d
commit
545b8ebb64
2 files changed
+9
No files matched your search
@@ -20,6 +20,11 @@ final class PreloadedWebView: WKWebView {
|
||||
super.init(frame: .zero, configuration: configuration)
|
||||
isInspectable = true
|
||||
isFindInteractionEnabled = true
|
||||
// Transparent so a page sliding in shows its view’s background, not white, until it paints.
|
||||
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5587>
|
||||
isOpaque = false
|
||||
backgroundColor = .clear
|
||||
scrollView.backgroundColor = .clear
|
||||
fullscreenStateObservation = observe(\.fullscreenState, options: []) { [weak self] _, _ in
|
||||
Task { @MainActor in
|
||||
guard let self else {
|
||||
|
||||
@@ -93,6 +93,10 @@ final class WebViewController: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Shows through the transparent web view until the article paints.
|
||||
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5587>
|
||||
view.backgroundColor = .systemBackground
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleFeedIconImageDidChange(_:)), name: .feedIconImageDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleGrayscaleIconsDidChange(_:)), name: .grayscaleIconsDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleAuthorAvatarImageDidChange(_:)), name: .authorAvatarImageDidChange, object: nil)
|
||||
|
||||
Reference in new issue
Block a user