pub struct NodeLayout { /* private fields */ }Expand description
Node layout container
Implementations§
Source§impl NodeLayout
impl NodeLayout
Sourcepub fn add_pane(&mut self, pane: LayoutPane, position: Pos2) -> &mut Self
pub fn add_pane(&mut self, pane: LayoutPane, position: Pos2) -> &mut Self
Add a pane at a position
Sourcepub fn remove_pane(&mut self, id: &str) -> Option<LayoutPane>
pub fn remove_pane(&mut self, id: &str) -> Option<LayoutPane>
Remove a pane by id
Sourcepub fn get_pane(&self, id: &str) -> Option<&LayoutPane>
pub fn get_pane(&self, id: &str) -> Option<&LayoutPane>
Get a pane by id
Sourcepub fn get_pane_mut(&mut self, id: &str) -> Option<&mut LayoutPane>
pub fn get_pane_mut(&mut self, id: &str) -> Option<&mut LayoutPane>
Get a mutable pane by id
Sourcepub fn panes(&self) -> impl Iterator<Item = &LayoutPane>
pub fn panes(&self) -> impl Iterator<Item = &LayoutPane>
Iterate over all panes
Sourcepub fn panes_mut(&mut self) -> impl Iterator<Item = &mut LayoutPane>
pub fn panes_mut(&mut self) -> impl Iterator<Item = &mut LayoutPane>
Iterate over all panes mutably
Sourcepub fn has_overlaps(&self, gap: f32) -> bool
pub fn has_overlaps(&self, gap: f32) -> bool
Check if any panes are overlapping (considering gap)
Sourcepub fn resolve_overlaps(&mut self, gap: f32) -> Vec<String>
pub fn resolve_overlaps(&mut self, gap: f32) -> Vec<String>
Resolve overlapping panes by pushing them apart.
Returns the IDs of panes that were moved.
Sourcepub fn resolve_overlaps_anchored(
&mut self,
gap: f32,
anchor_strength: f32,
) -> Vec<String>
pub fn resolve_overlaps_anchored( &mut self, gap: f32, anchor_strength: f32, ) -> Vec<String>
Resolve overlaps while keeping panes close to their original positions.
anchor_strength controls how strongly panes are pulled back (0.0 - 1.0).
Returns the IDs of panes that were moved.
Sourcepub fn count_overlaps(&self, gap: f32) -> usize
pub fn count_overlaps(&self, gap: f32) -> usize
Count overlapping pane pairs
Sourcepub fn auto_arrange(
&mut self,
strategy: ArrangeStrategy,
gap: f32,
origin: Option<Pos2>,
z_order_ids: Option<&[String]>,
) -> Vec<String>
pub fn auto_arrange( &mut self, strategy: ArrangeStrategy, gap: f32, origin: Option<Pos2>, z_order_ids: Option<&[String]>, ) -> Vec<String>
Auto-arrange panes using the specified strategy.
§Arguments
strategy- The arrangement strategy to usegap- Gap between panesorigin- Optional origin point (defaults to current bounding box min or (0,0))z_order_ids- Optional Z-order for Cascade (back-to-front pane IDs). First ID = back (top-left), last ID = front (bottom-right).
§Returns
IDs of panes that were moved
Sourcepub fn bounding_box(&self) -> Option<Rect>
pub fn bounding_box(&self) -> Option<Rect>
Get the bounding box of all visible panes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeLayout
impl RefUnwindSafe for NodeLayout
impl Send for NodeLayout
impl Sync for NodeLayout
impl Unpin for NodeLayout
impl UnsafeUnpin for NodeLayout
impl UnwindSafe for NodeLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.