Add font size support

This commit is contained in:
Isaac
2024-04-26 19:16:15 +04:00
parent dfc5d8f59c
commit 56b32159ac
2 changed files with 9 additions and 345 deletions

View File

@@ -37,6 +37,7 @@ final class AdminUserActionsPeerComponent: Component {
let context: AccountContext
let theme: PresentationTheme
let strings: PresentationStrings
let baseFontSize: CGFloat
let sideInset: CGFloat
let title: String
let peer: EnginePeer?
@@ -47,6 +48,7 @@ final class AdminUserActionsPeerComponent: Component {
context: AccountContext,
theme: PresentationTheme,
strings: PresentationStrings,
baseFontSize: CGFloat,
sideInset: CGFloat,
title: String,
peer: EnginePeer?,
@@ -56,6 +58,7 @@ final class AdminUserActionsPeerComponent: Component {
self.context = context
self.theme = theme
self.strings = strings
self.baseFontSize = baseFontSize
self.sideInset = sideInset
self.title = title
self.peer = peer
@@ -73,6 +76,9 @@ final class AdminUserActionsPeerComponent: Component {
if lhs.strings !== rhs.strings {
return false
}
if lhs.baseFontSize != rhs.baseFontSize {
return false
}
if lhs.sideInset != rhs.sideInset {
return false
}
@@ -205,9 +211,9 @@ final class AdminUserActionsPeerComponent: Component {
} else {
clipStyle = .round
}
if peer.id == component.context.account.peerId {
/*if peer.id == component.context.account.peerId {
self.avatarNode.setPeer(context: component.context, theme: component.theme, peer: peer, overrideImage: .savedMessagesIcon, clipStyle: clipStyle, displayDimensions: CGSize(width: avatarSize, height: avatarSize))
} else {
} else*/ do {
self.avatarNode.setPeer(context: component.context, theme: component.theme, peer: peer, clipStyle: clipStyle, displayDimensions: CGSize(width: avatarSize, height: avatarSize))
}
}
@@ -224,7 +230,7 @@ final class AdminUserActionsPeerComponent: Component {
let titleSize = self.title.update(
transition: .immediate,
component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: component.title, font: Font.semibold(17.0), textColor: component.theme.list.itemPrimaryTextColor))
text: .plain(NSAttributedString(string: component.title, font: Font.semibold(component.baseFontSize), textColor: component.theme.list.itemPrimaryTextColor))
)),
environment: {},
containerSize: CGSize(width: maxTextSize, height: 100.0)