mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Web app improvements
This commit is contained in:
@@ -217,6 +217,7 @@ private final class AttachButtonComponent: CombinedComponent {
|
|||||||
account: component.context.account,
|
account: component.context.account,
|
||||||
animation: AnimatedStickerComponent.Animation(
|
animation: AnimatedStickerComponent.Animation(
|
||||||
source: .file(media: animationFile),
|
source: .file(media: animationFile),
|
||||||
|
scale: UIScreenScale,
|
||||||
loop: false,
|
loop: false,
|
||||||
tintColor: tintColor
|
tintColor: tintColor
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -14,11 +14,13 @@ public final class AnimatedStickerComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var source: Source
|
public var source: Source
|
||||||
|
public var scale: CGFloat
|
||||||
public var loop: Bool
|
public var loop: Bool
|
||||||
public var tintColor: UIColor?
|
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.source = source
|
||||||
|
self.scale = scale
|
||||||
self.loop = loop
|
self.loop = loop
|
||||||
self.tintColor = tintColor
|
self.tintColor = tintColor
|
||||||
}
|
}
|
||||||
@@ -106,7 +108,7 @@ public final class AnimatedStickerComponent: Component {
|
|||||||
} else if component.isAnimating {
|
} else if component.isAnimating {
|
||||||
playbackMode = .once
|
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
|
animationNode.visibility = self.isInHierarchy
|
||||||
|
|
||||||
self.animationNode = animationNode
|
self.animationNode = animationNode
|
||||||
|
|||||||
@@ -386,17 +386,10 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
self.updatedPresentationData = updatedPresentationData
|
self.updatedPresentationData = updatedPresentationData
|
||||||
self.presentationData = updatedPresentationData?.initial ?? context.sharedContext.currentPresentationData.with { $0 }
|
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 = MoreButtonNode(theme: self.presentationData.theme)
|
||||||
self.moreButtonNode.iconNode.enqueueState(.more, animated: false)
|
self.moreButtonNode.iconNode.enqueueState(.more, animated: false)
|
||||||
|
|
||||||
|
let navigationBarPresentationData = NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: self.presentationData.theme), strings: NavigationBarStrings(back: "", close: ""))
|
||||||
super.init(navigationBarPresentationData: navigationBarPresentationData)
|
super.init(navigationBarPresentationData: navigationBarPresentationData)
|
||||||
|
|
||||||
self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style
|
self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style
|
||||||
@@ -422,13 +415,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.presentationData = presentationData
|
strongSelf.presentationData = presentationData
|
||||||
|
|
||||||
var theme = NavigationBarTheme(rootControllerTheme: presentationData.theme)
|
let navigationBarPresentationData = NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme), strings: NavigationBarStrings(back: "", close: ""))
|
||||||
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: ""))
|
|
||||||
strongSelf.navigationBar?.updatePresentationData(navigationBarPresentationData)
|
strongSelf.navigationBar?.updatePresentationData(navigationBarPresentationData)
|
||||||
strongSelf.titleView?.theme = presentationData.theme
|
strongSelf.titleView?.theme = presentationData.theme
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user