def init_theme(self): load_available_themes() theme = Theme.get_current() theme.clear_cache() if self.settings.get_property('disable-window-shadow'): self.window_body.get_style_context().add_class('no-window-shadow') self._render_prefs_icon() self.init_styles(theme.compile_css())
def init_theme(self): load_available_themes() theme = Theme.get_current() theme.clear_cache() # removing window shadow solves issue with DEs without a compositor (#230) if get_options().no_window_shadow: self.window_body.get_style_context().add_class('no-window-shadow') self.init_styles(theme.compile_css())
def get_all(self, _): logger.info('API call /get/all') settings = self.settings.get_all() themes = [ dict(value=th.get_name(), text=th.get_display_name()) for th in load_available_themes().values() ] hotkey_accelerator = settings.get('hotkey_show_app') hotkey_caption = "Ctrl+Space" try: hotkey_caption = Gtk.accelerator_get_label( *Gtk.accelerator_parse(hotkey_accelerator)) # pylint: disable=broad-except except Exception: logger.warning('Unable to parse accelerator "%s". Use Ctrl+Space', hotkey_accelerator) settings.update({ 'autostart_allowed': self.autostart_pref.is_allowed(), 'autostart_enabled': self.autostart_pref.is_enabled(), 'available_themes': themes, 'hotkey_show_app': hotkey_caption, 'env': { 'version': VERSION, 'api_version': API_VERSION, 'user_home': os.path.expanduser('~'), 'is_x11': IS_X11, } }) return settings
def _get_available_themes(self): load_available_themes() return [dict(value=th.get_name(), text=th.get_display_name()) for th in themes.values()]
def init_theme(self): load_available_themes() theme = Theme.get_current() theme.clear_cache() self.init_styles(theme.compile_css())