mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix choosing sticker activity layout in chat list
This commit is contained in:
parent
60051a7d6a
commit
8bc5041653
@ -90,10 +90,6 @@ private class ChatChoosingStickerActivityIndicatorNode: ChatTitleActivityIndicat
|
|||||||
|
|
||||||
context.strokeEllipse(in: CGRect(x: rightCenter.x - eyeWidth / 2.0, y: rightCenter.y - eyeHeight / 2.0, width: eyeWidth, height: eyeHeight))
|
context.strokeEllipse(in: CGRect(x: rightCenter.x - eyeWidth / 2.0, y: rightCenter.y - eyeHeight / 2.0, width: eyeWidth, height: eyeHeight))
|
||||||
context.fillEllipse(in: CGRect(x: rightCenter.x - pupilSize / 2.0 + pupilCenter.x * eyeWidth / 4.0, y: rightCenter.y - pupilSize / 2.0, width: pupilSize, height: pupilSize))
|
context.fillEllipse(in: CGRect(x: rightCenter.x - pupilSize / 2.0 + pupilCenter.x * eyeWidth / 4.0, y: rightCenter.y - pupilSize / 2.0, width: pupilSize, height: pupilSize))
|
||||||
|
|
||||||
// context.strokeEllipse(in: CGRect(x: 0.0, y: 0.0, width: 10.0, height: 20.0))
|
|
||||||
// context.fillEllipse(in: CGRect(x: , y: , width: 4.0, height: 4.0))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +117,7 @@ class ChatChoosingStickerActivityContentNode: ChatTitleActivityContentNode {
|
|||||||
|
|
||||||
override func updateLayout(_ constrainedSize: CGSize, offset: CGFloat, alignment: NSTextAlignment) -> CGSize {
|
override func updateLayout(_ constrainedSize: CGSize, offset: CGFloat, alignment: NSTextAlignment) -> CGSize {
|
||||||
let size = self.textNode.updateLayout(constrainedSize)
|
let size = self.textNode.updateLayout(constrainedSize)
|
||||||
|
let scale = size.height / 15.0
|
||||||
let indicatorSize = CGSize(width: 24.0, height: 16.0)
|
let indicatorSize = CGSize(width: 24.0, height: 16.0)
|
||||||
let originX: CGFloat
|
let originX: CGFloat
|
||||||
let indicatorOriginX: CGFloat
|
let indicatorOriginX: CGFloat
|
||||||
@ -131,15 +128,30 @@ class ChatChoosingStickerActivityContentNode: ChatTitleActivityContentNode {
|
|||||||
originX = floorToScreenPixels((indicatorSize.width - size.width) / 2.0)
|
originX = floorToScreenPixels((indicatorSize.width - size.width) / 2.0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
originX = indicatorSize.width
|
if self.advanced {
|
||||||
|
originX = 4.0
|
||||||
|
} else {
|
||||||
|
originX = indicatorSize.width * scale - 1.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.textNode.frame = CGRect(origin: CGPoint(x: originX, y: 0.0), size: size)
|
self.textNode.frame = CGRect(origin: CGPoint(x: originX, y: 0.0), size: size)
|
||||||
if self.advanced {
|
if self.advanced {
|
||||||
indicatorOriginX = self.textNode.frame.minX + 14.0 + UIScreenPixel
|
if case .center = alignment {
|
||||||
|
indicatorOriginX = self.textNode.frame.minX + 26.0 + UIScreenPixel
|
||||||
|
} else {
|
||||||
|
var scale = scale
|
||||||
|
if scale > 1.25 {
|
||||||
|
scale *= 0.95
|
||||||
|
}
|
||||||
|
indicatorOriginX = self.textNode.frame.minX + floorToScreenPixels(26.0 * scale) + UIScreenPixel
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
indicatorOriginX = self.textNode.frame.minX - indicatorSize.width
|
indicatorOriginX = self.textNode.frame.minX - (indicatorSize.width * scale) / 2.0 + 3.0
|
||||||
}
|
}
|
||||||
self.indicatorNode.frame = CGRect(origin: CGPoint(x: indicatorOriginX, y: 0.0), size: indicatorSize)
|
self.indicatorNode.bounds = CGRect(origin: CGPoint(), size: indicatorSize)
|
||||||
|
self.indicatorNode.position = CGPoint(x: indicatorOriginX, y: size.height / 2.0)
|
||||||
|
self.indicatorNode.transform = CATransform3DMakeScale(scale, scale, 1.0)
|
||||||
|
|
||||||
return CGSize(width: size.width + indicatorSize.width, height: size.height)
|
return CGSize(width: size.width + indicatorSize.width, height: size.height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1131,6 +1131,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
return view.values[PreferencesKeys.appConfiguration] as? AppConfiguration ?? .defaultValue
|
return view.values[PreferencesKeys.appConfiguration] as? AppConfiguration ?? .defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var didSetPresentationData = false
|
||||||
self.presentationDataDisposable = (
|
self.presentationDataDisposable = (
|
||||||
combineLatest(queue: .mainQueue(),
|
combineLatest(queue: .mainQueue(),
|
||||||
updatedPresentationData.signal,
|
updatedPresentationData.signal,
|
||||||
@ -1144,7 +1145,9 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
|
|
||||||
let animatedEmojiConfig = ChatHistoryAnimatedEmojiConfiguration.with(appConfiguration: appConfiguration)
|
let animatedEmojiConfig = ChatHistoryAnimatedEmojiConfiguration.with(appConfiguration: appConfiguration)
|
||||||
|
|
||||||
if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings || previousWallpaper != presentationData.chatWallpaper || previousAnimatedEmojiScale != animatedEmojiConfig.scale {
|
if !didSetPresentationData || previousTheme !== presentationData.theme || previousStrings !== presentationData.strings || previousWallpaper != presentationData.chatWallpaper || previousAnimatedEmojiScale != animatedEmojiConfig.scale {
|
||||||
|
didSetPresentationData = true
|
||||||
|
|
||||||
let themeData = ChatPresentationThemeData(theme: presentationData.theme, wallpaper: presentationData.chatWallpaper)
|
let themeData = ChatPresentationThemeData(theme: presentationData.theme, wallpaper: presentationData.chatWallpaper)
|
||||||
let chatPresentationData = ChatPresentationData(theme: themeData, fontSize: presentationData.chatFontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: true, largeEmoji: presentationData.largeEmoji, chatBubbleCorners: presentationData.chatBubbleCorners, animatedEmojiScale: animatedEmojiConfig.scale)
|
let chatPresentationData = ChatPresentationData(theme: themeData, fontSize: presentationData.chatFontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: true, largeEmoji: presentationData.largeEmoji, chatBubbleCorners: presentationData.chatBubbleCorners, animatedEmojiScale: animatedEmojiConfig.scale)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user