Fixes for iPad layout

This commit is contained in:
Thomas Ricouard 2023-01-31 08:16:36 +01:00
parent 1a351eaa7c
commit d9b166339d
6 changed files with 26 additions and 23 deletions

View file

@ -76,7 +76,6 @@ public struct AccountDetailView: View {
listsListView listsListView
} }
} }
.frame(maxWidth: .maxColumnWidth)
} }
.scrollContentBackground(.hidden) .scrollContentBackground(.hidden)
.background(theme.primaryBackgroundColor) .background(theme.primaryBackgroundColor)

View file

@ -67,7 +67,6 @@ public struct ConversationsListView: View {
} }
} }
} }
.frame(maxWidth: .maxColumnWidth)
} }
.padding(.top, .layoutPadding) .padding(.top, .layoutPadding)
} }

View file

@ -1,7 +1,7 @@
import Foundation import Foundation
public extension CGFloat { public extension CGFloat {
static let layoutPadding: CGFloat = 20 static var layoutPadding: CGFloat = 20
static let dividerPadding: CGFloat = 2 static let dividerPadding: CGFloat = 2
static let statusColumnsSpacing: CGFloat = 8 static let statusColumnsSpacing: CGFloat = 8
static let maxColumnWidth: CGFloat = 650 static let maxColumnWidth: CGFloat = 650

View file

@ -14,27 +14,31 @@ public struct ErrorView: View {
} }
public var body: some View { public var body: some View {
VStack { HStack {
Image(systemName: "exclamationmark.triangle.fill") Spacer()
.resizable() VStack {
.aspectRatio(contentMode: .fit) Image(systemName: "exclamationmark.triangle.fill")
.frame(maxHeight: 50) .resizable()
Text(title) .aspectRatio(contentMode: .fit)
.font(.scaledTitle) .frame(maxHeight: 50)
Text(title)
.font(.scaledTitle)
.padding(.top, 16)
Text(message)
.font(.scaledSubheadline)
.multilineTextAlignment(.center)
.foregroundColor(.gray)
Button {
onButtonPress()
} label: {
Text(buttonTitle)
}
.buttonStyle(.bordered)
.padding(.top, 16) .padding(.top, 16)
Text(message)
.font(.scaledSubheadline)
.multilineTextAlignment(.center)
.foregroundColor(.gray)
Button {
onButtonPress()
} label: {
Text(buttonTitle)
} }
.buttonStyle(.bordered) .padding(.top, 100)
.padding(.top, 16) .padding(.layoutPadding)
Spacer()
} }
.padding(.top, 100)
.padding(.layoutPadding)
} }
} }

View file

@ -42,6 +42,7 @@ public struct StatusesListView<Fetcher>: View where Fetcher: StatusesFetcher {
} }
} }
.listRowBackground(theme.primaryBackgroundColor) .listRowBackground(theme.primaryBackgroundColor)
.listRowSeparator(.hidden)
case let .display(statuses, nextPageState): case let .display(statuses, nextPageState):
ForEach(statuses, id: \.viewId) { status in ForEach(statuses, id: \.viewId) { status in

View file

@ -61,7 +61,7 @@ class TimelineViewModel: ObservableObject, StatusesFetcher {
pendingStatusesObserver?.pendingStatuses = [] pendingStatusesObserver?.pendingStatuses = []
statusesState = .loading statusesState = .loading
statuses = try await client.get(endpoint: timeline.endpoint(sinceId: nil, statuses = try await client.get(endpoint: timeline.endpoint(sinceId: nil,
maxId: nil, maxId: "109762933377057565",
minId: nil, minId: nil,
offset: statuses.count)) offset: statuses.count))
withAnimation { withAnimation {