mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Theme fixes
This commit is contained in:
@@ -91,7 +91,7 @@ final class SettingsThemeWallpaperNode: ASDisplayNode {
|
||||
apply()
|
||||
case let .color(color):
|
||||
let theme = context.sharedContext.currentPresentationData.with { $0 }.theme
|
||||
let uiColor = UIColor(rgb: UInt32(bitPattern: color))
|
||||
let uiColor = UIColor(rgb: color)
|
||||
if uiColor.distance(to: theme.list.itemBlocksBackgroundColor) < 200 {
|
||||
self.imageNode.isHidden = false
|
||||
self.backgroundNode.isHidden = true
|
||||
@@ -101,12 +101,12 @@ final class SettingsThemeWallpaperNode: ASDisplayNode {
|
||||
} else {
|
||||
self.imageNode.isHidden = true
|
||||
self.backgroundNode.isHidden = false
|
||||
self.backgroundNode.backgroundColor = UIColor(rgb: UInt32(bitPattern: color))
|
||||
self.backgroundNode.backgroundColor = UIColor(rgb: color)
|
||||
}
|
||||
case let .gradient(topColor, bottomColor, _):
|
||||
self.imageNode.isHidden = false
|
||||
self.backgroundNode.isHidden = true
|
||||
self.imageNode.setSignal(gradientImage([UIColor(rgb: UInt32(bitPattern: topColor)), UIColor(rgb: UInt32(bitPattern: bottomColor))]))
|
||||
self.imageNode.setSignal(gradientImage([UIColor(rgb: topColor), UIColor(rgb: bottomColor)]))
|
||||
let apply = self.imageNode.asyncLayout()(TransformImageArguments(corners: corners, imageSize: CGSize(), boundingSize: size, intrinsicInsets: UIEdgeInsets()))
|
||||
apply()
|
||||
case let .image(representations, _):
|
||||
@@ -136,11 +136,11 @@ final class SettingsThemeWallpaperNode: ASDisplayNode {
|
||||
if let intensity = file.settings.intensity {
|
||||
patternIntensity = CGFloat(intensity) / 100.0
|
||||
}
|
||||
patternColor = UIColor(rgb: UInt32(bitPattern: color), alpha: patternIntensity)
|
||||
patternColor = UIColor(rgb: color, alpha: patternIntensity)
|
||||
patternColors.append(patternColor)
|
||||
|
||||
if let bottomColor = file.settings.bottomColor {
|
||||
patternColors.append(UIColor(rgb: UInt32(bitPattern: bottomColor), alpha: patternIntensity))
|
||||
patternColors.append(UIColor(rgb: bottomColor, alpha: patternIntensity))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user