added a slider

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

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ class HostsManager: ObservableObject, @unchecked Sendable {
@Published var fonts: [UIFont] = [] @Published var fonts: [UIFont] = []
@Published var selectedFont: String = "SF Mono" @Published var selectedFont: String = "SF Mono"
@Published var fontSize: CGFloat = 12 @Published var fontSize: CGFloat = UIFont.systemFontSize
var tint: SwiftUI.Color { var tint: SwiftUI.Color {
selectedTheme.ansi[selectedAnsi].suiColor selectedTheme.ansi[selectedAnsi].suiColor
+4 -3
View File
@@ -15,11 +15,12 @@ struct FontManagerView: View {
var body: some View { var body: some View {
List { List {
Slider(value: $hostsManager.fontSize, in: 1...15, step: 1) { 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: { } minimumValueLabel: {
Label("1", systemImage: "textformat.size.smaller") Label("", systemImage: "textformat.size.smaller")
} maximumValueLabel: { } maximumValueLabel: {
Label("15", systemImage: "textformat.size.larger") Label("", systemImage: "textformat.size.larger")
} onEditingChanged: { bool in } onEditingChanged: { bool in
hostsManager.saveFonts() hostsManager.saveFonts()
} }
@@ -25,7 +25,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
if window != nil { if window != nil {
restoreScrollback() restoreScrollback()
if let hostsManager { if let hostsManager {
font = UIFont(name: hostsManager.selectedFont, size: UIFont.systemFontSize)! font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
} }
applySelectedTheme() applySelectedTheme()
startFeedLoop() startFeedLoop()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.