SPB Git

Repository Public

AppearanceSettingsView.swift 3.3 KB 77 lines swift

1// =============================================================================2//                  SP BOUCHER | SOFTWARE & RESEARCH3//             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// Project          : QYVORA7// File             : App/Sources/AppearanceSettingsView.swift8// Module           : Sources9// Repository       : https://git.spboucher.ai/qyvora10// Project Website  : Not specified11// Created          : 2026-12-0412// Last Modified    : 2026-12-0513//14// Author           : Simon-Pierre Boucher15// Position         : Professor of Finance16// Institution      : Université du Québec en Outaouais (UQO)17// Organization     : SP Boucher18// Website          : https://spboucher.ai19// Git              : https://git.spboucher.ai20//21// Preferred Contact: contact@spboucher.ai22// Development      : dev@spboucher.ai23// Support          : support@spboucher.ai24// Security/Admin   : admin@spboucher.ai25//26// Copyright (c) 202627// Simon-Pierre Boucher28// All rights reserved where applicable. This file is governed by the29// applicable project license, copyright notices and relevant law.30// Existing third-party rights and notices remain unaffected.31//32// License          : None specified (no license file in this repository)33//34// Do not embed credentials, private keys, access tokens,35// certificates or confidential personal information.36//37// =============================================================================38// END OF SP BOUCHER SOURCE HEADER39// =============================================================================40import SwiftUI41import QyvoraUI4243/// System, light or dark. The choice is stored with `AppStorage` and applied at the root of the application.44struct AppearanceSettingsView: View {45    @AppStorage(AppAppearance.storageKey) private var appearance: AppAppearance = .system4647    var body: some View {48        SecurityScroll {49            QListSection(footnote: "Both appearances use the same palette: graphite surfaces, one violet and one blue accent.") {50                ForEach(AppAppearance.allCases) { option in51                    Button {52                        appearance = option53                    } label: {54                        HStack(spacing: QSpace.s) {55                            SecRowLabel(title: option.title, subtitle: option.detail, systemImage: option.systemImage)56                            if option == appearance {57                                Image(systemName: "checkmark")58                                    .font(.body.weight(.semibold))59                                    .foregroundStyle(QColor.violet)60                                    .transition(.scale.combined(with: .opacity))61                                    .accessibilityHidden(true)62                            }63                        }64                    }65                    .buttonStyle(.qRow)66                    .accessibilityElement(children: .combine)67                    .accessibilityAddTraits(option == appearance ? [.isSelected, .isButton] : [.isButton])68                }69            }70        }71        .qAnimation(value: appearance)72        .qHaptic(.selection, trigger: appearance)73        .navigationTitle("Appearance")74        .navigationBarTitleDisplayMode(.inline)75    }76}77
Files main
Menu

Theme