Get a 50% colored box rendering
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
parent
740b105330
commit
f9858445b8
8 changed files with 130 additions and 49 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue