mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user