mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Refactor PreferenceView to punt Form/Section up to SettingsView
This commit is contained in:
parent
a7b918c14b
commit
8f9d1746fb
@ -12,15 +12,12 @@ struct PreferencesView: View {
|
||||
}
|
||||
.pickerStyle(SegmentedPickerStyle())
|
||||
#elseif os(macOS)
|
||||
Form {
|
||||
Picker(selection: $appearance, label: Text("Appearance")) {
|
||||
Text("System").tag(0)
|
||||
Text("Light Mode").tag(1)
|
||||
Text("Dark Mode").tag(2)
|
||||
}
|
||||
.frame(width: 200, height: 100, alignment: .topLeading)
|
||||
.pickerStyle(RadioGroupPickerStyle())
|
||||
Picker(selection: $appearance, label: EmptyView()) {
|
||||
Text("System").tag(0)
|
||||
Text("Light Mode").tag(1)
|
||||
Text("Dark Mode").tag(2)
|
||||
}
|
||||
.pickerStyle(RadioGroupPickerStyle())
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -5,18 +5,27 @@ struct SettingsView: View {
|
||||
|
||||
var body: some View {
|
||||
TabView(selection: $selectedView) {
|
||||
AccountView()
|
||||
.tabItem {
|
||||
Image(systemName: "person.crop.circle")
|
||||
Text("Account")
|
||||
Form {
|
||||
Section(header: Text("Log in to your account")) {
|
||||
AccountView()
|
||||
}
|
||||
.tag(0)
|
||||
PreferencesView()
|
||||
.tabItem {
|
||||
Image(systemName: "gear")
|
||||
Text("Preferences")
|
||||
}
|
||||
.tabItem {
|
||||
Image(systemName: "person.crop.circle")
|
||||
Text("Account")
|
||||
}
|
||||
.tag(0)
|
||||
Form {
|
||||
Section(header: Text("Appearance")) {
|
||||
PreferencesView()
|
||||
Spacer()
|
||||
}
|
||||
.tag(1)
|
||||
}
|
||||
.tabItem {
|
||||
Image(systemName: "gear")
|
||||
Text("Preferences")
|
||||
}
|
||||
.tag(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user