Name color improvements

This commit is contained in:
Ilya Laktyushin
2023-10-25 13:33:51 +04:00
parent 08b76943c2
commit 7cb8f9739b
8 changed files with 85 additions and 27 deletions

View File

@@ -1045,11 +1045,22 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
var baseFontSize: CGFloat = 17.0
var keyboardAppearance: UIKeyboardAppearance = UIKeyboardAppearance.default
if let presentationInterfaceState = self.presentationInterfaceState {
var lineStyle: ChatInputTextView.Theme.Quote.LineStyle = .solid
if let accountPeerColor = presentationInterfaceState.accountPeerColor {
switch accountPeerColor.style {
case .solid:
lineStyle = .solid
case .doubleDashed:
lineStyle = .doubleDashed
case .tripleDashed:
lineStyle = .tripleDashed
}
}
textInputNode.textView.theme = ChatInputTextView.Theme(
quote: ChatInputTextView.Theme.Quote(
background: presentationInterfaceState.theme.list.itemAccentColor.withMultipliedAlpha(presentationInterfaceState.theme.overallDarkAppearance ? 0.2 : 0.1),
foreground: presentationInterfaceState.theme.list.itemAccentColor,
isDashed: presentationInterfaceState.accountPeerColor?.isDashed == true
lineStyle: lineStyle
)
)
@@ -1628,11 +1639,22 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
}
if let textInputNode = self.textInputNode {
var lineStyle: ChatInputTextView.Theme.Quote.LineStyle = .solid
if let accountPeerColor = interfaceState.accountPeerColor {
switch accountPeerColor.style {
case .solid:
lineStyle = .solid
case .doubleDashed:
lineStyle = .doubleDashed
case .tripleDashed:
lineStyle = .tripleDashed
}
}
textInputNode.textView.theme = ChatInputTextView.Theme(
quote: ChatInputTextView.Theme.Quote(
background: interfaceState.theme.list.itemAccentColor.withMultipliedAlpha(interfaceState.theme.overallDarkAppearance ? 0.2 : 0.1),
foreground: interfaceState.theme.list.itemAccentColor,
isDashed: interfaceState.accountPeerColor?.isDashed == true
lineStyle: lineStyle
)
)
}