pub struct Choice<'a> { /* private fields */ }Expand description
Choice.
Select one of a list. No editable mode for this widget.
This doesn’t render itself. into_widgets creates the base part and the popup part, which are rendered separately.
Implementations§
Source§impl<'a> Choice<'a>
impl<'a> Choice<'a>
pub fn new() -> Self
Sourcepub fn items(self, items: impl IntoIterator<Item = impl Into<Line<'a>>>) -> Self
pub fn items(self, items: impl IntoIterator<Item = impl Into<Line<'a>>>) -> Self
Button text.
Sourcepub fn default_settable(self) -> Self
pub fn default_settable(self) -> Self
Can return to default with some user interaction.
Sourcepub fn styles(self, styles: ChoiceStyle) -> Self
pub fn styles(self, styles: ChoiceStyle) -> Self
Combined styles.
Style for the down button.
Sourcepub fn select_style(self, style: Style) -> Self
pub fn select_style(self, style: Style) -> Self
Selection in the list.
Sourcepub fn focus_style(self, style: Style) -> Self
pub fn focus_style(self, style: Style) -> Self
Focused style.
Sourcepub fn popup_placement(self, placement: Placement) -> Self
pub fn popup_placement(self, placement: Placement) -> Self
Placement of the popup.
Default Default is BelowOrAbove.
Sourcepub fn popup_boundary(self, boundary: Rect) -> Self
pub fn popup_boundary(self, boundary: Rect) -> Self
Outer boundary for the popup.
Sourcepub fn popup_len(self, len: u16) -> Self
pub fn popup_len(self, len: u16) -> Self
Override the popup length.
Default Defaults to the number of items or 5.
Sourcepub fn popup_style(self, style: Style) -> Self
pub fn popup_style(self, style: Style) -> Self
Base style for the popup.
Sourcepub fn popup_block(self, block: Block<'a>) -> Self
pub fn popup_block(self, block: Block<'a>) -> Self
Block for the popup.
Sourcepub fn popup_scroll(self, scroll: Scroll<'a>) -> Self
pub fn popup_scroll(self, scroll: Scroll<'a>) -> Self
Scroll for the popup.
Sourcepub fn into_widgets(self) -> (ChoiceWidget<'a>, ChoicePopup<'a>)
pub fn into_widgets(self) -> (ChoiceWidget<'a>, ChoicePopup<'a>)
Choice itself doesn’t render.
This builds the widgets from the parameters set for Choice.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Choice<'a>
impl<'a> !RefUnwindSafe for Choice<'a>
impl<'a> !Send for Choice<'a>
impl<'a> !Sync for Choice<'a>
impl<'a> Unpin for Choice<'a>
impl<'a> !UnwindSafe for Choice<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
Converts
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>
Converts
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