Struct me3_framework::overlay::Grid
source · [−]pub struct Grid { /* private fields */ }
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
sourceimpl Grid
impl Grid
sourcepub fn num_columns(self, num_columns: usize) -> Grid
pub fn num_columns(self, num_columns: usize) -> Grid
Setting this will allow the last column to expand to take up the rest of the space of the parent Ui
.
sourcepub fn striped(self, striped: bool) -> Grid
pub fn striped(self, striped: bool) -> Grid
If true
, add a subtle background color to every other row.
This can make a table easier to read.
Default: false
.
sourcepub fn min_col_width(self, min_col_width: f32) -> Grid
pub fn min_col_width(self, min_col_width: f32) -> Grid
Set minimum width of each column.
Default: crate::style::Spacing::interact_size
.x
.
sourcepub fn min_row_height(self, min_row_height: f32) -> Grid
pub fn min_row_height(self, min_row_height: f32) -> Grid
Set minimum height of each row.
Default: crate::style::Spacing::interact_size
.y
.
sourcepub fn max_col_width(self, max_col_width: f32) -> Grid
pub fn max_col_width(self, max_col_width: f32) -> Grid
Set soft maximum width (wrapping width) of each column.
Auto Trait Implementations
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnwindSafe for Grid
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more