diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-05-08 20:53:10 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-05-08 20:53:10 -0700 |
| commit | 75b40db9adac93dde9df3ff76bb172c76e3d3a55 (patch) | |
| tree | 1e9088849d7a32ac0f42c933e2b6ab50350ed196 /Hotline/macOS/AboutView.swift | |
| parent | 01d32910bc1e75533c2f473011296fee6febbadb (diff) | |
Fix about box layout on open. Remove about box from window menu, add expand button to server agreement, add email address highlighting, style server messages, unread badge on admins are red now, play server message sound, some code cleanup.
Diffstat (limited to 'Hotline/macOS/AboutView.swift')
| -rw-r--r-- | Hotline/macOS/AboutView.swift | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/Hotline/macOS/AboutView.swift b/Hotline/macOS/AboutView.swift index 7bd1c54..1cf7dc2 100644 --- a/Hotline/macOS/AboutView.swift +++ b/Hotline/macOS/AboutView.swift @@ -77,11 +77,12 @@ struct AboutView: View { } } .frame(height: 40) -// .padding(.top, 4) Spacer() } - .frame(width: 270) + .frame(width: 250) + + Spacer() ScrollView(.vertical) { VStack(alignment: .leading, spacing: 16) { @@ -118,17 +119,38 @@ struct AboutView: View { Link(destination: contributor.webURL) { HStack { if let pictureURL = contributor.pictureURL { - AsyncImage(url: pictureURL) { img in - img - .interpolation(.high) - .resizable() - .scaledToFit() - .background(.white) - } placeholder: { - Color.white.opacity(0.2) + AsyncImage(url: pictureURL) { phase in + if let image = phase.image { + image + .interpolation(.high) + .resizable() + .scaledToFit() + .background(.white) + .frame(width: 32, height: 32) + } else if phase.error != nil { + Color.clear + .frame(width: 32, height: 32) + } else { + Color.white + .opacity(0.2) + .frame(width: 32, height: 32) + } } .frame(width: 32, height: 32) .clipShape(Circle()) + +// AsyncImage(url: pictureURL) { img in +// img +// .interpolation(.high) +// .resizable() +// .scaledToFit() +// .background(.white) +// } placeholder: { +// Color.white.opacity(0.2) +// .frame(width: 32, height: 32) +// } +// .frame(width: 32, height: 32) +// .clipShape(Circle()) } VStack(alignment: .leading, spacing: 2) { @@ -143,16 +165,12 @@ struct AboutView: View { .font(.system(size: 11)) .foregroundStyle(.white.opacity(0.4)) } - - Spacer() } } } } } - .ignoresSafeArea() .scrollClipDisabled() - .padding(.leading, 24) } .frame(width: 570, height: 330) .background( @@ -162,7 +180,7 @@ struct AboutView: View { Spacer() } .frame(height: 330 + 100) - .offset(x: 270) + .offset(x: 250) } ) .background(Color.hotlineRed) @@ -191,7 +209,9 @@ struct AboutView: View { } } - contributors = newContributors + withAnimation { + contributors = newContributors + } } func checkForUpdate() async { |