Fix: ui.new_child should now respect 'disabled' (#5483)

* Closes https://github.com/emilk/egui/issues/5475
This commit is contained in:
Emil Ernerfeldt 2024-12-16 15:07:14 +01:00 committed by GitHub
parent b1d2551e7e
commit 0823a36952
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -301,7 +301,7 @@ impl Ui {
min_rect: placer.min_rect(),
max_rect: placer.max_rect(),
};
let child_ui = Ui {
let mut child_ui = Ui {
id: stable_id,
unique_id,
next_auto_id_salt,
@ -316,6 +316,10 @@ impl Ui {
min_rect_already_remembered: false,
};
if disabled {
child_ui.disable();
}
// Register in the widget stack early, to ensure we are behind all widgets we contain:
let start_rect = Rect::NOTHING; // This will be overwritten when `remember_min_rect` is called
child_ui.ctx().create_widget(