pub struct SelectorComponent {
pub options: Vec<SelectOption>,
pub selected: usize,
pub scroll_offset: usize,
pub visible: bool,
pub open: f64,
pub reveal: f64,
}Expand description
Select list with scroll, open/reveal animation progress, and bordered layout.
Fields§
§options: Vec<SelectOption>§selected: usize§scroll_offset: usize§visible: bool§open: f64§reveal: f64Implementations§
Source§impl SelectorComponent
impl SelectorComponent
pub fn from_options(options: Vec<SelectOption>, default_index: usize) -> Self
pub fn is_fully_open(&self) -> bool
pub fn is_fully_closed(&self) -> bool
pub fn is_fully_revealed(&self) -> bool
Sourcepub fn viewport_row_count(option_count: usize) -> usize
pub fn viewport_row_count(option_count: usize) -> usize
How many option rows are visible for a list of this length (same cap as SelectorComponent::render).
Sourcepub fn tick_decode(
&mut self,
question_reveal: f64,
box_open_speed: f64,
reveal_speed: f64,
)
pub fn tick_decode( &mut self, question_reveal: f64, box_open_speed: f64, reveal_speed: f64, )
Wizard decode phase: waits until the question’s reveal progress crosses 0.5 (same gate as text entry).
pub fn tick_transition_encode( &mut self, next_has_selector: bool, encode_speed: f64, morph_speed: f64, )
pub fn tick_transition_decode(&mut self, encode_speed: f64, morph_speed: f64)
pub fn tick_exit_close(&mut self, encode_speed: f64, box_close_speed: f64)
pub fn render<W: Write, R: Rng>( &self, writer: &mut W, tw: u16, start_row: u16, rng: &mut R, ) -> Result<usize>
Trait Implementations§
Source§impl Clone for SelectorComponent
impl Clone for SelectorComponent
Source§fn clone(&self) -> SelectorComponent
fn clone(&self) -> SelectorComponent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SelectorComponent
impl RefUnwindSafe for SelectorComponent
impl Send for SelectorComponent
impl Sync for SelectorComponent
impl Unpin for SelectorComponent
impl UnsafeUnpin for SelectorComponent
impl UnwindSafe for SelectorComponent
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