Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2026-02-09 22:15:22 -06:00
parent 9a0a48d889
commit be3131ad7c

View File

@ -2,15 +2,18 @@ import SwiftUI
import Bedrock
struct ScreenshotCameraPlaceholder: View {
@Binding var showSettings: Bool
let ringWidth: CGFloat
let ringColor: Color
let ringOpacity: Double
init(
showSettings: Binding<Bool> = .constant(false),
ringWidth: CGFloat = 70,
ringColor: Color = .white,
ringOpacity: Double = 0.7
) {
self._showSettings = showSettings
self.ringWidth = ringWidth
self.ringColor = ringColor
self.ringOpacity = ringOpacity
@ -61,7 +64,8 @@ struct ScreenshotCameraPlaceholder: View {
Spacer()
PlaceholderTopButton(
systemImage: "gearshape.fill",
accessibilityLabel: "Settings"
accessibilityLabel: "Settings",
action: { showSettings = true }
)
}
.padding(.top, ringWidth + Design.Spacing.medium)
@ -82,25 +86,33 @@ struct ScreenshotCameraPlaceholder: View {
}
.ignoresSafeArea()
.accessibilityIdentifier("screenshot-green-screen")
.overlay(alignment: .topLeading) {
Color.clear
.frame(width: 1, height: 1)
.accessibilityIdentifier("screenshot-green-screen")
}
}
}
private struct PlaceholderTopButton: View {
let systemImage: String
let accessibilityLabel: String
let action: () -> Void
var body: some View {
Image(systemName: systemImage)
.font(.title3)
.foregroundStyle(.white)
.frame(width: 44, height: 44)
.background(Color.black.opacity(Design.Opacity.medium), in: Circle())
.overlay {
Circle()
.strokeBorder(Color.white.opacity(Design.Opacity.subtle), lineWidth: Design.LineWidth.thin)
}
.shadow(radius: Design.Shadow.radiusSmall)
.accessibilityLabel(accessibilityLabel)
Button(action: action) {
Image(systemName: systemImage)
.font(.title3)
.foregroundStyle(.white)
.frame(width: 44, height: 44)
.background(Color.black.opacity(Design.Opacity.medium), in: Circle())
.overlay {
Circle()
.strokeBorder(Color.white.opacity(Design.Opacity.subtle), lineWidth: Design.LineWidth.thin)
}
.shadow(radius: Design.Shadow.radiusSmall)
}
.accessibilityLabel(accessibilityLabel)
}
}