(&mut self, theme: &ThemeItem, chat_view: &mut ChatView)
| 1933 | } |
| 1934 | |
| 1935 | fn apply_theme_selection(&mut self, theme: &ThemeItem, chat_view: &mut ChatView) { |
| 1936 | let appearance = resolve_appearance(&self.config.ui.theme); |
| 1937 | let scheme = resolve_effective_color_scheme(&self.config.ui.color_scheme); |
| 1938 | let base_is_light = appearance.is_light(); |
| 1939 | let base = match (base_is_light, scheme) { |
| 1940 | (_, EffectiveColorScheme::Monochrome) => Theme::monochrome(), |
| 1941 | (true, EffectiveColorScheme::Ansi16) => Theme::light_ansi16(), |
| 1942 | (true, EffectiveColorScheme::Truecolor) => Theme::light(), |
| 1943 | (false, EffectiveColorScheme::Ansi16) => Theme::dark_ansi16(), |
| 1944 | (false, EffectiveColorScheme::Truecolor) => Theme::dark(), |
| 1945 | }; |
| 1946 | |
| 1947 | self.config.ui.theme_id = theme.id.clone(); |
| 1948 | if let Err(e) = self.config.save() { |
| 1949 | chat_view.set_status(Some(format!("Failed to save config: {}", e))); |
| 1950 | } |
| 1951 | |
| 1952 | let resolved = self.resolve_theme_by_id(base, appearance, scheme, theme.id.trim()); |
| 1953 | chat_view.set_theme(resolved); |
| 1954 | chat_view.set_status(Some(format!("Theme set to: {}", theme.id))); |
| 1955 | } |
| 1956 | |
| 1957 | fn get_mode_agents(&self, rt_handle: &tokio::runtime::Handle) -> Vec<AgentInfo> { |
| 1958 | let registry = get_agent_registry(); |
no test coverage detected