diff --git a/ShhShell/ShhShellApp.swift b/ShhShell/ShhShellApp.swift index f320a98..dbc7f0f 100644 --- a/ShhShell/ShhShellApp.swift +++ b/ShhShell/ShhShellApp.swift @@ -27,6 +27,8 @@ struct ShhShellApp: App { hostsManager: hostsManager, keyManager: keyManager ) + .colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) + .tint(hostsManager.tint) } } } diff --git a/ShhShell/Views/ContentView.swift b/ShhShell/Views/ContentView.swift index ccb8bd8..f9feea6 100644 --- a/ShhShell/Views/ContentView.swift +++ b/ShhShell/Views/ContentView.swift @@ -78,9 +78,6 @@ struct ContentView: View { } .scrollContentBackground(.hidden) } - - .colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) - .tint(hostsManager.tint) .navigationTitle("ShhShell") .toolbar { ToolbarItem(placement: .confirmationAction) { diff --git a/ShhShell/Views/Fonts/FontManagerView.swift b/ShhShell/Views/Fonts/FontManagerView.swift index 36cb1ff..9f77b24 100644 --- a/ShhShell/Views/Fonts/FontManagerView.swift +++ b/ShhShell/Views/Fonts/FontManagerView.swift @@ -13,58 +13,63 @@ struct FontManagerView: View { @State var testLine: String = "the lazy brown fox jumps over the lazy dog" var body: some View { - List { - VStack { - HStack { - Text("Font Size") - Spacer() - Text("\(Int(hostsManager.fontSize))") - .contentTransition(.numericText()) - } - .padding(.horizontal) - - Slider(value: $hostsManager.fontSize, in: 1...20, step: 1) { + ZStack { + hostsManager.selectedTheme.background.suiColor.opacity(0.7) + .ignoresSafeArea(.all) + List { + VStack { + HStack { + Text("Font Size") + Spacer() + Text("\(Int(hostsManager.fontSize))") + .contentTransition(.numericText()) + } + .padding(.horizontal) - } minimumValueLabel: { - Label("", systemImage: "textformat.size.smaller") - } maximumValueLabel: { - Label("", systemImage: "textformat.size.larger") - } onEditingChanged: { bool in - hostsManager.saveFonts() + Slider(value: $hostsManager.fontSize, in: 1...20, step: 1) { + + } minimumValueLabel: { + Label("", systemImage: "textformat.size.smaller") + } maximumValueLabel: { + Label("", systemImage: "textformat.size.larger") + } onEditingChanged: { bool in + hostsManager.saveFonts() + } } - } - - ForEach(FontFamilies.allCasesRaw, id: \.self) { fontName in - let selected = hostsManager.selectedFont == fontName - Button() { - hostsManager.selectFont(fontName) - } label: { - VStack(alignment: .leading, spacing: 5) { - Text(fontName) - .foregroundStyle(.gray) - HStack { - Circle() - .frame(width: 20) - .opacity(selected ? 1 : 0) - .foregroundStyle(.green) - .animation(.spring, value: selected) - .transition(.scale) - Text(testLine) - .font(.custom(fontName, size: 15)) - .bold(selected) - .opacity(selected ? 1 : 0.8) - .contentTransition(.numericText()) - .animation(.default, value: testLine) + + ForEach(FontFamilies.allCasesRaw, id: \.self) { fontName in + let selected = hostsManager.selectedFont == fontName + Button() { + hostsManager.selectFont(fontName) + } label: { + VStack(alignment: .leading, spacing: 5) { + Text(fontName) + .foregroundStyle(.gray) + HStack { + Circle() + .frame(width: 20) + .opacity(selected ? 1 : 0) + .foregroundStyle(.green) + .animation(.spring, value: selected) + .transition(.scale) + Text(testLine) + .font(.custom(fontName, size: 15)) + .bold(selected) + .opacity(selected ? 1 : 0.8) + .contentTransition(.numericText()) + .animation(.default, value: testLine) + } } } } - } - - Section("Test String") { - TextField("", text: $testLine) - .fixedSize() + + Section("Test String") { + TextField("", text: $testLine) + .fixedSize() + } } } + .scrollContentBackground(.hidden) } } diff --git a/ShhShell/Views/Hosts/RecentsView.swift b/ShhShell/Views/Hosts/RecentsView.swift index 52b93a1..583699e 100644 --- a/ShhShell/Views/Hosts/RecentsView.swift +++ b/ShhShell/Views/Hosts/RecentsView.swift @@ -54,7 +54,7 @@ struct RecentsView: View { if historyCount+2 > hostsManager.history.count { increment = 1 } - withAnimation { historyCount += increment } + withAnimation(.spring) { historyCount += increment } } label: { Image(systemName: "chevron.down") .resizable().scaledToFit() @@ -76,7 +76,7 @@ struct RecentsView: View { Spacer() Button { - withAnimation { historyCount = 0 } + withAnimation(.spring) { historyCount = 0 } } label: { Image(systemName: "chevron.up.2") .resizable().scaledToFit()