applying themes on the fly!! (to sessions already active)

added applySelectedTheme to sshhandler which will run applyselectedtheme on the terminalview if it exists
added applyselectedtheme to apply the chosen theme in hostsmanager
applying of the chosen theme on appear of any shell view
made the tap target for sessions actually the whole list item
fix undefined behaivour from modifying published values from background threads
This commit is contained in:
neon443
2025-06-29 16:39:03 +01:00
parent 8e69dfc165
commit 80ddde3a62
6 changed files with 43 additions and 24 deletions

View File

@@ -22,7 +22,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
print(getTerminal().backgroundColor)
print(getTerminal().foregroundColor)
applyTheme(hostsManager.selectedTheme)
applySelectedTheme()
DispatchQueue.main.async {
Task {
@@ -55,6 +55,11 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
}
}
func applySelectedTheme() {
guard let hostsManager else { return }
applyTheme(hostsManager.selectedTheme)
}
func applyTheme(_ theme: Theme) {
getTerminal().installPalette(colors: theme.ansi)
getTerminal().foregroundColor = theme.foreground