added a slider

actually linked the font size to the terminal
This commit is contained in:
neon443
2025-07-09 20:35:06 +01:00
parent 227b772885
commit 76e15eaea2
3 changed files with 6 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ class HostsManager: ObservableObject, @unchecked Sendable {
@Published var fonts: [UIFont] = []
@Published var selectedFont: String = "SF Mono"
@Published var fontSize: CGFloat = 12
@Published var fontSize: CGFloat = UIFont.systemFontSize
var tint: SwiftUI.Color {
selectedTheme.ansi[selectedAnsi].suiColor

View File

@@ -15,11 +15,12 @@ struct FontManagerView: View {
var body: some View {
List {
Slider(value: $hostsManager.fontSize, in: 1...15, step: 1) {
Label("Size", systemImage: "textformat.size")
Text("\(Int(hostsManager.fontSize))")
// Label("\(Int(hostsManager.fontSize))", systemImage: "textformat.size")
} minimumValueLabel: {
Label("1", systemImage: "textformat.size.smaller")
Label("", systemImage: "textformat.size.smaller")
} maximumValueLabel: {
Label("15", systemImage: "textformat.size.larger")
Label("", systemImage: "textformat.size.larger")
} onEditingChanged: { bool in
hostsManager.saveFonts()
}

View File

@@ -25,7 +25,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
if window != nil {
restoreScrollback()
if let hostsManager {
font = UIFont(name: hostsManager.selectedFont, size: UIFont.systemFontSize)!
font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
}
applySelectedTheme()
startFeedLoop()