import DesignSystem import Models import Status import SwiftUI import Env struct DisplaySettingsView: View { @EnvironmentObject private var theme: Theme @EnvironmentObject private var userPreferences: UserPreferences @State private var isThemeSelectorPresented = false var body: some View { Form { Section("Theme") { themeSelectorButton ColorPicker("Tint color", selection: $theme.tintColor) ColorPicker("Background color", selection: $theme.primaryBackgroundColor) ColorPicker("Secondary Background color", selection: $theme.secondaryBackgroundColor) } .listRowBackground(theme.primaryBackgroundColor) Section("Display") { Picker("Avatar position", selection: $theme.avatarPosition) { ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in Text(position.description).tag(position) } } Picker("Avatar shape", selection: $theme.avatarShape) { ForEach(Theme.AvatarShape.allCases, id: \.rawValue) { shape in Text(shape.description).tag(shape) } } Picker("Status actions buttons", selection: $theme.statusActionsDisplay) { ForEach(Theme.StatusActionsDisplay.allCases, id: \.rawValue) { buttonStyle in Text(buttonStyle.description).tag(buttonStyle) } } Picker("Status media style", selection: $theme.statusDisplayStyle) { ForEach(Theme.StatusDisplayStyle.allCases, id: \.rawValue) { buttonStyle in Text(buttonStyle.description).tag(buttonStyle) } } if ProcessInfo.processInfo.isiOSAppOnMac { VStack { Slider(value: $userPreferences.fontSizeScale, in: 0.5...1.5, step: 0.1) Text("Font scaling: \(String(format: "%.1f", userPreferences.fontSizeScale))") .font(.scaledBody) } } } .listRowBackground(theme.primaryBackgroundColor) Section { Button { theme.selectedSet = .iceCubeDark theme.avatarShape = .rounded theme.avatarPosition = .top theme.statusActionsDisplay = .full } label: { Text("Restore default") } } .listRowBackground(theme.primaryBackgroundColor) } .navigationTitle("Display Settings") .scrollContentBackground(.hidden) .background(theme.secondaryBackgroundColor) } private var themeSelectorButton: some View { NavigationLink(destination: ThemePreviewView()) { HStack { Text("Theme") Spacer() Text(theme.selectedSet.rawValue) } } } }