pub enum PaneNode {
Leaf(Box<Pane>),
Split {
direction: SplitDirection,
ratio: f32,
first: Box<PaneNode>,
second: Box<PaneNode>,
},
}Expand description
Tree node for pane layout
The pane tree is a binary tree where:
- Leaf nodes contain actual terminal panes
- Split nodes contain two children with a split direction and ratio
Variants§
Leaf(Box<Pane>)
A leaf node containing a terminal pane
Split
A split containing two child nodes
Fields
direction: SplitDirectionDirection of the split
Implementations§
Source§impl PaneNode
impl PaneNode
Sourcepub fn split(
direction: SplitDirection,
ratio: f32,
first: PaneNode,
second: PaneNode,
) -> Self
pub fn split( direction: SplitDirection, ratio: f32, first: PaneNode, second: PaneNode, ) -> Self
Create a new split node
Sourcepub fn as_pane_mut(&mut self) -> Option<&mut Pane>
pub fn as_pane_mut(&mut self) -> Option<&mut Pane>
Get mutable pane if this is a leaf node
Sourcepub fn find_pane_mut(&mut self, id: PaneId) -> Option<&mut Pane>
pub fn find_pane_mut(&mut self, id: PaneId) -> Option<&mut Pane>
Find a mutable pane by ID (recursive)
Sourcepub fn find_pane_at(&self, x: f32, y: f32) -> Option<&Pane>
pub fn find_pane_at(&self, x: f32, y: f32) -> Option<&Pane>
Find the pane at a given pixel position
Sourcepub fn all_pane_ids(&self) -> Vec<PaneId> ⓘ
pub fn all_pane_ids(&self) -> Vec<PaneId> ⓘ
Get all pane IDs in this subtree
Sourcepub fn all_panes_mut(&mut self) -> Vec<&mut Pane>
pub fn all_panes_mut(&mut self) -> Vec<&mut Pane>
Get all mutable panes in this subtree
Sourcepub fn pane_count(&self) -> usize
pub fn pane_count(&self) -> usize
Count total number of panes
Sourcepub fn calculate_bounds(&mut self, bounds: PaneBounds, divider_width: f32)
pub fn calculate_bounds(&mut self, bounds: PaneBounds, divider_width: f32)
Calculate bounds for all panes given the total available area
This recursively distributes space according to split ratios and updates each pane’s bounds field.
Sourcepub fn find_pane_in_direction(
&self,
from_id: PaneId,
direction: NavigationDirection,
) -> Option<PaneId>
pub fn find_pane_in_direction( &self, from_id: PaneId, direction: NavigationDirection, ) -> Option<PaneId>
Find the closest pane in a given direction from the focused pane
Returns the pane ID of the closest pane in the specified direction, or None if there is no pane in that direction.
Sourcepub fn collect_dividers(
&self,
bounds: PaneBounds,
divider_width: f32,
) -> Vec<DividerRect>
pub fn collect_dividers( &self, bounds: PaneBounds, divider_width: f32, ) -> Vec<DividerRect>
Collect all divider rectangles in the pane tree
Returns a list of DividerRect structures that can be used for:
- Rendering divider lines between panes
- Hit testing for mouse drag resize
Auto Trait Implementations§
impl Freeze for PaneNode
impl !RefUnwindSafe for PaneNode
impl Send for PaneNode
impl Sync for PaneNode
impl Unpin for PaneNode
impl UnsafeUnpin for PaneNode
impl !UnwindSafe for PaneNode
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more