mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit '680f0a7814bdb0c5a5e73c498c73b791ce47ac74' into beta
This commit is contained in:
commit
fc982ccd85
@ -748,7 +748,7 @@ public class ItemListInviteRequestItemNode: ListViewItemNode, ItemListItemNode {
|
||||
}
|
||||
strongSelf.dismissButton.setTitle(item.presentationData.strings.MemberRequests_Dismiss, with: Font.bold(15.0), with: item.presentationData.theme.list.itemAccentColor, for: .normal)
|
||||
|
||||
let addWidth = measureAddLayout.size.width + 10.0
|
||||
let addWidth = measureAddLayout.size.width + 24.0
|
||||
let addHeight = strongSelf.addButton.updateLayout(width: addWidth, transition: .immediate)
|
||||
let addButtonFrame = CGRect(x: leftInset, y: contentSize.height - addHeight - 12.0, width: addWidth, height: addHeight)
|
||||
strongSelf.addButton.frame = addButtonFrame
|
||||
|
@ -1135,7 +1135,7 @@ public func themePickerController(context: AccountContext, focusOnItemTag: Theme
|
||||
var updatedAutomaticThemeSwitchSetting = current.automaticThemeSwitchSetting
|
||||
if case let .cloud(info) = updatedTheme, info.theme.settings?.contains(where: { $0.baseTheme == .night || $0.baseTheme == .tinted }) ?? false {
|
||||
updatedAutomaticThemeSwitchSetting.theme = updatedTheme
|
||||
} else if autoNightModeTriggered {
|
||||
} else if autoNightModeTriggered && !preset {
|
||||
var updatedThemeSpecificAccentColors = current.themeSpecificAccentColors
|
||||
if let baseThemeIndex = baseThemeIndex {
|
||||
updatedThemeSpecificAccentColors[baseThemeIndex] = PresentationThemeAccentColor(themeIndex: updatedTheme.index)
|
||||
|
@ -1102,20 +1102,6 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
|
||||
var updatedAutomaticThemeSwitchSetting = current.automaticThemeSwitchSetting
|
||||
if case let .cloud(info) = updatedTheme, info.theme.settings?.contains(where: { $0.baseTheme == .night || $0.baseTheme == .tinted }) ?? false {
|
||||
updatedAutomaticThemeSwitchSetting.theme = updatedTheme
|
||||
} else if autoNightModeTriggered {
|
||||
var updatedThemeSpecificAccentColors = current.themeSpecificAccentColors
|
||||
if let baseThemeIndex = baseThemeIndex {
|
||||
updatedThemeSpecificAccentColors[baseThemeIndex] = PresentationThemeAccentColor(themeIndex: updatedTheme.index)
|
||||
}
|
||||
|
||||
if autoNightModeTriggered {
|
||||
var updatedAutomaticThemeSwitchSetting = current.automaticThemeSwitchSetting
|
||||
updatedAutomaticThemeSwitchSetting.theme = updatedTheme
|
||||
|
||||
return current.withUpdatedAutomaticThemeSwitchSetting(updatedAutomaticThemeSwitchSetting).withUpdatedThemeSpecificAccentColors(updatedThemeSpecificAccentColors)
|
||||
} else {
|
||||
return current.withUpdatedTheme(updatedTheme).withUpdatedThemeSpecificAccentColors(updatedThemeSpecificAccentColors)
|
||||
}
|
||||
} else if case let .builtin(theme) = updatedTheme {
|
||||
if [.day, .dayClassic].contains(theme) {
|
||||
if updatedAutomaticThemeSwitchSetting.theme.emoticon != nil || [.builtin(.dayClassic), .builtin(.day)].contains(updatedAutomaticThemeSwitchSetting.theme.generalThemeReference) {
|
||||
|
@ -663,7 +663,7 @@ public struct PresentationThemeSettings: Codable {
|
||||
}
|
||||
|
||||
var mappedThemePreferredBaseTheme: [Int64: TelegramBaseTheme] = [:]
|
||||
let themePreferredBaseThemeDict = try container.decode([Int64: Int64].self, forKey: "themePreferredBaseTheme")
|
||||
let themePreferredBaseThemeDict = try container.decodeIfPresent([Int64: Int64].self, forKey: "themePreferredBaseTheme") ?? [:]
|
||||
for (key, value) in themePreferredBaseThemeDict {
|
||||
if let baseTheme = TelegramBaseTheme(rawValue: Int32(clamping: value)) {
|
||||
mappedThemePreferredBaseTheme[key] = baseTheme
|
||||
|
Loading…
x
Reference in New Issue
Block a user