deal with separator color
This commit is contained in:
@@ -475,7 +475,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
||||
self.backgroundColor = ThemeManager.widgetBackgroundColor;
|
||||
_hostNameLabel.textColor = ThemeManager.textColor;
|
||||
[_appButton setTitleColor:ThemeManager.appPrimaryColor forState:UIControlStateNormal];
|
||||
_separatorLine.backgroundColor = ThemeManager.separatorColor;
|
||||
_separatorLine.backgroundColor = ThemeManager.hostCardSeparatorColor;
|
||||
|
||||
backgroundLayer.hidden = NO;
|
||||
[self updateBackgroundLayerTheme];
|
||||
|
||||
+43
-12
@@ -144,7 +144,49 @@ class ThemeManager: NSObject {
|
||||
|
||||
@objc static var separatorColor: UIColor {
|
||||
_ = setPublicUIStyle()
|
||||
|
||||
switch userInterfaceStyle() {
|
||||
case .light:
|
||||
if #available(iOS 13.0, *) {
|
||||
let lightTraits = UITraitCollection(userInterfaceStyle: .light)
|
||||
return GenericUtils.liquidGlassEnabled ? legacySepratorColor : UIColor.separator.resolvedColor(with: lightTraits)
|
||||
} else {
|
||||
return UIColor(
|
||||
red: 214.0/255.0,
|
||||
green: 214.0/255.0,
|
||||
blue: 218.0/255.0,
|
||||
alpha: 1
|
||||
)
|
||||
}
|
||||
default:
|
||||
if #available(iOS 13.0, *) {
|
||||
let darkTraits = UITraitCollection(userInterfaceStyle: .dark)
|
||||
return GenericUtils.liquidGlassEnabled ? legacySepratorColor : UIColor.separator.resolvedColor(with: darkTraits)
|
||||
} else {return UIColor(white: 0.28, alpha: 1)}
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var legacySepratorColor: UIColor {
|
||||
_ = setPublicUIStyle()
|
||||
switch userInterfaceStyle() {
|
||||
case .light:
|
||||
return UIColor(
|
||||
red: 0.23529411764705882,
|
||||
green: 0.23529411764705882,
|
||||
blue: 0.2627450980392157,
|
||||
alpha: 0.29
|
||||
)
|
||||
default:
|
||||
return UIColor(
|
||||
red: 0.32941176470588235,
|
||||
green: 0.32941176470588235,
|
||||
blue: 0.34509803921568627,
|
||||
alpha: 0.6
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var hostCardSeparatorColor: UIColor {
|
||||
_ = setPublicUIStyle()
|
||||
switch userInterfaceStyle() {
|
||||
case .light:
|
||||
if #available(iOS 13.0, *) {
|
||||
@@ -166,17 +208,6 @@ class ThemeManager: NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var hostCardSeparatorColor: UIColor {
|
||||
_ = setPublicUIStyle()
|
||||
|
||||
switch userInterfaceStyle() {
|
||||
case .light:
|
||||
return UIColor(white: 0.1, alpha: 0.28)
|
||||
default:
|
||||
return UIColor(white: 0.28, alpha: 1)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var textColor: UIColor {
|
||||
_ = setPublicUIStyle()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user