Add cx.theme auto import to support WindowContent.

This commit is contained in:
Jason Lee 2024-07-19 11:32:25 +08:00
parent 613cfebb65
commit a69d30be6a

View file

@ -2,7 +2,7 @@ use std::ops::Deref;
use gpui::{
hsla, point, AppContext, BoxShadow, Global, Hsla, ModelContext, Pixels, SharedString,
ViewContext, WindowAppearance,
ViewContext, WindowAppearance, WindowContext,
};
pub trait ActiveTheme {
@ -27,6 +27,12 @@ impl<'a, V> ActiveTheme for ModelContext<'a, V> {
}
}
impl<'a> ActiveTheme for WindowContext<'a> {
fn theme(&self) -> &Theme {
self.deref().theme()
}
}
/// Make a [gpui::Hsla] color.
///
/// h - 0 - 360.0