diff --git a/SelfieCam/Features/Camera/Views/ScreenshotCameraPlaceholder.swift b/SelfieCam/Features/Camera/Views/ScreenshotCameraPlaceholder.swift index b0d2c2e..1b72c8d 100644 --- a/SelfieCam/Features/Camera/Views/ScreenshotCameraPlaceholder.swift +++ b/SelfieCam/Features/Camera/Views/ScreenshotCameraPlaceholder.swift @@ -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 = .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) } }