예제 #1
0
 def set_name_highlighted(self, is_selected: bool = False) -> None:
     colors = Theme.get_current().get_matched_text_hl_colors()
     color = colors['when_selected'] if is_selected else colors[
         'when_not_selected']
     self.set_name(
         self.item_object.get_name_highlighted(self.query, color)
         or self.item_object.get_name())
 def prefs_get_all(self, url_params):
     logger.info('API call /get/all')
     return {
         'show_indicator_icon':
         self.settings.get_property('show-indicator-icon'),
         'hotkey_show_app':
         self.get_app_hotkey(),
         'autostart_allowed':
         self.autostart_pref.is_allowed(),
         'autostart_enabled':
         self.autostart_pref.is_on(),
         'show_recent_apps':
         self.settings.get_property('show-recent-apps'),
         'clear_previous_query':
         self.settings.get_property('clear-previous-query'),
         'blacklisted_desktop_dirs':
         self.settings.get_property('blacklisted-desktop-dirs'),
         'available_themes':
         self._get_available_themes(),
         'theme_name':
         Theme.get_current().get_name(),
         'is_wayland':
         is_wayland(),
         'env': {
             'version': get_version(),
             'api_version': api_version,
             'user_home': os.path.expanduser('~')
         }
     }
예제 #3
0
    def theme(self, tmpdir):
        th = Theme(str(tmpdir))
        with open(os.path.join(str(tmpdir), 'theme.css'), 'w') as f:
            f.write('')

        th.theme_dict = {
            "manifest_version": "1",
            "name": "light",
            "display_name": "Elementary Light",
            "extend_theme": None,
            "css_file": "theme.css",
            "css_file_gtk_3.20+": "theme.css",
            "matched_text_hl_colors": {
                "when_selected": "#2c74cc",
                "when_not_selected": "#2c74cc"
            }
        }
        return th
예제 #4
0
    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())
예제 #5
0
    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())
예제 #6
0
 def init_theme(self):
     load_available_themes()
     theme = Theme.get_current()
     theme.clear_cache()
     self.init_styles(theme.compile_css())