Fix: ui.new_child should now respect 'disabled' (#5483)
* Closes https://github.com/emilk/egui/issues/5475
This commit is contained in:
parent
b1d2551e7e
commit
0823a36952
|
|
@ -301,7 +301,7 @@ impl Ui {
|
||||||
min_rect: placer.min_rect(),
|
min_rect: placer.min_rect(),
|
||||||
max_rect: placer.max_rect(),
|
max_rect: placer.max_rect(),
|
||||||
};
|
};
|
||||||
let child_ui = Ui {
|
let mut child_ui = Ui {
|
||||||
id: stable_id,
|
id: stable_id,
|
||||||
unique_id,
|
unique_id,
|
||||||
next_auto_id_salt,
|
next_auto_id_salt,
|
||||||
|
|
@ -316,6 +316,10 @@ impl Ui {
|
||||||
min_rect_already_remembered: false,
|
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:
|
// 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
|
let start_rect = Rect::NOTHING; // This will be overwritten when `remember_min_rect` is called
|
||||||
child_ui.ctx().create_widget(
|
child_ui.ctx().create_widget(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue