Tryout: Fixed size optimizations

This commit is contained in:
Thomas Ricouard 2024-06-26 09:03:00 +02:00
parent 9887a81ef0
commit ff1d5733a0
2 changed files with 5 additions and 0 deletions

View file

@ -47,6 +47,7 @@ struct StatusRowHeaderView: View {
Group {
EmojiTextApp(viewModel.finalStatus.account.cachedDisplayName,
emojis: viewModel.finalStatus.account.emojis)
.fixedSize(horizontal: false, vertical: true)
.font(.scaledSubheadline)
.foregroundColor(theme.labelColor)
.emojiText.size(Font.scaledSubheadlineFont.emojiSize)
@ -59,6 +60,7 @@ struct StatusRowHeaderView: View {
if !redactionReasons.contains(.placeholder) {
accountBadgeView
.fixedSize(horizontal: false, vertical: true)
.font(.footnote)
}
}
@ -69,6 +71,7 @@ struct StatusRowHeaderView: View {
theme.avatarPosition == .top
{
Text("@\(theme.displayFullUsername ? viewModel.finalStatus.account.acct : viewModel.finalStatus.account.username)")
.fixedSize(horizontal: false, vertical: true)
.font(.scaledFootnote)
.foregroundStyle(.secondary)
.lineLimit(1)
@ -96,6 +99,7 @@ struct StatusRowHeaderView: View {
Text("") +
Text(viewModel.finalStatus.createdAt.relativeFormatted)
}
.fixedSize(horizontal: false, vertical: true)
.font(.scaledFootnote)
.foregroundStyle(.secondary)
.lineLimit(1)

View file

@ -19,6 +19,7 @@ struct StatusRowTextView: View {
emojis: viewModel.finalStatus.emojis,
language: viewModel.finalStatus.language,
lineLimit: viewModel.lineLimit)
.fixedSize(horizontal: false, vertical: true)
.font(isFocused ? .scaledBodyFocused : .scaledBody)
.lineSpacing(CGFloat(theme.lineSpacing))
.foregroundColor(viewModel.textDisabled ? .gray : theme.labelColor)