Expand description
A rectangle which automatically determines the positions and sizes of things withing it
A Pane
can have any number of child Panes
, each of which has a size
constrained by their parent Pane
. The size and position of each child
pane depends on its weight relative to its siblings as well as the split
Orientation
of its parent. This allows panes to be resized while keeping
all their child panes consistently sized.
A pane can also have optional contents. Contents will be resized to fit
the Pane
Implementations
sourceimpl<R> Pane<R>where
R: Rectangle,
impl<R> Pane<R>where
R: Rectangle,
sourcepub fn children(&self) -> impl DoubleEndedIterator<Item = &Pane<R>>
pub fn children(&self) -> impl DoubleEndedIterator<Item = &Pane<R>>
Immutable iterate over the Pane
’s children
sourcepub fn children_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Pane<R>>
pub fn children_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Pane<R>>
Mutable iterate over the Pane
’s children
sourcepub fn with_contents(self, contents: Contents<R::Scalar>) -> Self
pub fn with_contents(self, contents: Contents<R::Scalar>) -> Self
Change the Pane
’s contents
sourcepub fn with_no_contents(self) -> Self
pub fn with_no_contents(self) -> Self
Remove the Pane
’s contents
sourcepub fn with_size<T, V>(self, size: V) -> Selfwhere
T: Scalar,
R::Scalar: From<T>,
V: Vector2<Scalar = T>,
pub fn with_size<T, V>(self, size: V) -> Selfwhere
T: Scalar,
R::Scalar: From<T>,
V: Vector2<Scalar = T>,
Set the Pane
’s size
sourcepub fn with_top_left<T, V>(self, top_left: V) -> Selfwhere
T: Scalar,
R::Scalar: From<T>,
V: Vector2<Scalar = T>,
pub fn with_top_left<T, V>(self, top_left: V) -> Selfwhere
T: Scalar,
R::Scalar: From<T>,
V: Vector2<Scalar = T>,
Set the position of the Pane
’s top-left corner
sourcepub fn with_panes<'a, P, I>(self, panes: I) -> Selfwhere
P: NamedWeightedPane<'a, R>,
I: IntoIterator<Item = P>,
pub fn with_panes<'a, P, I>(self, panes: I) -> Selfwhere
P: NamedWeightedPane<'a, R>,
I: IntoIterator<Item = P>,
Set the Pane
’s inner Pane
s. Each inner Pane
has a
weight which defines how it is resized relative to its
siblings. Pane
s can also have optional names that can be
used to index their parent.
sourcepub fn orientation(&self) -> Orientation
pub fn orientation(&self) -> Orientation
Get the split orientation of the Pane
’s children
sourcepub fn with_orientation(self, orientation: Orientation) -> Self
pub fn with_orientation(self, orientation: Orientation) -> Self
Set the split orientation of the Pane
’s children
sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Set the Pane
’s color
sourcepub fn with_margin(self, margin: R::Scalar) -> Self
pub fn with_margin(self, margin: R::Scalar) -> Self
Set the Pane
’s margin
sourcepub fn margin_rect(&self) -> R
pub fn margin_rect(&self) -> R
Get the inner rectangle created by the Pane
and its margin
sourcepub fn fit_text<C>(self, glyphs: &mut C) -> Selfwhere
C: CharacterWidthCache<Scalar = R::Scalar>,
pub fn fit_text<C>(self, glyphs: &mut C) -> Selfwhere
C: CharacterWidthCache<Scalar = R::Scalar>,
Recursively fit the text of any Contents::Text
in the Pane
’s tree
Trait Implementations
sourceimpl<R: Clone> Clone for Pane<R>where
R: Rectangle,
R::Scalar: Clone,
R::Scalar: Clone,
R::Scalar: Clone,
impl<R: Clone> Clone for Pane<R>where
R: Rectangle,
R::Scalar: Clone,
R::Scalar: Clone,
R::Scalar: Clone,
sourceimpl<R: Debug> Debug for Pane<R>where
R: Rectangle,
R::Scalar: Debug,
R::Scalar: Debug,
R::Scalar: Debug,
impl<R: Debug> Debug for Pane<R>where
R: Rectangle,
R::Scalar: Debug,
R::Scalar: Debug,
R::Scalar: Debug,
sourceimpl<'a, R> NamedWeightedPane<'a, R> for Pane<R>where
R: Rectangle,
impl<'a, R> NamedWeightedPane<'a, R> for Pane<R>where
R: Rectangle,
Auto Trait Implementations
impl<R> RefUnwindSafe for Pane<R>where
R: RefUnwindSafe,
<R as Rectangle>::Scalar: RefUnwindSafe,
impl<R> Send for Pane<R>where
R: Send,
<R as Rectangle>::Scalar: Send,
impl<R> Sync for Pane<R>where
R: Sync,
<R as Rectangle>::Scalar: Sync,
impl<R> Unpin for Pane<R>where
R: Unpin,
<R as Rectangle>::Scalar: Unpin,
impl<R> UnwindSafe for Pane<R>where
R: UnwindSafe,
<R as Rectangle>::Scalar: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
value
as a parameter of self
.