Struct FlapState
pub struct FlapState { /* private fields */ }Expand description
The eased reveal shared by every flap. See the module docs.
Implementations§
§impl FlapState
impl FlapState
pub fn open_when_docked() -> FlapState
pub fn open_when_docked() -> FlapState
A flap that is open when docked (the common navigation sidebar).
pub fn closed_by_default() -> FlapState
pub fn closed_by_default() -> FlapState
A flap that is closed even when docked — summoned on demand.
pub fn is_open(&self, layout: SplitLayout) -> bool
pub fn is_open(&self, layout: SplitLayout) -> bool
Whether the flap is currently open in layout, resolving the
person’s choice against the layout default.
pub fn toggle(&mut self, layout: SplitLayout)
pub fn toggle(&mut self, layout: SplitLayout)
Flip the flap relative to its resolved openness in layout.
pub fn open(&mut self)
pub fn open(&mut self)
Open the flap in the current layout.
pub fn close(&mut self)
pub fn close(&mut self)
Close the flap in the current layout (scrim, Esc, a choice made in a drawer).
pub fn settle(&mut self, layout: SplitLayout)
pub fn settle(&mut self, layout: SplitLayout)
Jump the reveal to the resolved openness without recording a choice.
pub fn reconcile(&mut self, layout: SplitLayout)
pub fn reconcile(&mut self, layout: SplitLayout)
Note the layout the flap is laid out in. The first call settles the reveal (the constructor guessed before any width was known); a later change drops a transient overlay choice and settles to the new layout’s resolved state, so a resize is a structural jump, never a slide.
pub fn tick(&mut self, layout: SplitLayout, dt: f64, duration: Duration) -> bool
pub fn tick(&mut self, layout: SplitLayout, dt: f64, duration: Duration) -> bool
Advance toward the target by dt, taking duration for a whole
open or close. Returns whether it is still moving.
pub fn reveal(&self) -> f64
pub fn reveal(&self) -> f64
The eased reveal in 0..=1: the docked width share, the overlay
slide and the scrim strength.
pub fn is_animating(&self, layout: SplitLayout) -> bool
pub fn is_animating(&self, layout: SplitLayout) -> bool
Whether the reveal is still moving toward the resolved state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlapState
impl RefUnwindSafe for FlapState
impl Send for FlapState
impl Sync for FlapState
impl Unpin for FlapState
impl UnsafeUnpin for FlapState
impl UnwindSafe for FlapState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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