Settings: fix appearance picker in dark mode

Use UIColor.secondarySystemGroupedBackground / tertiarySystemFill so
the segmented control adapts correctly to light and dark mode; darken
the shadow in dark mode so the selected pill is still visible.

Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
Robin Kutesa
2026-05-18 23:54:34 +03:00
parent 777024e9c7
commit d5b1f13434

View File

@@ -71,6 +71,8 @@ struct SettingsView: View {
// MARK: Appearance
@Environment(\.colorScheme) private var colorScheme
private var appearanceSection: some View {
VStack(alignment: .leading, spacing: 8) {
sectionLabel("APPEARANCE")
@@ -94,16 +96,23 @@ struct SettingsView: View {
.padding(.vertical, 9)
.background(
RoundedRectangle(cornerRadius: 8, style: .continuous)
.fill(selected ? AppTheme.surfaceRaised : Color.clear)
.shadow(color: selected ? .black.opacity(0.08) : .clear,
radius: 4, x: 0, y: 1)
.fill(selected
? Color(UIColor.secondarySystemGroupedBackground)
: Color.clear)
.shadow(
color: selected
? (colorScheme == .dark ? .black.opacity(0.35) : .black.opacity(0.08))
: .clear,
radius: colorScheme == .dark ? 2 : 4,
x: 0, y: colorScheme == .dark ? 1 : 1
)
)
}
.buttonStyle(PlainButtonStyle())
}
}
.padding(3)
.background(AppTheme.surfaceSunken)
.background(Color(UIColor.tertiarySystemFill))
.clipShape(RoundedRectangle(cornerRadius: 11, style: .continuous))
}
}