Visual improvements

This commit is contained in:
Ali 2023-10-26 01:41:01 +04:00
parent 5957555813
commit c0da8fb404
2 changed files with 40 additions and 4 deletions

View File

@ -33,7 +33,7 @@ public final class ContextMenuContainerNode: ASDisplayNode {
self.containerNode.view.addSubview(effectView) self.containerNode.view.addSubview(effectView)
self.effectView = effectView self.effectView = effectView
} else { } else {
self.containerNode.backgroundColor = isDark ? UIColor(rgb: 0x8c8e8e) : UIColor(rgb: 0xF8F8F6) self.containerNode.backgroundColor = isDark ? UIColor(rgb: 0x2f2f2f) : UIColor(rgb: 0xF8F8F6)
} }
self.layer.shadowColor = UIColor.black.cgColor self.layer.shadowColor = UIColor.black.cgColor

View File

@ -1046,7 +1046,30 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
var keyboardAppearance: UIKeyboardAppearance = UIKeyboardAppearance.default var keyboardAppearance: UIKeyboardAppearance = UIKeyboardAppearance.default
if let presentationInterfaceState = self.presentationInterfaceState { if let presentationInterfaceState = self.presentationInterfaceState {
var lineStyle: ChatInputTextView.Theme.Quote.LineStyle = .solid var lineStyle: ChatInputTextView.Theme.Quote.LineStyle = .solid
if let accountPeerColor = presentationInterfaceState.accountPeerColor { let authorNameColor: UIColor
let dashSecondaryColor: UIColor?
let dashTertiaryColor: UIColor?
if let context = self.context, let peer = presentationInterfaceState.renderedPeer?.peer as? TelegramChannel, case .broadcast = peer.info, let nameColor = peer.nameColor {
let _ = nameColor
lineStyle = .solid
authorNameColor = presentationInterfaceState.theme.list.itemAccentColor
dashSecondaryColor = nil
dashTertiaryColor = nil
/*let colors = context.peerNameColors.get(nameColor)
authorNameColor = colors.main
dashSecondaryColor = colors.secondary
dashTertiaryColor = colors.tertiary
if dashSecondaryColor != nil {
lineStyle = .doubleDashed
} else {
lineStyle = .solid
}*/
} else if let accountPeerColor = presentationInterfaceState.accountPeerColor {
switch accountPeerColor.style { switch accountPeerColor.style {
case .solid: case .solid:
lineStyle = .solid lineStyle = .solid
@ -1055,11 +1078,24 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
case .tripleDashed: case .tripleDashed:
lineStyle = .tripleDashed lineStyle = .tripleDashed
} }
authorNameColor = presentationInterfaceState.theme.list.itemAccentColor
dashSecondaryColor = .clear
dashTertiaryColor = nil
} else {
lineStyle = .solid
authorNameColor = presentationInterfaceState.theme.list.itemAccentColor
dashSecondaryColor = nil
dashTertiaryColor = nil
} }
let _ = dashSecondaryColor
let _ = dashTertiaryColor
textInputNode.textView.theme = ChatInputTextView.Theme( textInputNode.textView.theme = ChatInputTextView.Theme(
quote: ChatInputTextView.Theme.Quote( quote: ChatInputTextView.Theme.Quote(
background: presentationInterfaceState.theme.list.itemAccentColor.withMultipliedAlpha(presentationInterfaceState.theme.overallDarkAppearance ? 0.2 : 0.1), background: authorNameColor.withMultipliedAlpha(presentationInterfaceState.theme.overallDarkAppearance ? 0.2 : 0.1),
foreground: presentationInterfaceState.theme.list.itemAccentColor, foreground: authorNameColor,
lineStyle: lineStyle lineStyle: lineStyle
) )
) )