mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
UI fixes
This commit is contained in:
parent
a8dcdc3a74
commit
de06be0d9a
@ -198,7 +198,7 @@ public class ItemListMultilineTextItemNode: ListViewItemNode {
|
|||||||
let entities = generateTextEntities(item.text, enabledTypes: item.enabledEntityTypes)
|
let entities = generateTextEntities(item.text, enabledTypes: item.enabledEntityTypes)
|
||||||
let string = stringWithAppliedEntities(item.text, entities: entities, baseColor: textColor, linkColor: item.theme.list.itemAccentColor, baseFont: baseFont, linkFont: linkFont, boldFont: boldFont, italicFont: italicFont, boldItalicFont: boldItalicFont, fixedFont: titleFixedFont, blockQuoteFont: titleFont)
|
let string = stringWithAppliedEntities(item.text, entities: entities, baseColor: textColor, linkColor: item.theme.list.itemAccentColor, baseFont: baseFont, linkFont: linkFont, boldFont: boldFont, italicFont: italicFont, boldItalicFont: boldItalicFont, fixedFont: titleFixedFont, blockQuoteFont: titleFont)
|
||||||
|
|
||||||
let (titleLayout, titleApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: string, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - params.leftInset - params.rightInset - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets()))
|
let (titleLayout, titleApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: string, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset * 2.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets()))
|
||||||
|
|
||||||
let contentSize: CGSize
|
let contentSize: CGSize
|
||||||
let insets: UIEdgeInsets
|
let insets: UIEdgeInsets
|
||||||
|
@ -6,6 +6,7 @@ import Display
|
|||||||
|
|
||||||
public enum QrCodeIcon {
|
public enum QrCodeIcon {
|
||||||
case none
|
case none
|
||||||
|
case cutout
|
||||||
case proxy
|
case proxy
|
||||||
case custom(UIImage?)
|
case custom(UIImage?)
|
||||||
}
|
}
|
||||||
@ -75,7 +76,7 @@ public func qrCode(string: String, color: UIColor, backgroundColor: UIColor? = n
|
|||||||
let clipSide = 81.0 * fittedRect.width / 267.0 * codeScale
|
let clipSide = 81.0 * fittedRect.width / 267.0 * codeScale
|
||||||
let clipRect = CGRect(x: fittedRect.midX - clipSide / 2.0, y: fittedRect.midY - clipSide / 2.0, width: clipSide, height: clipSide)
|
let clipRect = CGRect(x: fittedRect.midX - clipSide / 2.0, y: fittedRect.midY - clipSide / 2.0, width: clipSide, height: clipSide)
|
||||||
switch icon {
|
switch icon {
|
||||||
case .proxy, .custom:
|
case .cutout, .proxy, .custom:
|
||||||
c.fill(clipRect)
|
c.fill(clipRect)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
@ -234,10 +234,10 @@ private enum WalletReceiveScreenEntry: ItemListNodeEntry {
|
|||||||
case let .commentHeader(theme, text):
|
case let .commentHeader(theme, text):
|
||||||
return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section)
|
return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section)
|
||||||
case let .comment(theme, placeholder, value):
|
case let .comment(theme, placeholder, value):
|
||||||
return ItemListMultilineInputItem(theme: theme, text: value, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 128, display: true), sectionId: self.section, style: .blocks, returnKeyType: .done, textUpdated: { text in
|
return ItemListMultilineInputItem(theme: theme, text: value, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 124, display: true), sectionId: self.section, style: .blocks, returnKeyType: .done, textUpdated: { text in
|
||||||
arguments.updateText(WalletReceiveScreenEntryTag.comment, text)
|
arguments.updateText(WalletReceiveScreenEntryTag.comment, text)
|
||||||
}, shouldUpdateText: { text in
|
}, shouldUpdateText: { text in
|
||||||
return text.count <= 128
|
return text.count <= 124
|
||||||
}, updatedFocus: { focus in
|
}, updatedFocus: { focus in
|
||||||
arguments.updateState { state in
|
arguments.updateState { state in
|
||||||
var state = state
|
var state = state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user