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:
@@ -71,6 +71,8 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
// MARK: — Appearance
|
// MARK: — Appearance
|
||||||
|
|
||||||
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
private var appearanceSection: some View {
|
private var appearanceSection: some View {
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
sectionLabel("APPEARANCE")
|
sectionLabel("APPEARANCE")
|
||||||
@@ -94,16 +96,23 @@ struct SettingsView: View {
|
|||||||
.padding(.vertical, 9)
|
.padding(.vertical, 9)
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 8, style: .continuous)
|
RoundedRectangle(cornerRadius: 8, style: .continuous)
|
||||||
.fill(selected ? AppTheme.surfaceRaised : Color.clear)
|
.fill(selected
|
||||||
.shadow(color: selected ? .black.opacity(0.08) : .clear,
|
? Color(UIColor.secondarySystemGroupedBackground)
|
||||||
radius: 4, x: 0, y: 1)
|
: 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())
|
.buttonStyle(PlainButtonStyle())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(3)
|
.padding(3)
|
||||||
.background(AppTheme.surfaceSunken)
|
.background(Color(UIColor.tertiarySystemFill))
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 11, style: .continuous))
|
.clipShape(RoundedRectangle(cornerRadius: 11, style: .continuous))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user