Bigger font for focused status

This commit is contained in:
Thomas Ricouard 2023-03-09 20:27:03 +01:00
parent 93d9ded447
commit b9793057e0
3 changed files with 12 additions and 4 deletions

View file

@ -48,6 +48,14 @@ public extension Font {
static var scaledHeadlineFont: UIFont {
customUIFont(size: userScaledFontSize(baseSize: headline))
}
static var scaledBodyFocused: Font {
customFont(size: userScaledFontSize(baseSize: body + 2), relativeTo: .body)
}
static var scaledBodyFocusedFont: UIFont {
customUIFont(size: userScaledFontSize(baseSize: body + 2))
}
static var scaledBody: Font {
customFont(size: userScaledFontSize(baseSize: body), relativeTo: .body)

View file

@ -140,7 +140,7 @@ public struct StatusDetailView: View {
StatusRowView(viewModel: { .init(status: status,
client: client,
routerPath: routerPath,
isFocused: !viewModel.isLoadingContext) })
isFocused: true) })
.overlay {
GeometryReader { reader in
VStack {}

View file

@ -15,10 +15,10 @@ struct StatusRowTextView: View {
emojis: viewModel.finalStatus.emojis,
language: viewModel.finalStatus.language,
lineLimit: viewModel.lineLimit)
.font(.scaledBody)
.font(viewModel.isFocused ? .scaledBodyFocused : .scaledBody)
.foregroundColor(viewModel.textDisabled ? .gray : theme.labelColor)
.emojiSize(Font.scaledBodyFont.emojiSize)
.emojiBaselineOffset(Font.scaledBodyFont.emojiBaselineOffset)
.emojiSize(viewModel.isFocused ? Font.scaledBodyFocusedFont.emojiSize : Font.scaledBodyFont.emojiSize)
.emojiBaselineOffset(viewModel.isFocused ? Font.scaledBodyFocusedFont.emojiBaselineOffset : Font.scaledBodyFont.emojiBaselineOffset)
.environment(\.openURL, OpenURLAction { url in
viewModel.routerPath.handleStatus(status: viewModel.finalStatus, url: url)
})