Struct dotrix_egui::Grid[][src]

pub struct Grid { /* fields omitted */ }
Expand description

A simple grid layout.

The cells are always layed out left to right, top-down. The contents of each cell will be aligned to the left and center.

If you want to add multiple widgets to a cell you need to group them with Ui::horizontal, Ui::vertical etc.

egui::Grid::new("some_unique_id").show(ui, |ui| {
    ui.label("First row, first column");
    ui.label("First row, second column");
    ui.end_row();

    ui.label("Second row, first column");
    ui.label("Second row, second column");
    ui.label("Second row, third column");
    ui.end_row();

    ui.horizontal(|ui| { ui.label("Same"); ui.label("cell"); });
    ui.label("Third row, second column");
    ui.end_row();
});

Implementations

Create a new Grid with a locally unique identifier.

Setting this will allow the last column to expand to take up the rest of the space of the parent Ui.

If true, add a subtle background color to every other row.

This can make a table easier to read. Default: false.

Set minimum width of each column. Default: crate::style::Spacing::interact_size.x.

Set minimum height of each row. Default: crate::style::Spacing::interact_size.y.

Set soft maximum width (wrapping width) of each column.

Set spacing between columns/rows. Default: crate::style::Spacing::item_spacing.

Change which row number the grid starts on. This can be useful when you have a large Grid inside of ScrollArea::show_rows.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Constructs wrapped service

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.