pub struct Dropdown { /* private fields */ }Expand description
A select control: a trigger showing the current option; tapping opens a
Menu of options below it; choosing one calls on_change(index).
Implementations§
Source§impl Dropdown
impl Dropdown
pub fn new( options: Vec<impl Into<String>>, selected: usize, open: Atom<bool>, ) -> Self
pub fn width(self, w: f32) -> Self
pub fn disabled(self) -> Self
Sourcepub fn background(self, c: Color) -> Self
pub fn background(self, c: Color) -> Self
Trigger fill color (theme’s surface_variant if unset).
pub fn border(self, c: Color, w: f32) -> Self
pub fn radius(self, r: f32) -> Self
pub fn on_change(self, f: impl Fn(usize) + Send + Sync + 'static) -> Self
Trait Implementations§
Source§impl Widget for Dropdown
impl Widget for Dropdown
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for Dropdown
impl !UnwindSafe for Dropdown
impl Freeze for Dropdown
impl Send for Dropdown
impl Sync for Dropdown
impl Unpin for Dropdown
impl UnsafeUnpin for Dropdown
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<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.