Get a 50% colored box rendering
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
co-authored by
Mikayla Maki
parent
740b105330
commit
f9858445b8
@@ -214,12 +214,12 @@ impl<'a> WindowContext<'a> {
|
||||
self.window.layout_engines.last_mut()
|
||||
}
|
||||
|
||||
pub fn push_layout_engine(&mut self) {
|
||||
self.window.layout_engines.push(LayoutEngine::new());
|
||||
pub fn push_layout_engine(&mut self, engine: LayoutEngine) {
|
||||
self.window.layout_engines.push(engine);
|
||||
}
|
||||
|
||||
pub fn pop_layout_engine(&mut self) {
|
||||
self.window.layout_engines.pop();
|
||||
pub fn pop_layout_engine(&mut self) -> Option<LayoutEngine> {
|
||||
self.window.layout_engines.pop()
|
||||
}
|
||||
|
||||
pub fn remove_window(&mut self) {
|
||||
@@ -1235,12 +1235,13 @@ impl<'a> WindowContext<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct LayoutEngine(Taffy);
|
||||
pub use taffy::style::Style as LayoutStyle;
|
||||
|
||||
impl LayoutEngine {
|
||||
fn new() -> Self {
|
||||
Self(Taffy::new())
|
||||
pub fn new() -> Self {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
pub fn add_node<C>(&mut self, style: LayoutStyle, children: C) -> Result<LayoutNodeId>
|
||||
|
||||
@@ -28,7 +28,7 @@ pub mod keymap_matcher;
|
||||
pub mod platform;
|
||||
pub use gpui_macros::{test, Element};
|
||||
pub use window::{
|
||||
Axis, Layout, LayoutNodeId, RectFExt, SizeConstraint, Vector2FExt, WindowContext,
|
||||
Axis, Layout, LayoutEngine, LayoutNodeId, RectFExt, SizeConstraint, Vector2FExt, WindowContext,
|
||||
};
|
||||
|
||||
pub use anyhow;
|
||||
|
||||
Reference in New Issue
Block a user