Make max width more consistent on iPad fix #236

This commit is contained in:
Thomas Ricouard 2023-01-29 08:14:08 +01:00
parent 33a7bd57ff
commit 6ea2d9cb78
4 changed files with 99 additions and 90 deletions

View file

@ -32,6 +32,8 @@ public struct AppAccountView: View {
HStack {
if let account = viewModel.account {
AvatarView(url: account.avatar)
} else {
ProgressView()
}
}
}
@ -47,6 +49,8 @@ public struct AppAccountView: View {
.offset(x: 5, y: -5)
}
}
} else {
ProgressView()
}
VStack(alignment: .leading) {
if let account = viewModel.account {

View file

@ -25,6 +25,7 @@ public struct ConversationsListView: View {
public var body: some View {
ScrollView {
LazyVStack {
Group {
if !conversations.isEmpty || viewModel.isLoadingFirstPage {
ForEach(conversations) { conversation in
if viewModel.isLoadingFirstPage {
@ -67,6 +68,8 @@ public struct ConversationsListView: View {
}
}
}
.frame(maxWidth: .maxColumnWidth)
}
.padding(.top, .layoutPadding)
}
.scrollContentBackground(.hidden)

View file

@ -23,8 +23,7 @@ extension Color: RawRepresentable {
let red = Double((rawValue & 0xFF0000) >> 16) / 0xFF
let green = Double((rawValue & 0x00FF00) >> 8) / 0xFF
let blue = Double(rawValue & 0x0000FF) / 0xFF
let opacity = Double((rawValue & 0xFF000000) >> 24) / 0xFF
self = Color(red: red, green: green, blue: blue, opacity: opacity == 0 ? 1 : 0)
self = Color(red: red, green: green, blue: blue)
}
public var rawValue: Int {
@ -34,8 +33,7 @@ extension Color: RawRepresentable {
let red = Int(coreImageColor.red * 255 + 0.5)
let green = Int(coreImageColor.green * 255 + 0.5)
let blue = Int(coreImageColor.blue * 255 + 0.5)
let alpha = Int(coreImageColor.alpha * 255 + 0.5)
return (alpha << 24) | (red << 16) | (green << 8) | blue
return (red << 16) | (green << 8) | blue
}
private var coreImageColor: CIColor? {

View file

@ -25,8 +25,10 @@ public struct StatusDetailView: View {
public var body: some View {
ScrollViewReader { proxy in
ZStack {
ScrollView {
LazyVStack {
Group {
switch viewModel.state {
case .loading:
ForEach(Status.placeholders()) { status in
@ -72,10 +74,12 @@ public struct StatusDetailView: View {
}
}
}
.frame(maxWidth: .maxColumnWidth)
}
.padding(.top, .layoutPadding)
}
.scrollContentBackground(.hidden)
.background(theme.primaryBackgroundColor)
}
.task {
guard !isLoaded else { return }
isLoaded = true