This commit is contained in:
Thomas Ricouard 2024-01-13 08:48:29 +01:00
parent 6d12f2528d
commit 27da37e9ec
2 changed files with 17 additions and 15 deletions

View file

@ -255,21 +255,7 @@ struct DisplaySettingsView: View {
private var resetSection: some View {
Section {
Button {
theme.followSystemColorScheme = true
theme.applySet(set: colorScheme == .dark ? .iceCubeDark : .iceCubeLight)
theme.avatarShape = .circle
theme.avatarPosition = .leading
theme.statusActionsDisplay = .full
theme.displayFullUsername = false
theme.statusDisplayStyle = .large
theme.lineSpacing = 1.2
theme.fontSizeScale = 1.0
localValues.tintColor = theme.tintColor
localValues.primaryBackgroundColor = theme.primaryBackgroundColor
localValues.secondaryBackgroundColor = theme.secondaryBackgroundColor
localValues.labelColor = theme.labelColor
theme.restoreDefault()
} label: {
Text("settings.display.restore")
}

View file

@ -258,6 +258,22 @@ import SwiftUI
public static let shared = Theme()
public func restoreDefault() {
applySet(set: themeStorage.selectedScheme == .dark ? .iceCubeDark : .iceCubeLight)
isThemePreviouslySet = true
avatarPosition = .leading
avatarShape = .circle
storedSet = selectedSet
statusActionsDisplay = .full
statusDisplayStyle = .large
followSystemColorScheme = true
displayFullUsername = false
lineSpacing = 1.2
fontSizeScale = 1
chosenFontData = nil
statusActionSecondary = .share
}
private init() {
isThemePreviouslySet = themeStorage.isThemePreviouslySet
selectedScheme = themeStorage.selectedScheme