Fix sticker checks color

This commit is contained in:
Ilya Laktyushin
2019-11-22 20:01:55 +04:00
parent f4950e8347
commit 9666c1d593
6 changed files with 26 additions and 19 deletions

View File

@@ -676,15 +676,19 @@ public func serviceMessageColorComponents(theme: PresentationTheme, wallpaper: T
return serviceMessageColorComponents(chatTheme: theme.chat, wallpaper: wallpaper)
}
public func serviceMessageColorComponents(chatTheme: PresentationThemeChat, wallpaper: TelegramWallpaper) -> PresentationThemeServiceMessageColorComponents {
public func serviceMessageColorHasDefaultWallpaper(_ wallpaper: TelegramWallpaper) -> Bool {
switch wallpaper {
case .color(0xffffff):
return chatTheme.serviceMessage.components.withDefaultWallpaper
return true
default:
return chatTheme.serviceMessage.components.withCustomWallpaper
return false
}
}
public func serviceMessageColorComponents(chatTheme: PresentationThemeChat, wallpaper: TelegramWallpaper) -> PresentationThemeServiceMessageColorComponents {
return serviceMessageColorHasDefaultWallpaper(wallpaper) ? chatTheme.serviceMessage.components.withDefaultWallpaper : chatTheme.serviceMessage.components.withCustomWallpaper
}
public final class PresentationThemeServiceMessageColor {
public let withDefaultWallpaper: PresentationThemeServiceMessageColorComponents
public let withCustomWallpaper: PresentationThemeServiceMessageColorComponents