Create dynamic grid layouts for egui
.
Grids are flexible, easy to create, with behavior similar to egui_extra's strip creation. They're compact and allow for more complex layouts using less indentation, with functionalities like nesting grids and aligning cells within a row.
Add this to your Cargo.toml
:
toml
[dependencies]
egui_grid = "0.2.0"
``` rust // Quick example, by no means does it fully demo // how flexible building grids can be. use eguigrid::GridBuilder; use eguiextras::Size;
GridBuilder::new() // Allocate a new row .newrow(Size::exact(200.0)) // Give this row a couple cells .cell(Size::exact(85.0)) .cell(Size::remainder()) // Allocate another row .newrow(Size::remainder()) // Batch method, allocate multiple cells at once .cells(Size::remainder(), 3) .show(ui, |mut grid| { // Cells are represented as they were allocated grid.cell(|ui| { ui.label("Top row, left cell"); }); grid.cell(|ui| { ui.label("Top row, right cell"); }); grid.cell(|ui| { ui.label("Bottom row, left cell"); }); grid.empty(); grid.cell(|ui| { ui.label("Bottom row, right cell"); }); }); ```
Check the docs for details and more info on usage.
Currently this is feature complete. Bug fixes, optimizations, and staying up to date with egui releases are the only ways this crate will be expanding for the foreseeable future.
While you are free to open an issue, contacting me (Mythitorium#4918) on the egui discord server might be more worth your time.