mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Fix: ui.new_child should now respect 'disabled' (#5483)
* Closes https://github.com/emilk/egui/issues/5475
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user