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

Method resolve_theme_by_id

src/apps/cli/src/ui/startup.rs:1674–1698  ·  view source on GitHub ↗
(
        &self,
        base: Theme,
        appearance: Appearance,
        scheme: EffectiveColorScheme,
        id: &str,
    )

Source from the content-addressed store, hash-verified

1672 }
1673
1674 fn resolve_theme_by_id(
1675 &self,
1676 base: Theme,
1677 appearance: Appearance,
1678 scheme: EffectiveColorScheme,
1679 id: &str,
1680 ) -> Theme {
1681 if scheme == EffectiveColorScheme::Monochrome {
1682 return Theme::monochrome();
1683 }
1684
1685 let id = id.trim();
1686 if id.is_empty() {
1687 return base;
1688 }
1689
1690 if let Some(json) = builtin_theme_json(id) {
1691 return base
1692 .apply_opencode_theme_json(json, appearance)
1693 .unwrap_or(base)
1694 .with_effective_scheme(scheme);
1695 }
1696
1697 base
1698 }
1699
1700 fn begin_theme_preview(&mut self) {
1701 if self.theme_preview_original.is_none() {

Callers 2

apply_theme_selectionMethod · 0.45

Calls 5

builtin_theme_jsonFunction · 0.85
trimMethod · 0.80
with_effective_schemeMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected