pub struct State { /* private fields */ }resizable-panel only.Expand description
The panels, their sizes and any drag in progress.
Implementations§
Source§impl State
impl State
Sourcepub fn new(panels: impl IntoIterator<Item = Panel>) -> Self
pub fn new(panels: impl IntoIterator<Item = Panel>) -> Self
A group of panels at their default sizes.
Sourcepub fn with_sizes(self, sizes: impl IntoIterator<Item = f32>) -> Self
pub fn with_sizes(self, sizes: impl IntoIterator<Item = f32>) -> Self
Starts from saved sizes, as returned by State::sizes. Sizes of
the wrong length or adding up to nothing are ignored; the rest are
scaled to add up to 1.
Sourcepub fn set_sizes(&mut self, sizes: impl IntoIterator<Item = f32>)
pub fn set_sizes(&mut self, sizes: impl IntoIterator<Item = f32>)
Replaces the sizes, as State::with_sizes does, fitting them to
the panels’ limits once the group has been measured.
Sourcepub fn step(self, step: Extent) -> Self
pub fn step(self, step: Extent) -> Self
How far the arrow keys move a handle. Defaults to 5% of the space.
Sourcepub fn large_step(self, step: Extent) -> Self
pub fn large_step(self, step: Extent) -> Self
How far Shift and an arrow key move a handle. Defaults to 20%.
pub fn panels(&self) -> &[Panel]
Sourcepub fn sizes(&self) -> Vec<f32>
pub fn sizes(&self) -> Vec<f32>
Each panel’s share of the space, adding up to 1, for saving and
restoring with State::with_sizes. Before the group is first
measured this is the defaults as fractions, or empty when a default
is in pixels.
Sourcepub fn total(&self) -> f32
pub fn total(&self) -> f32
The pixels the panels share, as last measured. 0 before the first measurement.
pub fn is_collapsed(&self, panel: usize) -> bool
Trait Implementations§
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Forget for State
impl Freeze for Statewhere
*const u8 is !null: Freeze,
PhantomData<Panel>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<bool>: Freeze,
PhantomData<Option<f32>>: Freeze,
impl Move for State
impl RefUnwindSafe for State
impl Send for Statewhere
RawVecInner: Send,
impl Sync for Statewhere
RawVecInner: Sync,
impl Unpin for State
impl UnsafeUnpin for Statewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Panel>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<bool>: UnsafeUnpin,
PhantomData<Option<f32>>: UnsafeUnpin,
impl UnwindSafe for Statewhere
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,
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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.