mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-17 12:46:40 +00:00
Cleanup display settings
This commit is contained in:
parent
db5d0b9274
commit
5766adc965
1 changed files with 174 additions and 154 deletions
|
@ -25,11 +25,26 @@ struct DisplaySettingsView: View {
|
||||||
routerPath: RouterPath()) // translate from latin button
|
routerPath: RouterPath()) // translate from latin button
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
|
exampleSection
|
||||||
|
themeSection
|
||||||
|
fontSection
|
||||||
|
layoutSection
|
||||||
|
platformsSection
|
||||||
|
resetSection
|
||||||
|
}
|
||||||
|
.navigationTitle("settings.display.navigation-title")
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
|
.background(theme.secondaryBackgroundColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
private var exampleSection: some View {
|
||||||
Section("settings.display.example-toot") {
|
Section("settings.display.example-toot") {
|
||||||
StatusRowView(viewModel: { previewStatusViewModel })
|
StatusRowView(viewModel: { previewStatusViewModel })
|
||||||
.allowsHitTesting(false)
|
.allowsHitTesting(false)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var themeSection: some View {
|
||||||
Section {
|
Section {
|
||||||
Toggle("settings.display.theme.systemColor", isOn: $theme.followSystemColorScheme)
|
Toggle("settings.display.theme.systemColor", isOn: $theme.followSystemColorScheme)
|
||||||
themeSelectorButton
|
themeSelectorButton
|
||||||
|
@ -78,7 +93,9 @@ struct DisplaySettingsView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
private var fontSection: some View {
|
||||||
Section("settings.display.section.font") {
|
Section("settings.display.section.font") {
|
||||||
Picker("settings.display.font", selection: .init(get: { () -> FontState in
|
Picker("settings.display.font", selection: .init(get: { () -> FontState in
|
||||||
if theme.chosenFont?.fontName == "OpenDyslexic-Regular" {
|
if theme.chosenFont?.fontName == "OpenDyslexic-Regular" {
|
||||||
|
@ -119,7 +136,9 @@ struct DisplaySettingsView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
private var layoutSection: some View {
|
||||||
Section("settings.display.section.display") {
|
Section("settings.display.section.display") {
|
||||||
Picker("settings.display.avatar.position", selection: $theme.avatarPosition) {
|
Picker("settings.display.avatar.position", selection: $theme.avatarPosition) {
|
||||||
ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in
|
ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in
|
||||||
|
@ -146,7 +165,10 @@ struct DisplaySettingsView: View {
|
||||||
Toggle("settings.display.translate-button", isOn: $userPreferences.showTranslateButton)
|
Toggle("settings.display.translate-button", isOn: $userPreferences.showTranslateButton)
|
||||||
}
|
}
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var platformsSection: some View {
|
||||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||||
Section("iPhone") {
|
Section("iPhone") {
|
||||||
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
|
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
|
||||||
|
@ -160,7 +182,9 @@ struct DisplaySettingsView: View {
|
||||||
}
|
}
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var resetSection: some View {
|
||||||
Section {
|
Section {
|
||||||
Button {
|
Button {
|
||||||
theme.followSystemColorScheme = true
|
theme.followSystemColorScheme = true
|
||||||
|
@ -180,10 +204,6 @@ struct DisplaySettingsView: View {
|
||||||
}
|
}
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
}
|
}
|
||||||
.navigationTitle("settings.display.navigation-title")
|
|
||||||
.scrollContentBackground(.hidden)
|
|
||||||
.background(theme.secondaryBackgroundColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
private var themeSelectorButton: some View {
|
private var themeSelectorButton: some View {
|
||||||
NavigationLink(destination: ThemePreviewView()) {
|
NavigationLink(destination: ThemePreviewView()) {
|
||||||
|
|
Loading…
Reference in a new issue