diff --git a/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift b/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift index f868da7c..3bab5841 100644 --- a/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift +++ b/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift @@ -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") } diff --git a/Packages/DesignSystem/Sources/DesignSystem/Theme.swift b/Packages/DesignSystem/Sources/DesignSystem/Theme.swift index de72b8e9..6961544a 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/Theme.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/Theme.swift @@ -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