[][src]Struct iced_native::overlay::menu::Menu

pub struct Menu<'a, T, Renderer: Renderer> { /* fields omitted */ }

A list of selectable options.

Implementations

impl<'a, T, Renderer> Menu<'a, T, Renderer> where
    T: ToString + Clone,
    Renderer: Renderer + 'a, 
[src]

pub fn new(
    state: &'a mut State,
    options: &'a [T],
    hovered_option: &'a mut Option<usize>,
    last_selection: &'a mut Option<T>
) -> Self
[src]

Creates a new Menu with the given State, a list of options, and the message to produced when an option is selected.

pub fn width(self, width: u16) -> Self[src]

Sets the width of the Menu.

pub fn padding(self, padding: u16) -> Self[src]

Sets the padding of the Menu.

pub fn text_size(self, text_size: u16) -> Self[src]

Sets the text size of the Menu.

pub fn font(self, font: Renderer::Font) -> Self[src]

Sets the font of the Menu.

pub fn style(self, style: impl Into<<Renderer as Renderer>::Style>) -> Self[src]

Sets the style of the Menu.

pub fn overlay<Message: 'a>(
    self,
    position: Point,
    target_height: f32
) -> Element<'a, Message, Renderer>
[src]

Turns the Menu into an overlay Element at the given target position.

The target_height will be used to display the menu either on top of the target or under it, depending on the screen position and the dimensions of the Menu.

Auto Trait Implementations

impl<'a, T, Renderer> RefUnwindSafe for Menu<'a, T, Renderer> where
    T: RefUnwindSafe,
    <Renderer as Renderer>::Font: RefUnwindSafe,
    <Renderer as Renderer>::Style: RefUnwindSafe

impl<'a, T, Renderer> Send for Menu<'a, T, Renderer> where
    T: Send + Sync,
    <Renderer as Renderer>::Font: Send,
    <Renderer as Renderer>::Style: Send

impl<'a, T, Renderer> Sync for Menu<'a, T, Renderer> where
    T: Sync,
    <Renderer as Renderer>::Font: Sync,
    <Renderer as Renderer>::Style: Sync

impl<'a, T, Renderer> Unpin for Menu<'a, T, Renderer> where
    <Renderer as Renderer>::Font: Unpin,
    <Renderer as Renderer>::Style: Unpin

impl<'a, T, Renderer> !UnwindSafe for Menu<'a, T, Renderer>

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,