formatting

This commit is contained in:
Peter Steinberger 2025-06-20 20:01:06 +02:00
parent 22eb5a2e3f
commit d21210163b

View file

@ -2,7 +2,8 @@ import SwiftUI
/// Main settings view with tabbed navigation /// Main settings view with tabbed navigation
struct SettingsView: View { struct SettingsView: View {
@Environment(\.dismiss) var dismiss @Environment(\.dismiss)
var dismiss
@State private var selectedTab = SettingsTab.general @State private var selectedTab = SettingsTab.general
enum SettingsTab: String, CaseIterable { enum SettingsTab: String, CaseIterable {
@ -23,11 +24,11 @@ struct SettingsView: View {
// Tab selector // Tab selector
HStack(spacing: 0) { HStack(spacing: 0) {
ForEach(SettingsTab.allCases, id: \.self) { tab in ForEach(SettingsTab.allCases, id: \.self) { tab in
Button(action: { Button {
withAnimation(Theme.Animation.smooth) { withAnimation(Theme.Animation.smooth) {
selectedTab = tab selectedTab = tab
} }
}) { } label: {
VStack(spacing: Theme.Spacing.small) { VStack(spacing: Theme.Spacing.small) {
Image(systemName: tab.icon) Image(systemName: tab.icon)
.font(.title2) .font(.title2)
@ -80,10 +81,14 @@ struct SettingsView: View {
/// General settings tab content /// General settings tab content
struct GeneralSettingsView: View { struct GeneralSettingsView: View {
@AppStorage("defaultFontSize") private var defaultFontSize: Double = 14 @AppStorage("defaultFontSize")
@AppStorage("defaultTerminalWidth") private var defaultTerminalWidth: Int = 80 private var defaultFontSize: Double = 14
@AppStorage("autoScrollEnabled") private var autoScrollEnabled = true @AppStorage("defaultTerminalWidth")
@AppStorage("enableURLDetection") private var enableURLDetection = true private var defaultTerminalWidth: Int = 80
@AppStorage("autoScrollEnabled")
private var autoScrollEnabled = true
@AppStorage("enableURLDetection")
private var enableURLDetection = true
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: Theme.Spacing.large) { VStack(alignment: .leading, spacing: Theme.Spacing.large) {
@ -169,8 +174,10 @@ struct GeneralSettingsView: View {
/// Advanced settings tab content /// Advanced settings tab content
struct AdvancedSettingsView: View { struct AdvancedSettingsView: View {
@AppStorage("verboseLogging") private var verboseLogging = false @AppStorage("verboseLogging")
@AppStorage("debugModeEnabled") private var debugModeEnabled = false private var verboseLogging = false
@AppStorage("debugModeEnabled")
private var debugModeEnabled = false
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: Theme.Spacing.large) { VStack(alignment: .leading, spacing: Theme.Spacing.large) {
@ -200,7 +207,6 @@ struct AdvancedSettingsView: View {
.padding() .padding()
.background(Theme.Colors.cardBackground) .background(Theme.Colors.cardBackground)
.cornerRadius(Theme.CornerRadius.card) .cornerRadius(Theme.CornerRadius.card)
} }
} }
@ -242,4 +248,4 @@ struct AdvancedSettingsView: View {
#Preview { #Preview {
SettingsView() SettingsView()
} }