1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

[grid] Option to set spacing

This commit is contained in:
Emil Ernerfeldt
2021-01-15 19:47:58 +01:00
parent 480c6db37f
commit b1157ee642
2 changed files with 16 additions and 2 deletions

View File

@@ -54,7 +54,9 @@ impl super::View for WidgetGallery {
color,
} = self;
let grid = egui::Grid::new("my_grid").striped(true);
let grid = egui::Grid::new("my_grid")
.striped(true)
.spacing([40.0, 4.0]);
grid.show(ui, |ui| {
ui.label("Label:");
ui.label("Welcome to the widget gallery!");
@@ -138,7 +140,7 @@ impl super::View for WidgetGallery {
ui.collapsing("Click to see what is hidden!", |ui| {
ui.horizontal_wrapped_for_text(egui::TextStyle::Body, |ui| {
ui.label(
"Not much, as it turns out, but here is a gold star for you for checking:",
"Not much, as it turns out - but here is a gold star for you for checking:",
);
ui.colored_label(egui::Color32::GOLD, "");
});