Skip to content

Commit

Permalink
Merge pull request #5241 from Textualize/theme-unregister-fix
Browse files Browse the repository at this point in the history
Registering builtin themes on startup
  • Loading branch information
willmcgugan authored Nov 16, 2024
2 parents 1af8e33 + 101f199 commit e8b1c21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ def __init__(
This excludes the built-in themes."""

for theme in BUILTIN_THEMES.values():
self.register_theme(theme)

ansi_theme = (
self.ansi_theme_dark if self.current_theme.dark else self.ansi_theme_light
)
Expand Down Expand Up @@ -1228,7 +1231,7 @@ def available_themes(self) -> dict[str, Theme]:
A dictionary mapping theme names to Theme instances.
"""
return {**BUILTIN_THEMES, **self._registered_themes}
return {**self._registered_themes}

@property
def current_theme(self) -> Theme:
Expand Down

0 comments on commit e8b1c21

Please sign in to comment.