pub struct MultiSelect { /* private fields */ }Implementations§
Source§impl MultiSelect
impl MultiSelect
pub fn new(choices: Vec<Choice>, cx: &mut Context<'_, Self>) -> Self
Sourcepub fn with_create(
self,
normalize: impl Fn(&str) -> Option<SharedString> + 'static,
) -> Self
pub fn with_create( self, normalize: impl Fn(&str) -> Option<SharedString> + 'static, ) -> Self
Offer a “Create” row for a query that names no choice. normalize
turns the query into the name it would create, or None for one that
cannot be a name; the row shows, and MultiSelectEvent::Created
carries, what it answers. Choices are matched against it as given.
Sourcepub fn with_manage(self) -> Self
pub fn with_manage(self) -> Self
Give each row a ··· opening a pane to rename or delete its choice.
Sourcepub fn with_tint(self, tint: impl Fn(&str, &Theme) -> Hsla + 'static) -> Self
pub fn with_tint(self, tint: impl Fn(&str, &Theme) -> Hsla + 'static) -> Self
Colour each name with tint instead of tint.
Sourcepub fn with_width(self, min: Pixels, max: Pixels) -> Self
pub fn with_width(self, min: Pixels, max: Pixels) -> Self
Size the card to its widest row, from min up to max. Equal bounds
fix the width. A name wider than max is cut at the card’s edge.
pub fn choices(&self) -> &[Choice]
Sourcepub fn set_choices(&mut self, choices: Vec<Choice>, cx: &mut Context<'_, Self>)
pub fn set_choices(&mut self, choices: Vec<Choice>, cx: &mut Context<'_, Self>)
Replace the choices — the host’s answer to an event. The query and the open pane stay; a pane whose choice is gone closes.
Trait Implementations§
impl EventEmitter<MultiSelectEvent> for MultiSelect
Source§impl Focusable for MultiSelect
impl Focusable for MultiSelect
Source§fn focus_handle(&self, _: &App) -> FocusHandle
fn focus_handle(&self, _: &App) -> FocusHandle
The context around the fields; one of them holds focus while it is
open — see MultiSelect::reset.
Source§impl Render for MultiSelect
impl Render for MultiSelect
Auto Trait Implementations§
impl !Freeze for MultiSelect
impl !RefUnwindSafe for MultiSelect
impl !Send for MultiSelect
impl !Sync for MultiSelect
impl !UnwindSafe for MultiSelect
impl Unpin for MultiSelect
impl UnsafeUnpin for MultiSelect
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> 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<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