mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -860,12 +860,15 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
let wallpaperPreviewController = WallpaperGalleryController(context: strongSelf.context, source: .wallpaper(wallpaper, nil, [], nil, nil, nil), mode: .peer(EnginePeer(peer), true))
|
||||
wallpaperPreviewController.apply = { [weak wallpaperPreviewController] entry, options, _, _, brightness in
|
||||
var settings: WallpaperSettings?
|
||||
if case let .wallpaper(wallpaper, _) = entry, case let .file(file) = wallpaper, !file.isPattern {
|
||||
var intensity: Int32?
|
||||
if let brightness {
|
||||
intensity = max(0, min(100, Int32(brightness * 100.0)))
|
||||
if case let .wallpaper(wallpaper, _) = entry {
|
||||
let baseSettings = wallpaper.settings
|
||||
var intensity: Int32? = baseSettings?.intensity
|
||||
if case let .file(file) = wallpaper, !file.isPattern {
|
||||
if let brightness {
|
||||
intensity = max(0, min(100, Int32(brightness * 100.0)))
|
||||
}
|
||||
}
|
||||
settings = WallpaperSettings(blur: options.contains(.blur), motion: options.contains(.motion), intensity: intensity)
|
||||
settings = WallpaperSettings(blur: options.contains(.blur), motion: options.contains(.motion), colors: baseSettings?.colors ?? [], intensity: intensity, rotation: baseSettings?.rotation)
|
||||
}
|
||||
let _ = (strongSelf.context.engine.themes.setExistingChatWallpaper(messageId: message.id, settings: settings)
|
||||
|> deliverOnMainQueue).start()
|
||||
|
||||
Reference in New Issue
Block a user