Skip to content

Commit

Permalink
Use ui.add_enabled_ui instead of ui.set_enabled
Browse files Browse the repository at this point in the history
Addresses egui #4614 (emilk/egui#4614)
  • Loading branch information
zhaop committed Jul 6, 2024
1 parent 00673ec commit 92145a6
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ fn debug_ui_options(
} else {
ui.label("Wireframes (enable POLYGON_MODE_LINE feature)");
}
ui.scope(|ui| {
ui.set_enabled(wireframe_enabled);
ui.add_enabled_ui(wireframe_enabled, |ui| {
if ui_for_value(&mut state.wireframes, ui, type_registry) {
world
.get_resource_or_insert_with(WireframeConfig::default)
Expand All @@ -156,8 +155,7 @@ fn debug_ui_options(
}

ui.label("Highlight selected entity");
ui.scope(|ui| {
ui.set_enabled(wireframe_enabled);
ui.add_enabled_ui(wireframe_enabled, |ui| {
ui.checkbox(&mut state.highlight_selected, "");
});
ui.end_row();
Expand Down

0 comments on commit 92145a6

Please sign in to comment.