Skip to content

Commit

Permalink
Fix Id clash in Frame styling widget (emilk#4967)
Browse files Browse the repository at this point in the history
As we have two Margin widgets in the same UI and this widget has a Grid
with a hardcoded Id, we have to force a different Id to one of them to
avoid clashes.

* Closes <emilk#4965>
* [x] I have followed the instructions in the PR template
  • Loading branch information
YgorSouza authored and hacknus committed Oct 30, 2024
1 parent 8bbeef6 commit 852a1cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/egui/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2501,7 +2501,8 @@ impl Widget for &mut crate::Frame {
ui.end_row();

ui.label("Outer margin");
ui.add(outer_margin);
// Push Id to avoid clashes in the Margin widget's Grid
ui.push_id("outer", |ui| ui.add(outer_margin));
ui.end_row();

ui.label("Rounding");
Expand Down

0 comments on commit 852a1cd

Please sign in to comment.