pub struct Panel {
pub default: Extent,
pub min: Extent,
pub max: Extent,
pub collapsible: bool,
pub collapsed_size: Extent,
pub collapse_below: Option<Extent>,
pub collapsed: bool,
}Available on crate feature
resizable-panel only.Expand description
The constraints of one panel.
Fields§
§default: ExtentThe starting size. Fractions share out the space the pixel panels leave.
min: Extent§max: Extent§collapsible: boolWhether the panel snaps shut below its threshold.
collapsed_size: ExtentThe size of the panel while collapsed.
collapse_below: Option<Extent>Below this size a collapsible panel snaps shut. Defaults to halfway between the collapsed size and the minimum.
collapsed: boolWhether the panel starts collapsed.
Implementations§
Source§impl Panel
impl Panel
pub fn min(self, min: Extent) -> Self
pub fn max(self, max: Extent) -> Self
pub fn collapsible(self, collapsible: bool) -> Self
Sourcepub fn collapsed_size(self, size: Extent) -> Self
pub fn collapsed_size(self, size: Extent) -> Self
The size while collapsed, such as the width of an icon rail.
pub fn collapse_below(self, threshold: Extent) -> Self
Sourcepub fn collapsed(self, collapsed: bool) -> Self
pub fn collapsed(self, collapsed: bool) -> Self
Starts the panel collapsed. Only applies to a collapsible panel.
Sourcepub fn limits(&self, total: f32) -> Limits
pub fn limits(&self, total: f32) -> Limits
The minimum, maximum and collapsed sizes in pixels. The maximum is never below the minimum.
Sourcepub fn settle(&self, size: f32, total: f32) -> f32
pub fn settle(&self, size: f32, total: f32) -> f32
The nearest size this panel can take to size: collapsed below the
threshold when collapsible, otherwise within its minimum and maximum.
Sourcepub fn is_collapsed_at(&self, size: f32, total: f32) -> bool
pub fn is_collapsed_at(&self, size: f32, total: f32) -> bool
Whether a panel of size pixels is collapsed.
Trait Implementations§
impl Copy for Panel
impl StructuralPartialEq for Panel
Auto Trait Implementations§
impl Freeze for Panel
impl RefUnwindSafe for Panel
impl Send for Panel
impl Sync for Panel
impl Unpin for Panel
impl UnsafeUnpin for Panel
impl UnwindSafe for Panel
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>)
Turns some type into the initial state of some
Application.