Add cx.theme auto import to support WindowContent.
This commit is contained in:
parent
613cfebb65
commit
a69d30be6a
1 changed files with 7 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ use std::ops::Deref;
|
||||||
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
hsla, point, AppContext, BoxShadow, Global, Hsla, ModelContext, Pixels, SharedString,
|
hsla, point, AppContext, BoxShadow, Global, Hsla, ModelContext, Pixels, SharedString,
|
||||||
ViewContext, WindowAppearance,
|
ViewContext, WindowAppearance, WindowContext,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait ActiveTheme {
|
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.
|
/// Make a [gpui::Hsla] color.
|
||||||
///
|
///
|
||||||
/// h - 0 - 360.0
|
/// h - 0 - 360.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue