pub struct ResizableState { /* private fields */ }Expand description
State for a ResizablePanel
Implementations§
Source§impl ResizableState
impl ResizableState
Sourcepub fn is_resizing(&self) -> bool
pub fn is_resizing(&self) -> bool
Whether a resize handle is being dragged.
Starting a drag does not notify, so read this while rendering during the drag rather than relying on a notification when it starts.
Sourcepub fn resize_panel(
&mut self,
ix: usize,
size: Pixels,
window: &mut Window,
cx: &mut Context<'_, ResizableState>,
)
pub fn resize_panel( &mut self, ix: usize, size: Pixels, window: &mut Window, cx: &mut Context<'_, ResizableState>, )
Programmatically resize the panel at ix to size, redistributing
space among siblings using the same logic as a drag.
The size change respects the visible panels’ size_range and available space.
Emits ResizablePanelEvent::Resized so subscribers (e.g. preference
persistence) see the change just as if the user had dragged a handle.
Hidden panels and out-of-range indices are ignored. The last visible panel resizes using the boundary with its previous visible sibling.
Sourcepub fn insert_panel(
&mut self,
size: Option<Pixels>,
ix: Option<usize>,
cx: &mut Context<'_, ResizableState>,
)
pub fn insert_panel( &mut self, size: Option<Pixels>, ix: Option<usize>, cx: &mut Context<'_, ResizableState>, )
Insert a panel state at ix, or append it when no index is supplied.
Existing panel sizes are redistributed so their total remains equal to the current container size.
Sourcepub fn remove_panel(
&mut self,
panel_ix: usize,
cx: &mut Context<'_, ResizableState>,
)
pub fn remove_panel( &mut self, panel_ix: usize, cx: &mut Context<'_, ResizableState>, )
Remove the panel at panel_ix and redistribute the remaining space.
Sourcepub fn reset_panel(
&mut self,
panel_ix: usize,
cx: &mut Context<'_, ResizableState>,
)
pub fn reset_panel( &mut self, panel_ix: usize, cx: &mut Context<'_, ResizableState>, )
Reset the panel at panel_ix while preserving its current size.
Sourcepub fn container_size(&self) -> Pixels
pub fn container_size(&self) -> Pixels
Return the measured size of the group along its resize axis.
Trait Implementations§
Source§impl Clone for ResizableState
impl Clone for ResizableState
Source§fn clone(&self) -> ResizableState
fn clone(&self) -> ResizableState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResizableState
impl Debug for ResizableState
Source§impl Default for ResizableState
impl Default for ResizableState
Source§fn default() -> ResizableState
fn default() -> ResizableState
impl EventEmitter<ResizablePanelEvent> for ResizableState
Auto Trait Implementations§
impl Forget for ResizableState
impl Freeze for ResizableStatewhere
*const u8 is !null: Freeze,
PhantomData<ResizablePanelState>: Freeze,
PhantomData<Pixels>: Freeze,
impl Move for ResizableState
impl RefUnwindSafe for ResizableState
impl Send for ResizableStatewhere
RawVecInner: Send,
impl Sync for ResizableStatewhere
RawVecInner: Sync,
impl Unpin for ResizableState
impl UnsafeUnpin for ResizableStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<ResizablePanelState>: UnsafeUnpin,
PhantomData<Pixels>: UnsafeUnpin,
impl UnwindSafe for ResizableStatewhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().