Refactor camera/flash/HDR pickers to use SettingsSegmentedPicker
This commit is contained in:
parent
83b03f269f
commit
d3dac86de4
@ -252,52 +252,32 @@ struct SettingsView: View {
|
||||
// MARK: - Flash Mode Picker
|
||||
|
||||
private var flashModePicker: some View {
|
||||
VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) {
|
||||
Text(String(localized: "Flash Mode"))
|
||||
.font(.system(size: Design.BaseFontSize.medium, weight: .medium))
|
||||
.foregroundStyle(.white)
|
||||
|
||||
Text(String(localized: "Controls automatic flash behavior for photos"))
|
||||
.font(.system(size: Design.BaseFontSize.caption))
|
||||
.foregroundStyle(.white.opacity(Design.Opacity.medium))
|
||||
|
||||
SegmentedPicker(
|
||||
title: "",
|
||||
SettingsSegmentedPicker(
|
||||
title: String(localized: "Flash Mode"),
|
||||
subtitle: String(localized: "Controls automatic flash behavior for photos"),
|
||||
options: CameraFlashMode.allCases.map { ($0.displayName, $0) },
|
||||
selection: $viewModel.flashMode,
|
||||
accentColor: AppAccent.primary
|
||||
)
|
||||
.accessibilityLabel(String(localized: "Select flash mode"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - HDR Mode Picker (Premium)
|
||||
|
||||
private var hdrModePicker: some View {
|
||||
VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) {
|
||||
HStack(spacing: Design.Spacing.xSmall) {
|
||||
Text(String(localized: "HDR Mode"))
|
||||
.font(.system(size: Design.BaseFontSize.medium, weight: .medium))
|
||||
.foregroundStyle(.white)
|
||||
|
||||
Image(systemName: "crown.fill")
|
||||
.font(.system(size: Design.BaseFontSize.small))
|
||||
.foregroundStyle(AppStatus.warning)
|
||||
}
|
||||
|
||||
Text(String(localized: "High Dynamic Range for better lighting in photos"))
|
||||
.font(.system(size: Design.BaseFontSize.caption))
|
||||
.foregroundStyle(.white.opacity(Design.Opacity.medium))
|
||||
|
||||
SegmentedPicker(
|
||||
title: "",
|
||||
SettingsSegmentedPicker(
|
||||
title: String(localized: "HDR Mode"),
|
||||
subtitle: String(localized: "High Dynamic Range for better lighting in photos"),
|
||||
options: CameraHDRMode.allCases.map { ($0.displayName, $0) },
|
||||
selection: $viewModel.hdrMode,
|
||||
accentColor: AppAccent.primary
|
||||
accentColor: AppAccent.primary,
|
||||
titleAccessory: {
|
||||
Image(systemName: "crown.fill")
|
||||
.foregroundStyle(AppStatus.warning)
|
||||
}
|
||||
)
|
||||
.disabled(!isPremiumUnlocked)
|
||||
.accessibilityLabel(String(localized: "Select HDR mode"))
|
||||
}
|
||||
.onTapGesture {
|
||||
if !isPremiumUnlocked {
|
||||
showPaywallAfterDismiss()
|
||||
@ -365,17 +345,9 @@ struct SettingsView: View {
|
||||
// MARK: - Camera Position Picker
|
||||
|
||||
private var cameraPositionPicker: some View {
|
||||
VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) {
|
||||
Text(String(localized: "Camera"))
|
||||
.font(.system(size: Design.BaseFontSize.medium, weight: .medium))
|
||||
.foregroundStyle(.white)
|
||||
|
||||
Text(String(localized: "Choose between front and back camera lenses"))
|
||||
.font(.system(size: Design.BaseFontSize.caption))
|
||||
.foregroundStyle(.white.opacity(Design.Opacity.medium))
|
||||
|
||||
SegmentedPicker(
|
||||
title: "",
|
||||
SettingsSegmentedPicker(
|
||||
title: String(localized: "Camera"),
|
||||
subtitle: String(localized: "Choose between front and back camera lenses"),
|
||||
options: [
|
||||
(String(localized: "Front"), CameraPosition.front),
|
||||
(String(localized: "Back"), CameraPosition.back)
|
||||
@ -385,7 +357,6 @@ struct SettingsView: View {
|
||||
)
|
||||
.accessibilityLabel(String(localized: "Select camera position"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Ring Light Brightness Slider
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user