From 66bb01302e802102c1f6dbc85d9c90277bdb9877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pantale=C3=A3o=20Gon=C3=A7alves?= Date: Wed, 8 May 2024 02:46:11 +0200 Subject: [PATCH] Revert "Use same variable for status bar color as frontend (#2757)" This reverts commit 71e5dd80fdd440cdd6f5e361680152b155a1ef81. --- Sources/App/Resources/WebSocketBridge.js | 1 - Sources/App/Utilities/ThemeColors.swift | 2 -- Sources/App/WebView/WebViewController.swift | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Sources/App/Resources/WebSocketBridge.js b/Sources/App/Resources/WebSocketBridge.js index 133446e78..7e8fd5970 100644 --- a/Sources/App/Resources/WebSocketBridge.js +++ b/Sources/App/Resources/WebSocketBridge.js @@ -8,7 +8,6 @@ const notifyThemeColors = () => { [ '--app-header-background-color', - '--app-theme-color', '--primary-background-color', '--text-primary-color', '--primary-color', diff --git a/Sources/App/Utilities/ThemeColors.swift b/Sources/App/Utilities/ThemeColors.swift index 9ba94fc76..c3b576aba 100644 --- a/Sources/App/Utilities/ThemeColors.swift +++ b/Sources/App/Utilities/ThemeColors.swift @@ -6,7 +6,6 @@ public struct ThemeColors: Codable { public enum Color: String, CaseIterable { // these are in WebSocketBridge.js in this repo (we inject it) case appHeaderBackgroundColor = "--app-header-background-color" - case appThemeColor = "--app-theme-color" case primaryBackgroundColor = "--primary-background-color" case textPrimaryColor = "--text-primary-color" case primaryColor = "--primary-color" @@ -78,7 +77,6 @@ private extension ThemeColors.Color { case .primaryBackgroundColor: return UIColor(red: 0.98, green: 0.98, blue: 0.98, alpha: 1.0) case .primaryColor: return UIColor.white case .textPrimaryColor: return UIColor.white - case .appThemeColor: return UIColor(red: 0.01, green: 0.66, blue: 0.96, alpha: 1.0) } } } diff --git a/Sources/App/WebView/WebViewController.swift b/Sources/App/WebView/WebViewController.swift index 5b48fe335..9536ddabc 100644 --- a/Sources/App/WebView/WebViewController.swift +++ b/Sources/App/WebView/WebViewController.swift @@ -346,12 +346,12 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg webView?.scrollView.backgroundColor = cachedColors[.primaryBackgroundColor] if let statusBarView = view.viewWithTag(111) { - statusBarView.backgroundColor = cachedColors[.appThemeColor] + statusBarView.backgroundColor = cachedColors[.appHeaderBackgroundColor] } refreshControl.tintColor = cachedColors[.primaryColor] - let headerBackgroundIsLight = cachedColors[.appThemeColor].isLight + let headerBackgroundIsLight = cachedColors[.appHeaderBackgroundColor].isLight underlyingPreferredStatusBarStyle = headerBackgroundIsLight ? .darkContent : .lightContent setNeedsStatusBarAppearanceUpdate()