From 8a0d27488e5d487a910475442e120e32afd7f066 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 19 Oct 2023 13:39:15 -0500 Subject: [PATCH] Fixes incorrect Sources tab background color in dark mode --- AltStore/Browse/BrowseViewController.swift | 2 ++ AltStore/News/NewsViewController.swift | 2 ++ AltStore/Sources/SourceDetailContentViewController.swift | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/AltStore/Browse/BrowseViewController.swift b/AltStore/Browse/BrowseViewController.swift index 3c2975ff..5451cd45 100644 --- a/AltStore/Browse/BrowseViewController.swift +++ b/AltStore/Browse/BrowseViewController.swift @@ -49,6 +49,8 @@ class BrowseViewController: UICollectionViewController, PeekPopPreviewing { super.viewDidLoad() + self.collectionView.backgroundColor = .altBackground + #if BETA self.dataSource.searchController.searchableKeyPaths = [#keyPath(InstalledApp.name)] self.navigationItem.searchController = self.dataSource.searchController diff --git a/AltStore/News/NewsViewController.swift b/AltStore/News/NewsViewController.swift index ee6cf877..76c9d0c0 100644 --- a/AltStore/News/NewsViewController.swift +++ b/AltStore/News/NewsViewController.swift @@ -85,6 +85,8 @@ class NewsViewController: UICollectionViewController, PeekPopPreviewing { super.viewDidLoad() + self.collectionView.backgroundColor = .altBackground + self.prototypeCell = NewsCollectionViewCell.instantiate(with: NewsCollectionViewCell.nib!) self.prototypeCell.contentView.translatesAutoresizingMaskIntoConstraints = false diff --git a/AltStore/Sources/SourceDetailContentViewController.swift b/AltStore/Sources/SourceDetailContentViewController.swift index 2e31f845..525b435d 100644 --- a/AltStore/Sources/SourceDetailContentViewController.swift +++ b/AltStore/Sources/SourceDetailContentViewController.swift @@ -60,6 +60,8 @@ class SourceDetailContentViewController: UICollectionViewController { super.viewDidLoad() + self.collectionView.backgroundColor = .altBackground + let collectionViewLayout = self.makeLayout(source: self.source) self.collectionView.collectionViewLayout = collectionViewLayout @@ -221,6 +223,7 @@ private extension SourceDetailContentViewController // For some reason, setting cell.layoutMargins = .zero does not update cell.contentView.layoutMargins. cell.layoutMargins = .zero cell.contentView.layoutMargins = .zero + cell.contentView.backgroundColor = .altBackground cell.bannerView.configure(for: storeApp) @@ -300,6 +303,7 @@ private extension SourceDetailContentViewController cell.contentView.layoutMargins = .zero // Fixes incorrect margins if not initially on screen. cell.textView.text = source.localizedDescription cell.textView.isCollapsed = false + cell.textView.backgroundColor = .altBackground } return dataSource