Widget: Improve text size

This commit is contained in:
Thomas Ricouard 2024-05-05 20:03:12 +02:00
parent 7328c00006
commit ee6f003073
2 changed files with 7 additions and 9 deletions

View file

@ -21,7 +21,7 @@ struct PostsWidgetView : View {
var contentLineLimit: Int {
switch family {
case .systemSmall, .systemMedium:
return 4
return 5
default:
return 2
}
@ -29,10 +29,8 @@ struct PostsWidgetView : View {
var body: some View {
VStack(alignment: .leading, spacing: 8) {
headerView
VStack(alignment: .leading, spacing: 16) {
ForEach(entry.statuses) { status in
makeStatusView(status)
}
ForEach(entry.statuses) { status in
makeStatusView(status)
}
Spacer()
}
@ -57,7 +55,7 @@ struct PostsWidgetView : View {
VStack(alignment: .leading, spacing: 2) {
makeStatusHeaderView(status)
Text(status.content.asSafeMarkdownAttributedString)
.font(.body)
.font(.footnote)
.lineLimit(contentLineLimit)
.fixedSize(horizontal: false, vertical: true)
.padding(.leading, 20)
@ -89,7 +87,7 @@ struct PostsWidgetView : View {
}
Spacer()
}
.font(.subheadline)
.font(.footnote)
.fontWeight(.semibold)
.lineLimit(1)
}

View file

@ -23,8 +23,8 @@ func loadStatuses(for timeline: TimelineFilter,
statuses = statuses.prefix(upTo: 1).map{ $0 }
}
case .systemLarge, .systemExtraLarge:
if statuses.count >= 4 {
statuses = statuses.prefix(upTo: 4).map{ $0 }
if statuses.count >= 5 {
statuses = statuses.prefix(upTo: 5).map{ $0 }
}
default:
break