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

Method preview_theme_selection

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

Source from the content-addressed store, hash-verified

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

Callers 2

handle_key_eventMethod · 0.45
handle_non_key_eventMethod · 0.45

Calls 7

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

Tested by

no test coverage detected