mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-18 11:13:28 +01:00
Adjusts illegible Source tint colors for SourceDetailViewController
This commit is contained in:
@@ -27,7 +27,7 @@ class HeaderContentViewController<Header: UIView, Content: ScrollableContentView
|
|||||||
didSet {
|
didSet {
|
||||||
guard self.isViewLoaded else { return }
|
guard self.isViewLoaded else { return }
|
||||||
|
|
||||||
self.view.tintColor = self.tintColor
|
self.view.tintColor = self.tintColor?.adjustedForDisplay
|
||||||
self.update()
|
self.update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,6 +233,8 @@ class HeaderContentViewController<Header: UIView, Content: ScrollableContentView
|
|||||||
|
|
||||||
// Start with navigation bar hidden.
|
// Start with navigation bar hidden.
|
||||||
self.hideNavigationBar()
|
self.hideNavigationBar()
|
||||||
|
|
||||||
|
self.view.tintColor = self.tintColor?.adjustedForDisplay
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillAppear(_ animated: Bool)
|
override func viewWillAppear(_ animated: Bool)
|
||||||
@@ -496,7 +498,22 @@ private extension HeaderContentViewController
|
|||||||
|
|
||||||
barAppearance.titleTextAttributes = [.foregroundColor: UIColor.clear]
|
barAppearance.titleTextAttributes = [.foregroundColor: UIColor.clear]
|
||||||
|
|
||||||
let tintColor = isHidden ? UIColor.clear : self.tintColor ?? .altPrimary
|
let dynamicColor = UIColor { traitCollection in
|
||||||
|
var tintColor = self.tintColor ?? .altPrimary
|
||||||
|
|
||||||
|
if traitCollection.userInterfaceStyle == .dark && tintColor.isTooDark
|
||||||
|
{
|
||||||
|
tintColor = .white
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tintColor = tintColor.adjustedForDisplay
|
||||||
|
}
|
||||||
|
|
||||||
|
return tintColor
|
||||||
|
}
|
||||||
|
|
||||||
|
let tintColor = isHidden ? UIColor.clear : dynamicColor
|
||||||
barAppearance.configureWithTintColor(tintColor)
|
barAppearance.configureWithTintColor(tintColor)
|
||||||
|
|
||||||
self.navigationItem.standardAppearance = barAppearance
|
self.navigationItem.standardAppearance = barAppearance
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ class SourceDetailContentViewController: UICollectionViewController
|
|||||||
{
|
{
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
self.view.tintColor = self.source.effectiveTintColor
|
|
||||||
|
|
||||||
let collectionViewLayout = self.makeLayout(source: self.source)
|
let collectionViewLayout = self.makeLayout(source: self.source)
|
||||||
self.collectionView.collectionViewLayout = collectionViewLayout
|
self.collectionView.collectionViewLayout = collectionViewLayout
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class SourceDetailViewController: HeaderContentViewController<SourceHeaderView,
|
|||||||
|
|
||||||
case false?:
|
case false?:
|
||||||
title = NSLocalizedString("ADD", comment: "")
|
title = NSLocalizedString("ADD", comment: "")
|
||||||
self.navigationBarButton.tintColor = self.source.effectiveTintColor ?? .altPrimary
|
self.navigationBarButton.tintColor = self.source.effectiveTintColor?.adjustedForDisplay ?? .altPrimary
|
||||||
|
|
||||||
self.addButton.isHidden = false
|
self.addButton.isHidden = false
|
||||||
self.navigationBarButton.isHidden = false
|
self.navigationBarButton.isHidden = false
|
||||||
|
|||||||
Reference in New Issue
Block a user