mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fixes #2083 - Expose options for overriding the system appearance in the advanced settings menu
This commit is contained in:
committed by
Stefan Ceriu
parent
4b3a373782
commit
eb6f7e0409
+1
@@ -42,6 +42,7 @@ protocol AdvancedSettingsProtocol: AnyObject {
|
||||
var timelineStyle: TimelineStyle { get set }
|
||||
var viewSourceEnabled: Bool { get set }
|
||||
var richTextEditorEnabled: Bool { get set }
|
||||
var appAppearance: AppAppearance { get set }
|
||||
}
|
||||
|
||||
extension AppSettings: AdvancedSettingsProtocol { }
|
||||
|
||||
+17
@@ -23,6 +23,10 @@ struct AdvancedSettingsScreen: View {
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
ListRow(label: .plain(title: L10n.commonAppearance),
|
||||
kind: .picker(selection: $context.appAppearance,
|
||||
items: AppAppearance.allCases.map { (title: $0.name, tag: $0) }))
|
||||
|
||||
ListRow(label: .plain(title: L10n.commonMessageLayout),
|
||||
kind: .picker(selection: $context.timelineStyle,
|
||||
items: TimelineStyle.allCases.map { (title: $0.name, tag: $0) }))
|
||||
@@ -51,6 +55,19 @@ private extension TimelineStyle {
|
||||
}
|
||||
}
|
||||
|
||||
private extension AppAppearance {
|
||||
var name: String {
|
||||
switch self {
|
||||
case .system:
|
||||
return L10n.commonSystem
|
||||
case .light:
|
||||
return L10n.commonLight
|
||||
case .dark:
|
||||
return L10n.commonDark
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct AdvancedSettingsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
Reference in New Issue
Block a user