pub enum GroupLayout {
Leaf(usize),
Split {
direction: SplitDirection,
ratio: f32,
first: Box<GroupLayout>,
second: Box<GroupLayout>,
},
}Expand description
Recursive binary split tree describing how panes are arranged.
Leaf(k) references the pane at index k in the controller’s internal
pane vec. Split describes how a rect is divided between two sub-trees.
In-order leaf traversal gives panes from first (left/top) to last
(right/bottom). In-order split traversal gives dividers in the same
display order, matching the divider_idx used in events and
handle_drag_start.
The controller maintains the invariant that every pane vec index 0..n
appears exactly once as a leaf, so Leaf(k) always corresponds to pane
k in the vec.
Variants§
Leaf(usize)
A single pane (referenced by vec index).
Split
A binary split: first occupies ratio of the parent rect,
second gets the rest.
Fields
direction: SplitDirectionSplit orientation for this node.
first: Box<GroupLayout>Left/top sub-tree.
second: Box<GroupLayout>Right/bottom sub-tree.
Implementations§
Source§impl GroupLayout
impl GroupLayout
Sourcepub fn leaf_count(&self) -> usize
pub fn leaf_count(&self) -> usize
Number of leaves in the tree.
Trait Implementations§
Source§impl Clone for GroupLayout
impl Clone for GroupLayout
Source§impl Debug for GroupLayout
impl Debug for GroupLayout
Source§impl PartialEq for GroupLayout
impl PartialEq for GroupLayout
impl StructuralPartialEq for GroupLayout
Auto Trait Implementations§
impl Freeze for GroupLayout
impl RefUnwindSafe for GroupLayout
impl Send for GroupLayout
impl Sync for GroupLayout
impl Unpin for GroupLayout
impl UnsafeUnpin for GroupLayout
impl UnwindSafe for GroupLayout
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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