pub struct ResizablePanelGroup { /* private fields */ }Expand description
A row or column of ResizablePanels with a drag handle between each
pair. See the module docs.
Implementations§
Source§impl ResizablePanelGroup
impl ResizablePanelGroup
Sourcepub fn new(id: impl Into<ElementId>) -> Self
pub fn new(id: impl Into<ElementId>) -> Self
An empty horizontal group. id keys its sizes, drag and handle focus;
give every instance its own.
Sourcepub fn orientation(self, orientation: Orientation) -> Self
pub fn orientation(self, orientation: Orientation) -> Self
Side by side (Horizontal, the default) or stacked (Vertical).
Sourcepub fn panel(self, panel: ResizablePanel) -> Self
pub fn panel(self, panel: ResizablePanel) -> Self
Appends a panel.
Sourcepub fn panels(self, panels: impl IntoIterator<Item = ResizablePanel>) -> Self
pub fn panels(self, panels: impl IntoIterator<Item = ResizablePanel>) -> Self
Appends several panels.
Sourcepub fn sizes(self, sizes: impl IntoIterator<Item = f32>) -> Self
pub fn sizes(self, sizes: impl IntoIterator<Item = f32>) -> Self
Controlled sizes in percent, one per panel. The group then reports
every resize through Self::on_resize and renders only what it is
given, normalized as the defaults are: scaled to sum to 100 (split
evenly when they sum to zero; negative or non-finite entries count as
zero) and moved inside the panels’ limits. A list whose length does not
match the panels is ignored in favour of the defaults.
Sourcepub fn keyboard_step(self, percent: f32) -> Self
pub fn keyboard_step(self, percent: f32) -> Self
How far one arrow key moves a handle, in percent (default 5; Shift moves four times as far).
Sourcepub fn is_disabled(self, disabled: bool) -> Self
pub fn is_disabled(self, disabled: bool) -> Self
A disabled group draws its handles but does not resize, and its handles leave the tab order.
Sourcepub fn on_resize(
self,
f: impl Fn(&[f32], &mut Window, &mut App) + 'static,
) -> Self
pub fn on_resize( self, f: impl Fn(&[f32], &mut Window, &mut App) + 'static, ) -> Self
Runs with every panel’s size, in percent, whenever a drag or a key changes them.
Sourcepub fn on_resize_end(
self,
f: impl Fn(&[f32], &mut Window, &mut App) + 'static,
) -> Self
pub fn on_resize_end( self, f: impl Fn(&[f32], &mut Window, &mut App) + 'static, ) -> Self
Runs with every panel’s size, in percent, once a resize gesture ends: at the release of a drag that changed the sizes, and after each key (arrow, Home, End, Enter) that did. For persisting a layout without writing on every pointer move.
Trait Implementations§
Source§impl Disableable for ResizablePanelGroup
impl Disableable for ResizablePanelGroup
Source§fn is_disabled(self, disabled: bool) -> Self
fn is_disabled(self, disabled: bool) -> Self
isDisabled — whether the component is disabled.Source§impl IntoElement for ResizablePanelGroup
impl IntoElement for ResizablePanelGroup
Source§type Element = ViewElement<ResizablePanelGroup>
type Element = ViewElement<ResizablePanelGroup>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for ResizablePanelGroup
impl RenderOnce for ResizablePanelGroup
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for ResizablePanelGroup
impl !Send for ResizablePanelGroup
impl !Sync for ResizablePanelGroup
impl !UnwindSafe for ResizablePanelGroup
impl Freeze for ResizablePanelGroup
impl Unpin for ResizablePanelGroup
impl UnsafeUnpin for ResizablePanelGroup
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
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