mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 21:36:17 +00:00
improve ios 16 ux:
fix missing symbol in onboarding fix settings empty headers
This commit is contained in:
@@ -16,7 +16,7 @@ class HostsManager: ObservableObject, @unchecked Sendable {
|
||||
|
||||
@Published var themes: [Theme] = []
|
||||
@Published var selectedTheme: Theme = Theme.decodeLocalTheme(fileName: "xcodeDarkHC") ?? Theme.defaultTheme
|
||||
@Published var selectedAnsi: Int = 1
|
||||
@Published var selectedAnsi: Int = 4
|
||||
|
||||
@Published var fonts: [UIFont] = []
|
||||
@Published var selectedFont: String = "SF Mono"
|
||||
|
||||
@@ -8,19 +8,30 @@
|
||||
import SwiftUI
|
||||
|
||||
struct WelcomeChunk: View {
|
||||
@State var symbol: String
|
||||
@State var systemImage: String?
|
||||
@State var image: String?
|
||||
@State var title: String
|
||||
@State var para: String
|
||||
@State var delay: TimeInterval = 0
|
||||
|
||||
@State private var spawnDate: Date = .now
|
||||
|
||||
var imageUnwrapped: Image {
|
||||
if let systemImage {
|
||||
return Image(systemName: systemImage)
|
||||
} else if let image {
|
||||
return Image(image)
|
||||
} else {
|
||||
return Image(systemName: "questionmark")
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
TimelineView(.animation) { tl in
|
||||
let time = tl.date.timeIntervalSince(spawnDate)
|
||||
HStack(spacing: 25) {
|
||||
if time > delay {
|
||||
Image(systemName: symbol)
|
||||
imageUnwrapped
|
||||
.resizable().scaledToFit()
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.frame(width: 50, height: 50)
|
||||
@@ -56,7 +67,7 @@ struct WelcomeChunk: View {
|
||||
|
||||
#Preview {
|
||||
WelcomeChunk(
|
||||
symbol: "trash",
|
||||
systemImage: "trash",
|
||||
title: "The Trash",
|
||||
para: "Here's to the crazy ones."
|
||||
)
|
||||
|
||||
@@ -40,31 +40,31 @@ struct WelcomeView: View {
|
||||
}
|
||||
|
||||
WelcomeChunk(
|
||||
symbol: "bolt.fill",
|
||||
systemImage: "bolt.fill",
|
||||
title: "Blazing Fast",
|
||||
para: "",
|
||||
delay: 4
|
||||
)
|
||||
WelcomeChunk(
|
||||
symbol: "apple.terminal.on.rectangle.fill",
|
||||
image: "apple.terminal.on.rectangle.fill",
|
||||
title: "Multiple Sessions",
|
||||
para: "Connect to the same host again and again, or different ones",
|
||||
delay: 5
|
||||
)
|
||||
WelcomeChunk(
|
||||
symbol: "swatchpalette.fill",
|
||||
systemImage: "swatchpalette.fill",
|
||||
title: "Themes",
|
||||
para: "Customise ShhShell by importing themes, or make your own!",
|
||||
delay: 6
|
||||
)
|
||||
WelcomeChunk(
|
||||
symbol: "lock.shield.fill",
|
||||
systemImage: "lock.shield.fill",
|
||||
title: "Secure",
|
||||
para: "ShhShell uses secure Elliptic Curve keys, and keeps you safe by verifying hostkeys haven't changed",
|
||||
delay: 7
|
||||
)
|
||||
WelcomeChunk(
|
||||
symbol: "ellipsis.circle",
|
||||
systemImage: "ellipsis.circle",
|
||||
title: "And more...",
|
||||
para: "Snippets, iCloud Sync, Fonts, Terminal Filters, Connection History",
|
||||
delay: 8
|
||||
|
||||
@@ -101,7 +101,7 @@ struct SettingsView: View {
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
|
||||
Picker("", selection: $hostsManager.settings.cursorType.cursorShape) {
|
||||
Picker("Shape", selection: $hostsManager.settings.cursorType.cursorShape) {
|
||||
ForEach(CursorShape.allCases, id: \.self) { type in
|
||||
Text(type.description).tag(type)
|
||||
}
|
||||
@@ -110,28 +110,37 @@ struct SettingsView: View {
|
||||
.labelsHidden()
|
||||
}
|
||||
|
||||
Toggle("location persistence", systemImage: "location.fill", isOn: $hostsManager.settings.locationPersist)
|
||||
.onChange(of: hostsManager.settings.locationPersist) { _ in
|
||||
if hostsManager.settings.locationPersist && !Backgrounder.shared.checkPermsStatus() {
|
||||
Backgrounder.shared.requestPerms()
|
||||
Section("Keepalive") {
|
||||
Toggle("location persistence", systemImage: "location.fill", isOn: $hostsManager.settings.locationPersist)
|
||||
.onChange(of: hostsManager.settings.locationPersist) { _ in
|
||||
if hostsManager.settings.locationPersist && !Backgrounder.shared.checkPermsStatus() {
|
||||
Backgrounder.shared.requestPerms()
|
||||
}
|
||||
}
|
||||
Toggle("keep screen awake", systemImage: "cup.and.saucer.fill", isOn: $hostsManager.settings.caffeinate)
|
||||
}
|
||||
|
||||
Section("Bell") {
|
||||
Toggle("bell sound", systemImage: "bell.and.waves.left.and.right", isOn: $hostsManager.settings.bellSound)
|
||||
Toggle("bell haptic",systemImage: "iphone.radiowaves.left.and.right", isOn: $hostsManager.settings.bellHaptic)
|
||||
}
|
||||
|
||||
|
||||
Section("Terminal Filter") {
|
||||
if #unavailable(iOS 17), hostsManager.settings.filter == .crt {
|
||||
Label("iOS 17 Required", systemImage: "exclamationmark.triangle.fill")
|
||||
.foregroundStyle(.yellow)
|
||||
.transition(.opacity)
|
||||
}
|
||||
Picker("", selection: $hostsManager.settings.filter) {
|
||||
ForEach(TerminalFilter.allCases, id: \.self) { filter in
|
||||
Text(filter.description).tag(filter)
|
||||
}
|
||||
}
|
||||
|
||||
Toggle("bell sound", systemImage: "bell.and.waves.left.and.right", isOn: $hostsManager.settings.bellSound)
|
||||
Toggle("bell haptic",systemImage: "iphone.radiowaves.left.and.right", isOn: $hostsManager.settings.bellHaptic)
|
||||
|
||||
Toggle("keep screen awake", systemImage: "cup.and.saucer.fill", isOn: $hostsManager.settings.caffeinate)
|
||||
|
||||
if #unavailable(iOS 17), hostsManager.settings.filter == .crt {
|
||||
Label("iOS 17 Required", systemImage: "exclamationmark.triangle.fill")
|
||||
.foregroundStyle(.yellow)
|
||||
.pickerStyle(.inline)
|
||||
.labelsHidden()
|
||||
}
|
||||
Picker("terminal filter", selection: $hostsManager.settings.filter) {
|
||||
ForEach(TerminalFilter.allCases, id: \.self) { filter in
|
||||
Text(filter.description).tag(filter)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.inline)
|
||||
.animation(.spring, value: hostsManager.settings.filter)
|
||||
|
||||
Section("App Icon") {
|
||||
ScrollView(.horizontal) {
|
||||
@@ -166,7 +175,7 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.listStyle(.sidebar)
|
||||
.listStyle(.insetGrouped)
|
||||
.scrollContentBackground(.hidden)
|
||||
.onChange(of: hostsManager.settings) { _ in
|
||||
hostsManager.saveSettings()
|
||||
|
||||
Reference in New Issue
Block a user