mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-14 13:31:05 +00:00
Widget: More UI refinements
This commit is contained in:
parent
a2afd4f58f
commit
7aebe530dd
1 changed files with 5 additions and 11 deletions
|
@ -49,14 +49,10 @@ struct LatestPostsWidgetProvider: AppIntentTimelineProvider {
|
|||
if statuses.count >= 1 {
|
||||
statuses = statuses.prefix(upTo: 1).map{ $0 }
|
||||
}
|
||||
case .systemLarge:
|
||||
case .systemLarge, .systemExtraLarge:
|
||||
if statuses.count >= 4 {
|
||||
statuses = statuses.prefix(upTo: 4).map{ $0 }
|
||||
}
|
||||
case .systemExtraLarge:
|
||||
if statuses.count >= 6 {
|
||||
statuses = statuses.prefix(upTo: 6).map{ $0 }
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
@ -119,12 +115,9 @@ struct LatestPostsWidgetView : View {
|
|||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
headerView
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
ForEach(entry.statuses) { status in
|
||||
VStack(spacing: 4) {
|
||||
makeStatusView(status)
|
||||
if entry.statuses.last?.id != status.id {
|
||||
Divider()
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
|
@ -153,13 +146,14 @@ struct LatestPostsWidgetView : View {
|
|||
.font(.body)
|
||||
.lineLimit(contentLineLimit)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.padding(.leading, 20)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private func makeStatusHeaderView(_ status: Status) -> some View {
|
||||
HStack(spacing: 4) {
|
||||
HStack(alignment: .center, spacing: 4) {
|
||||
if let image = entry.images[status.account.avatar] {
|
||||
Image(uiImage: image)
|
||||
.resizable()
|
||||
|
|
Loading…
Reference in a new issue