(&mut self, theme: &ThemeItem, chat_view: &mut ChatView)
| 1913 | } |
| 1914 | |
| 1915 | fn preview_theme_selection(&mut self, theme: &ThemeItem, chat_view: &mut ChatView) { |
| 1916 | let appearance = resolve_appearance(&self.config.ui.theme); |
| 1917 | let scheme = resolve_effective_color_scheme(&self.config.ui.color_scheme); |
| 1918 | let base_is_light = appearance.is_light(); |
| 1919 | let base = match (base_is_light, scheme) { |
| 1920 | (_, EffectiveColorScheme::Monochrome) => Theme::monochrome(), |
| 1921 | (true, EffectiveColorScheme::Ansi16) => Theme::light_ansi16(), |
| 1922 | (true, EffectiveColorScheme::Truecolor) => Theme::light(), |
| 1923 | (false, EffectiveColorScheme::Ansi16) => Theme::dark_ansi16(), |
| 1924 | (false, EffectiveColorScheme::Truecolor) => Theme::dark(), |
| 1925 | }; |
| 1926 | |
| 1927 | let resolved = self.resolve_theme_by_id(base, appearance, scheme, theme.id.trim()); |
| 1928 | chat_view.set_theme(resolved); |
| 1929 | chat_view.set_status(Some(format!( |
| 1930 | "Preview theme: {} (Enter apply, Esc cancel)", |
| 1931 | theme.id |
| 1932 | ))); |
| 1933 | } |
| 1934 | |
| 1935 | fn apply_theme_selection(&mut self, theme: &ThemeItem, chat_view: &mut ChatView) { |
| 1936 | let appearance = resolve_appearance(&self.config.ui.theme); |
no test coverage detected