mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Various Fixes
This commit is contained in:
parent
4f527a2af7
commit
80bc5b6947
@ -1312,7 +1312,7 @@ final class PeerInfoHeaderSingleLineTextFieldNode: ASDisplayNode, PeerInfoHeader
|
||||
}
|
||||
|
||||
self.backgroundNode.frame = CGRect(origin: CGPoint(x: safeInset, y: 0.0), size: CGSize(width: max(1.0, width - safeInset * 2.0), height: height))
|
||||
self.textNode.frame = CGRect(origin: CGPoint(x: safeInset + 16.0, y: floor((height - 40.0) / 2.0)), size: CGSize(width: max(1.0, width - 16.0 * 2.0 - 32.0), height: 40.0))
|
||||
self.textNode.frame = CGRect(origin: CGPoint(x: safeInset + 16.0, y: floor((height - 40.0) / 2.0)), size: CGSize(width: max(1.0, width - safeInset * 2.0 - 16.0 * 2.0 - 38.0), height: 40.0))
|
||||
|
||||
let hasCorners = safeInset > 0.0 && (!hasPrevious || !hasNext)
|
||||
let hasTopCorners = hasCorners && !hasPrevious
|
||||
@ -2105,14 +2105,16 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
let buttonKeys: [PeerInfoHeaderButtonKey] = self.isSettings ? [] : peerInfoHeaderButtons(peer: peer, cachedData: cachedData, isOpenedFromChat: self.isOpenedFromChat, isExpanded: false, videoCallsEnabled: self.videoCallsEnabled, isSecretChat: isSecretChat, isContact: isContact)
|
||||
|
||||
var isVerified = false
|
||||
var isFake = false
|
||||
let smallTitleString: NSAttributedString
|
||||
let titleString: NSAttributedString
|
||||
let smallSubtitleString: NSAttributedString
|
||||
let subtitleString: NSAttributedString
|
||||
var panelSubtitleString: NSAttributedString?
|
||||
let usernameString: NSAttributedString
|
||||
if let peer = peer, peer.isVerified {
|
||||
isVerified = true
|
||||
if let peer = peer {
|
||||
isVerified = peer.isVerified
|
||||
isFake = peer.isFake || peer.isScam
|
||||
}
|
||||
|
||||
if let peer = peer {
|
||||
@ -2186,7 +2188,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
let textSideInset: CGFloat = 36.0
|
||||
let expandedAvatarHeight: CGFloat = expandedAvatarListSize.height
|
||||
|
||||
let titleConstrainedSize = CGSize(width: width - textSideInset * 2.0 - (isVerified ? 16.0 : 0.0), height: .greatestFiniteMagnitude)
|
||||
let titleConstrainedSize = CGSize(width: width - textSideInset * 2.0 - (isVerified || isFake ? 20.0 : 0.0), height: .greatestFiniteMagnitude)
|
||||
|
||||
let titleNodeLayout = self.titleNode.updateLayout(states: [
|
||||
TitleNodeStateRegular: MultiScaleTextState(attributedText: titleString, constrainedSize: titleConstrainedSize),
|
||||
|
@ -755,7 +755,20 @@ class PeerSelectionTextInputPanelNode: ChatInputPanelNode, TGCaptionPanelView, A
|
||||
self.textPlaceholderNode.isHidden = inputHasText
|
||||
}
|
||||
|
||||
self.oneLineNode.attributedText = self.textInputNode?.attributedText
|
||||
if let attributedText = self.textInputNode?.attributedText, let presentationInterfaceState = self.presentationInterfaceState {
|
||||
let range = (attributedText.string as NSString).range(of: "\n")
|
||||
if range.location != NSNotFound {
|
||||
let textColor = presentationInterfaceState.theme.chat.inputPanel.inputTextColor
|
||||
let textFont = Font.regular(max(minInputFontSize, presentationInterfaceState.fontSize.baseDisplaySize))
|
||||
let trimmedText = NSMutableAttributedString(attributedString: attributedText.attributedSubstring(from: NSMakeRange(0, range.location)))
|
||||
trimmedText.append(NSAttributedString(string: "\u{2026}", font: textFont, textColor: textColor))
|
||||
self.oneLineNode.attributedText = trimmedText
|
||||
} else {
|
||||
self.oneLineNode.attributedText = attributedText
|
||||
}
|
||||
} else {
|
||||
self.oneLineNode.attributedText = nil
|
||||
}
|
||||
|
||||
self.updateTextHeight(animated: animated)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user