embedded-list 0.2.0

A list component for embedded-graphics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use embedded_graphics::prelude::{DrawTarget, PixelColor, Point};

pub trait ListSource {
    type C: PixelColor;

    fn total_count(&self) -> u8;
    fn height_for_index(&self, index: u8) -> i32;

    fn draw<D: DrawTarget<Color = Self::C>>(
        &self,
        index: u8,
        is_active: bool,
        display: &mut D,
        origin: Point,
    ) -> Result<Point, D::Error>;
}