Skip to content

Commit

Permalink
U auto_theme.py: improve mode,variant load
Browse files Browse the repository at this point in the history
  • Loading branch information
yurenchen000 committed Oct 4, 2024
1 parent 0dab354 commit 4c5e409
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions auto_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ def __init__(self):
self.__class__.load_config()
self.setup_theme_monitor()

style_manager = Handy.StyleManager.get_default()
style_manager.set_color_scheme(self.__class__.to_variant(self.variant))

## on menu_show
def callback(self, menuitems, menu, terminal):
item = Gtk.CheckMenuItem(_(' - AutoTheme'))
Expand All @@ -59,6 +56,18 @@ def callback(self, menuitems, menu, terminal):
menuitems.append(item)
# print('AutoTheme __init__..')

# AutoTheme.load_config()
## load mode stat
mode = AutoTheme.mode=='Dark' or AutoTheme.mode=='Auto' and AutoTheme.is_dark_theme()
print('load mode:', mode)
AutoTheme.change_theme(mode)

## load variant stat
self.teardown_theme_monitor() ## don't mess up with terminal profile
style_manager = Handy.StyleManager.get_default()
style_manager.set_color_scheme(AutoTheme.to_variant(AutoTheme.variant))
self.setup_theme_monitor()

@staticmethod
def setup_theme_monitor():
print('++ setup_theme_monit')
Expand Down

0 comments on commit 4c5e409

Please sign in to comment.