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

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,
        viewport: &Rectangle,
        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[src]

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
[src]

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,
    viewport: &Rectangle,
    options: &[T],
    hovered_option: Option<usize>,
    padding: u16,
    text_size: u16,
    font: Self::Font,
    style: &Self::Style
) -> Self::Output
[src]

Draws the list of options of a Menu.

Loading content...

Implementors

Loading content...