Version in about footer

This commit is contained in:
Lumaa 2024-01-06 03:38:54 +01:00
parent c8179e0a1f
commit c7003aa4b0

View File

@ -7,26 +7,28 @@ struct AboutView: View {
var body: some View { var body: some View {
List { List {
NavigationLink { Section(footer: Text("about.version-\(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Inconnue")")) {
aboutApp NavigationLink {
} label: { aboutApp
Text("about.app") } label: {
.tint(Color.blue) Text("about.app")
} .tint(Color.blue)
.listRowThreaded()
Toggle("setting.experimental.activate", isOn: $userPreferences.showExperimental)
.listRowThreaded()
.tint(Color(uiColor: UIColor.label))
.onAppear {
do {
let oldPreferences = try UserPreferences.loadAsCurrent() ?? UserPreferences.defaultPreferences
userPreferences.showExperimental = oldPreferences.showExperimental
} catch {
print(error)
}
} }
.listRowThreaded()
Toggle("setting.experimental.activate", isOn: $userPreferences.showExperimental)
.listRowThreaded()
.tint(Color(uiColor: UIColor.label))
.onAppear {
do {
let oldPreferences = try UserPreferences.loadAsCurrent() ?? UserPreferences.defaultPreferences
userPreferences.showExperimental = oldPreferences.showExperimental
} catch {
print(error)
}
}
}
} }
.listThreaded(tint: Color.blue) .listThreaded(tint: Color.blue)
.navigationTitle("about") .navigationTitle("about")