[][src]Trait iced_native::overlay::menu::Renderer

pub trait Renderer: Renderer + Renderer + Renderer {
    type Style: Default + Clone;
    fn decorate(
        &mut self,
        bounds: Rectangle,
        cursor_position: Point,
        style: &Self::Style,
        primitive: Self::Output
    ) -> Self::Output;
fn draw<T: ToString>(
        &mut self,
        bounds: Rectangle,
        cursor_position: Point,
        options: &[T],
        hovered_option: Option<usize>,
        padding: u16,
        text_size: u16,
        font: Self::Font,
        style: &Self::Style
    ) -> Self::Output; }

The renderer of a Menu.

Your renderer will need to implement this trait before being able to use a Menu in your user interface.

Associated Types

type Style: Default + Clone

The Menu style supported by this renderer.

Loading content...

Required methods

fn decorate(
    &mut self,
    bounds: Rectangle,
    cursor_position: Point,
    style: &Self::Style,
    primitive: Self::Output
) -> Self::Output

Decorates a the list of options of a Menu.

This method can be used to draw a background for the Menu.

fn draw<T: ToString>(
    &mut self,
    bounds: Rectangle,
    cursor_position: Point,
    options: &[T],
    hovered_option: Option<usize>,
    padding: u16,
    text_size: u16,
    font: Self::Font,
    style: &Self::Style
) -> Self::Output

Draws the list of options of a Menu.

Loading content...

Implementors

Loading content...