diff --git a/submodules/AttachmentUI/Sources/AttachmentPanel.swift b/submodules/AttachmentUI/Sources/AttachmentPanel.swift index d02314d6f3..e82de3f95c 100644 --- a/submodules/AttachmentUI/Sources/AttachmentPanel.swift +++ b/submodules/AttachmentUI/Sources/AttachmentPanel.swift @@ -217,6 +217,7 @@ private final class AttachButtonComponent: CombinedComponent { account: component.context.account, animation: AnimatedStickerComponent.Animation( source: .file(media: animationFile), + scale: UIScreenScale, loop: false, tintColor: tintColor ), diff --git a/submodules/Components/AnimatedStickerComponent/Sources/AnimatedStickerComponent.swift b/submodules/Components/AnimatedStickerComponent/Sources/AnimatedStickerComponent.swift index d9f95299f1..2207c317cd 100644 --- a/submodules/Components/AnimatedStickerComponent/Sources/AnimatedStickerComponent.swift +++ b/submodules/Components/AnimatedStickerComponent/Sources/AnimatedStickerComponent.swift @@ -14,11 +14,13 @@ public final class AnimatedStickerComponent: Component { } public var source: Source + public var scale: CGFloat public var loop: Bool public var tintColor: UIColor? - public init(source: Source, loop: Bool, tintColor: UIColor? = nil) { + public init(source: Source, scale: CGFloat = 2.0, loop: Bool, tintColor: UIColor? = nil) { self.source = source + self.scale = scale self.loop = loop self.tintColor = tintColor } @@ -106,7 +108,7 @@ public final class AnimatedStickerComponent: Component { } else if component.isAnimating { playbackMode = .once } - animationNode.setup(source: source, width: Int(component.size.width * 2.0), height: Int(component.size.height * 2.0), playbackMode: playbackMode, mode: .direct(cachePathPrefix: nil)) + animationNode.setup(source: source, width: Int(component.size.width * component.animation.scale), height: Int(component.size.height * component.animation.scale), playbackMode: playbackMode, mode: .direct(cachePathPrefix: nil)) animationNode.visibility = self.isInHierarchy self.animationNode = animationNode diff --git a/submodules/WebUI/Sources/WebAppController.swift b/submodules/WebUI/Sources/WebAppController.swift index 1116bd367b..93aa1958ef 100644 --- a/submodules/WebUI/Sources/WebAppController.swift +++ b/submodules/WebUI/Sources/WebAppController.swift @@ -386,17 +386,10 @@ public final class WebAppController: ViewController, AttachmentContainable { self.updatedPresentationData = updatedPresentationData self.presentationData = updatedPresentationData?.initial ?? context.sharedContext.currentPresentationData.with { $0 } - var theme = NavigationBarTheme(rootControllerTheme: self.presentationData.theme) - if self.presentationData.theme.list.plainBackgroundColor.rgb == 0x000000 { - theme = theme.withUpdatedBackgroundColor(self.presentationData.theme.list.itemBlocksBackgroundColor) - } else { - theme = theme.withUpdatedBackgroundColor(self.presentationData.theme.list.plainBackgroundColor) - } - let navigationBarPresentationData = NavigationBarPresentationData(theme: theme, strings: NavigationBarStrings(back: "", close: "")) - self.moreButtonNode = MoreButtonNode(theme: self.presentationData.theme) self.moreButtonNode.iconNode.enqueueState(.more, animated: false) + let navigationBarPresentationData = NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: self.presentationData.theme), strings: NavigationBarStrings(back: "", close: "")) super.init(navigationBarPresentationData: navigationBarPresentationData) self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style @@ -422,13 +415,7 @@ public final class WebAppController: ViewController, AttachmentContainable { if let strongSelf = self { strongSelf.presentationData = presentationData - var theme = NavigationBarTheme(rootControllerTheme: presentationData.theme) - if presentationData.theme.list.plainBackgroundColor.rgb == 0x000000 { - theme = theme.withUpdatedBackgroundColor(presentationData.theme.list.itemBlocksBackgroundColor) - } else { - theme = theme.withUpdatedBackgroundColor(presentationData.theme.list.plainBackgroundColor) - } - let navigationBarPresentationData = NavigationBarPresentationData(theme: theme, strings: NavigationBarStrings(back: "", close: "")) + let navigationBarPresentationData = NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme), strings: NavigationBarStrings(back: "", close: "")) strongSelf.navigationBar?.updatePresentationData(navigationBarPresentationData) strongSelf.titleView?.theme = presentationData.theme