pub struct ResizablePanelGroup { /* private fields */ }Expand description
A group of resizable panels.
Implementations§
Source§impl ResizablePanelGroup
impl ResizablePanelGroup
Sourcepub fn new(id: impl Into<ElementId>) -> ResizablePanelGroup
pub fn new(id: impl Into<ElementId>) -> ResizablePanelGroup
Create a new resizable panel group.
Sourcepub fn with_handle_appearance(
self,
appearance: Rc<dyn Fn(&ResizeHandleContext, &mut Window, &mut App) -> Option<AnyElement>>,
) -> ResizablePanelGroup
pub fn with_handle_appearance( self, appearance: Rc<dyn Fn(&ResizeHandleContext, &mut Window, &mut App) -> Option<AnyElement>>, ) -> ResizablePanelGroup
Hand the painted part of every divider in this group to appearance.
The hit area, the cursor and the drag stay here; a renderer that
returns None for a given handle leaves the built-in line on it.
Sourcepub fn with_state(self, state: &Entity<ResizableState>) -> ResizablePanelGroup
pub fn with_state(self, state: &Entity<ResizableState>) -> ResizablePanelGroup
Bind yourself to a resizable state entity.
If not provided, it will handle its own state internally.
Sourcepub fn axis(self, axis: Axis) -> ResizablePanelGroup
pub fn axis(self, axis: Axis) -> ResizablePanelGroup
Set the axis of the resizable panel group, default is horizontal.
Sourcepub fn child(self, panel: impl Into<ResizablePanel>) -> ResizablePanelGroup
pub fn child(self, panel: impl Into<ResizablePanel>) -> ResizablePanelGroup
Add a panel to the group.
- The
axiswill be set to the same axis as the group. - The
initial_sizewill be set to the average size of all panels if not provided. - The
groupwill be set to the group entity.
Sourcepub fn children<I>(
self,
panels: impl IntoIterator<Item = I>,
) -> ResizablePanelGroupwhere
I: Into<ResizablePanel>,
pub fn children<I>(
self,
panels: impl IntoIterator<Item = I>,
) -> ResizablePanelGroupwhere
I: Into<ResizablePanel>,
Add multiple panels to the group.
Sourcepub fn size(self, size: Pixels) -> ResizablePanelGroup
pub fn size(self, size: Pixels) -> ResizablePanelGroup
Set size of the resizable panel group
- When the axis is horizontal, the size is the height of the group.
- When the axis is vertical, the size is the width of the group.
Sourcepub fn on_resize(
self,
on_resize: impl Fn(&Entity<ResizableState>, &mut Window, &mut App) + 'static,
) -> ResizablePanelGroup
pub fn on_resize( self, on_resize: impl Fn(&Entity<ResizableState>, &mut Window, &mut App) + 'static, ) -> ResizablePanelGroup
Set the callback to be called when the panels are resized.
§Callback arguments
- Entity
: The state of the ResizablePanelGroup.
Trait Implementations§
impl EventEmitter<ResizablePanelEvent> for ResizablePanelGroup
Source§impl From<ResizablePanelGroup> for ResizablePanel
impl From<ResizablePanelGroup> for ResizablePanel
Source§fn from(value: ResizablePanelGroup) -> ResizablePanel
fn from(value: ResizablePanelGroup) -> ResizablePanel
Converts to this type from the input type.
Source§impl IntoElement for ResizablePanelGroup
impl IntoElement for ResizablePanelGroup
Source§type Element = ViewElement<ResizablePanelGroup>
type Element = ViewElement<ResizablePanelGroup>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> <ResizablePanelGroup as IntoElement>::Element
fn into_element(self) -> <ResizablePanelGroup as IntoElement>::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
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 this component into an element tree. Note that this method
takes ownership of self, as compared to
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,
Render this component or element with an animation
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,
Render this component or element with a chain of animations
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>
Renders this component or element at the value produced by a spring. Read more
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> 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,
Imperatively modify self with the given closure.
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,
Conditionally modify self with the given closure.
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,
Conditionally modify self with the given closure.
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> ⓘ
Converts
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> ⓘ
Converts
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