Various Improvements

This commit is contained in:
Ilya Laktyushin
2021-02-10 00:38:38 +04:00
parent 249b684e64
commit b9e68236d0
37 changed files with 5333 additions and 4729 deletions

View File

@@ -26,7 +26,7 @@ enum ChatTitleContent {
case peer(peerView: PeerView, onlineMemberCount: Int32?, isScheduledMessages: Bool)
case replyThread(type: ReplyThreadType, count: Int)
case custom(String, Bool)
case custom(String, String?, Bool)
}
private enum ChatTitleIcon {
@@ -214,8 +214,9 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
}
isEnabled = false
case let .custom(text, enabled):
segments = [.text(0, NSAttributedString(string: text, font: Font.medium(17.0), textColor: titleTheme.rootController.navigationBar.primaryTextColor))]
case let .custom(text, _, enabled):
let font = Font.with(size: 17.0, design: .regular, weight: .medium, traits: .monospacedNumbers)
segments = [.text(0, NSAttributedString(string: text, font: font, textColor: titleTheme.rootController.navigationBar.primaryTextColor))]
isEnabled = enabled
}
@@ -472,6 +473,9 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
}
}
}
case let .custom(_, subtitle?, _):
let string = NSAttributedString(string: subtitle, font: Font.regular(13.0), textColor: titleTheme.rootController.navigationBar.secondaryTextColor)
state = .info(string, .generic)
default:
break
}