mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
e8e2d419c5
commit
b10556fdd0
@ -244,7 +244,16 @@ public final class AvatarBadgeView: UIImageView {
|
|||||||
var brightness: CGFloat = 0
|
var brightness: CGFloat = 0
|
||||||
var alpha: CGFloat = 0
|
var alpha: CGFloat = 0
|
||||||
backgroundColor.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha)
|
backgroundColor.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha)
|
||||||
return UIColor(hue: hue, saturation: saturation, brightness: brightness * 0.9, alpha: alpha)
|
|
||||||
|
if brightness > 0.5 {
|
||||||
|
brightness = max(brightness - 0.2, 0)
|
||||||
|
saturation = min(saturation + 0.2, 1)
|
||||||
|
} else {
|
||||||
|
brightness = min(brightness + 0.3, 1)
|
||||||
|
saturation = max(saturation - 0.2, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: alpha)
|
||||||
} else {
|
} else {
|
||||||
return backgroundColor
|
return backgroundColor
|
||||||
}
|
}
|
||||||
|
@ -3344,7 +3344,7 @@ func replayFinalState(
|
|||||||
var langPackDifferences: [String: [Api.LangPackDifference]] = [:]
|
var langPackDifferences: [String: [Api.LangPackDifference]] = [:]
|
||||||
var pollLangPacks = Set<String>()
|
var pollLangPacks = Set<String>()
|
||||||
var updatedThemes: [Int64: TelegramTheme] = [:]
|
var updatedThemes: [Int64: TelegramTheme] = [:]
|
||||||
var updatedWallpapers: [PeerId: TelegramWallpaper] = [:]
|
var updatedWallpapers: [PeerId: TelegramWallpaper?] = [:]
|
||||||
var delayNotificatonsUntil: Int32?
|
var delayNotificatonsUntil: Int32?
|
||||||
var peerActivityTimestamps: [PeerId: Int32] = [:]
|
var peerActivityTimestamps: [PeerId: Int32] = [:]
|
||||||
var syncChatListFilters = false
|
var syncChatListFilters = false
|
||||||
@ -4382,7 +4382,7 @@ func replayFinalState(
|
|||||||
case let .UpdateTheme(theme):
|
case let .UpdateTheme(theme):
|
||||||
updatedThemes[theme.id] = theme
|
updatedThemes[theme.id] = theme
|
||||||
case let .UpdateWallpaper(peerId, wallpaper):
|
case let .UpdateWallpaper(peerId, wallpaper):
|
||||||
updatedWallpapers[peerId] = wallpaper
|
updatedWallpapers.updateValue(wallpaper, forKey: peerId)
|
||||||
case .SyncChatListFilters:
|
case .SyncChatListFilters:
|
||||||
syncChatListFilters = true
|
syncChatListFilters = true
|
||||||
case let .UpdateChatListFilterOrder(order):
|
case let .UpdateChatListFilterOrder(order):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user