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