Skip to main content

EntryDrawer

Trait EntryDrawer 

Source
pub trait EntryDrawer {
    // Required methods
    fn row_size(&self, ui: &Ui, width: f32) -> Vec2;
    fn row(&mut self, ui: &mut Ui, n: usize, size: Vec2) -> Response;
    fn cell_size(&self, ui: &Ui, side: f32) -> Vec2;
    fn cell(
        &mut self,
        ui: &mut Ui,
        n: usize,
        size: Vec2,
        thumbnail: ThumbState,
    ) -> Response;

    // Provided methods
    fn headers(&mut self, _ui: &mut Ui, _width: f32) { ... }
    fn empty(&mut self, _ui: &mut Ui) { ... }
}
Expand description

Draws the entries a mode lays out, one at a time: the layer that knows its host. A mode owns the layout (the virtualised rows or cells, the scrolling, the keys’ moves, the thumbnails’ order); the drawer owns what an entry looks like and does. The browser’s own is PlainDrawer; the in-app picker gives its rows with their columns, its groups’ badges, the highlight its field drives and its own clicks.

Required Methods§

Source

fn row_size(&self, ui: &Ui, width: f32) -> Vec2

A row’s size, in width of room.

Source

fn row(&mut self, ui: &mut Ui, n: usize, size: Vec2) -> Response

Draws row n.

Source

fn cell_size(&self, ui: &Ui, side: f32) -> Vec2

A cell’s size for a thumbnail side points wide.

Source

fn cell( &mut self, ui: &mut Ui, n: usize, size: Vec2, thumbnail: ThumbState, ) -> Response

Draws cell n; thumbnail is what the provider answered for it.

Provided Methods§

Source

fn headers(&mut self, _ui: &mut Ui, _width: f32)

Above the entries, width wide: column headers that sort. Nothing by default.

Source

fn empty(&mut self, _ui: &mut Ui)

Said instead of the entries when there are none. Nothing by default.

Implementors§