theme picker ui is pretty now

added a bunch of builtin htemes
applytheme takes a theme
added builtin themes enum
added decodeloacltheme func
added builtinthemes array property
selectedtheme is now an actual theme instead of an index
its really annoying it doesnt really work rn
This commit is contained in:
neon443
2025-06-29 09:59:53 +01:00
parent f19f32682f
commit 834fb266e9
19 changed files with 4984 additions and 78 deletions

View File

@@ -19,7 +19,10 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
self.handler = handler
self.hostsManager = hostsManager
applyTheme(index: hostsManager.selectedThemeIndex)
print(getTerminal().backgroundColor)
print(getTerminal().foregroundColor)
applyTheme(hostsManager.selectedTheme)
DispatchQueue.main.async {
Task {
@@ -52,11 +55,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
}
}
func applyTheme(index themeIndex: Int) {
guard themeIndex != -1 else { return }
guard let hostsManager = hostsManager else { return }
let theme = hostsManager.themes[themeIndex]
func applyTheme(_ theme: Theme) {
getTerminal().installPalette(colors: theme.ansi)
getTerminal().foregroundColor = theme.foreground
getTerminal().backgroundColor = theme.background