MCPcopy Create free account
hub / github.com/GCWing/BitFun / apply_theme_selection

Method apply_theme_selection

src/apps/cli/src/modes/chat.rs:1935–1955  ·  view source on GitHub ↗
(&mut self, theme: &ThemeItem, chat_view: &mut ChatView)

Source from the content-addressed store, hash-verified

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();

Callers 1

handle_key_eventMethod · 0.45

Calls 9

resolve_appearanceFunction · 0.85
is_lightMethod · 0.80
trimMethod · 0.80
set_themeMethod · 0.80
cloneMethod · 0.45
saveMethod · 0.45
set_statusMethod · 0.45
resolve_theme_by_idMethod · 0.45

Tested by

no test coverage detected