mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Fix sticker checks color
This commit is contained in:
parent
f4950e8347
commit
9666c1d593
@ -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
|
||||
|
@ -226,6 +226,6 @@ public enum PresentationResourceParameterKey: Hashable {
|
||||
case chatOutgoingPartialCheck(CGFloat)
|
||||
case chatMediaFullCheck(CGFloat)
|
||||
case chatMediaPartialCheck(CGFloat)
|
||||
case chatFreeFullCheck(CGFloat)
|
||||
case chatFreePartialCheck(CGFloat)
|
||||
case chatFreeFullCheck(CGFloat, Bool)
|
||||
case chatFreePartialCheck(CGFloat, Bool)
|
||||
}
|
||||
|
@ -937,15 +937,17 @@ public struct PresentationResourcesChat {
|
||||
})
|
||||
}
|
||||
|
||||
public static func chatFreeFullCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? {
|
||||
return theme.image(PresentationResourceParameterKey.chatFreeFullCheck(size), { _ in
|
||||
return generateCheckImage(partial: false, color: theme.chat.serviceMessage.components.withDefaultWallpaper.primaryText, width: size)
|
||||
public static func chatFreeFullCheck(_ theme: PresentationTheme, size: CGFloat, isDefaultWallpaper: Bool) -> UIImage? {
|
||||
return theme.image(PresentationResourceParameterKey.chatFreeFullCheck(size, isDefaultWallpaper), { _ in
|
||||
let color = isDefaultWallpaper ? theme.chat.serviceMessage.components.withDefaultWallpaper.primaryText : theme.chat.serviceMessage.components.withCustomWallpaper.primaryText
|
||||
return generateCheckImage(partial: false, color: color, width: size)
|
||||
})
|
||||
}
|
||||
|
||||
public static func chatFreePartialCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? {
|
||||
return theme.image(PresentationResourceParameterKey.chatFreePartialCheck(size), { _ in
|
||||
return generateCheckImage(partial: true, color: theme.chat.serviceMessage.components.withDefaultWallpaper.primaryText, width: size)
|
||||
public static func chatFreePartialCheck(_ theme: PresentationTheme, size: CGFloat, isDefaultWallpaper: Bool) -> UIImage? {
|
||||
return theme.image(PresentationResourceParameterKey.chatFreePartialCheck(size, isDefaultWallpaper), { _ in
|
||||
let color = isDefaultWallpaper ? theme.chat.serviceMessage.components.withDefaultWallpaper.primaryText : theme.chat.serviceMessage.components.withCustomWallpaper.primaryText
|
||||
return generateCheckImage(partial: true, color: color, width: size)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
|
||||
let themeUpdated = presentationData.theme != currentTheme || type != currentType
|
||||
|
||||
let graphics = PresentationResourcesChat.principalGraphics(mediaBox: context.account.postbox.mediaBox, knockoutWallpaper: context.sharedContext.immediateExperimentalUISettings.knockoutWallpaper, theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
|
||||
let isDefaultWallpaper = serviceMessageColorHasDefaultWallpaper(presentationData.theme.wallpaper)
|
||||
let offset: CGFloat = -UIScreenPixel
|
||||
|
||||
let checkSize: CGFloat = floor(floor(presentationData.fontSize.baseDisplaySize * 11.0 / 17.0))
|
||||
@ -177,8 +178,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
|
||||
dateColor = serviceColor.primaryText
|
||||
backgroundImage = graphics.dateAndStatusFreeBackground
|
||||
leftInset = 0.0
|
||||
loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize)
|
||||
loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize)
|
||||
loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
|
||||
loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
|
||||
clockFrameImage = graphics.clockFreeFrameImage
|
||||
clockMinImage = graphics.clockFreeMinImage
|
||||
if impressionCount != nil {
|
||||
@ -190,8 +191,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
|
||||
outgoingStatus = status
|
||||
backgroundImage = graphics.dateAndStatusFreeBackground
|
||||
leftInset = 0.0
|
||||
loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize)
|
||||
loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize)
|
||||
loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
|
||||
loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
|
||||
clockFrameImage = graphics.clockFreeFrameImage
|
||||
clockMinImage = graphics.clockFreeMinImage
|
||||
if impressionCount != nil {
|
||||
|
@ -165,7 +165,7 @@ public class PeerMediaCollectionController: TelegramBaseController {
|
||||
}
|
||||
})
|
||||
]), ActionSheetItemGroup(items: [
|
||||
ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, action: { [weak actionSheet] in
|
||||
ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
|
||||
actionSheet?.dismissAnimated()
|
||||
})
|
||||
])])
|
||||
@ -384,7 +384,7 @@ public class PeerMediaCollectionController: TelegramBaseController {
|
||||
}
|
||||
})
|
||||
]), ActionSheetItemGroup(items: [
|
||||
ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, action: { [weak actionSheet] in
|
||||
ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
|
||||
actionSheet?.dismissAnimated()
|
||||
})
|
||||
])])
|
||||
@ -906,7 +906,7 @@ public class PeerMediaCollectionController: TelegramBaseController {
|
||||
}))
|
||||
}
|
||||
actionSheet.setItemGroups([ActionSheetItemGroup(items: items), ActionSheetItemGroup(items: [
|
||||
ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, action: { [weak actionSheet] in
|
||||
ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
|
||||
actionSheet?.dismissAnimated()
|
||||
})
|
||||
])])
|
||||
|
Loading…
x
Reference in New Issue
Block a user