Skip to content

Commit

Permalink
Fix: ui.new_child should now respect 'disabled' (emilk#5483)
Browse files Browse the repository at this point in the history
* Closes emilk#5475
  • Loading branch information
emilk authored Dec 16, 2024
1 parent b1d2551 commit 0823a36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/egui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit 0823a36

Please sign in to comment.