feat: impl catppuccin theme

This commit is contained in:
2026-04-26 00:46:11 +01:00
parent dab18c40c5
commit 3b0fe3e311
6 changed files with 118 additions and 58 deletions

View File

@@ -8,6 +8,7 @@ use crate::{api, app};
pub struct Global {
pub safe_area: gpui::Bounds<gpui::Pixels>,
pub theme_family: theme::ThemeFamily,
pub current_theme: theme::Theme,
pub rng: rand::prelude::ThreadRng,
}
@@ -18,7 +19,9 @@ impl Chrome {
pub fn new(window: &mut gpui::Window, cx: &mut gpui::Context<Self>) -> Self {
cx.observe_window_appearance(window, |_, window, cx| {
cx.update_global::<app::Global, ()>(|global, cx| {
global.current_theme = window.appearance().into();
global.current_theme = global
.theme_family
.theme_for_appearance(window.appearance());
cx.notify();
});
})