mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Fix a regression that caused automatic color themes to not be re-applied after config file reload
The reload was only happening if the auto theme config file had its mtime updated, since the last time it was checked. Fixes #8530
This commit is contained in:
@@ -101,6 +101,8 @@ Detailed list of changes
|
||||
|
||||
- diff kitten: Add half page and full page scroll vim-like bindings (:pull:`8514`)
|
||||
|
||||
- Fix a regression that caused automatic color themes to not be re-applied after config file reload (:iss:`8530`)
|
||||
|
||||
0.41.1 [2025-04-03]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -2695,8 +2695,10 @@ class Boss:
|
||||
for tm in self.all_tab_managers:
|
||||
tm.apply_options()
|
||||
# Update colors
|
||||
if theme_colors.applied_theme and theme_colors.refresh():
|
||||
theme_colors.apply_theme(theme_colors.applied_theme, notify_on_bg_change=False)
|
||||
if theme_colors.has_applied_theme:
|
||||
theme_colors.refresh()
|
||||
if theme_colors.has_applied_theme: # in case the theme file was deleted
|
||||
theme_colors.apply_theme(theme_colors.applied_theme, notify_on_bg_change=False)
|
||||
for w in self.all_windows:
|
||||
if w.screen.color_profile.default_bg != bg_colors_before.get(w.id):
|
||||
self.default_bg_changed_for(w.id)
|
||||
|
||||
@@ -83,6 +83,18 @@ class ThemeColors:
|
||||
found = True
|
||||
return found
|
||||
|
||||
@property
|
||||
def has_applied_theme(self) -> bool:
|
||||
match self.applied_theme:
|
||||
case '':
|
||||
return False
|
||||
case 'dark':
|
||||
return self.has_dark_theme
|
||||
case 'light':
|
||||
return self.has_light_theme
|
||||
case 'no_preference':
|
||||
return self.has_no_preference_theme
|
||||
|
||||
@property
|
||||
def has_dark_theme(self) -> bool:
|
||||
return self.dark_mtime > -1
|
||||
|
||||
Reference in New Issue
Block a user