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