Skip to content

Commit

Permalink
Fix Ui::add_visible sometimes leaving the Ui in a disabled state
Browse files Browse the repository at this point in the history
Closes #1436
  • Loading branch information
emilk committed Apr 3, 2022
1 parent 6091370 commit d09fa63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
* Fixed ComboBoxes always being rendered left-aligned ([#1304](https://github.com/emilk/egui/pull/1304)).
* Fixed ui code that could lead to a deadlock ([#1380](https://github.com/emilk/egui/pull/1380)).
* Text is darker and more readable in bright mode ([#1412](https://github.com/emilk/egui/pull/1412)).
* Fixed `Ui::add_visible` sometimes leaving the `Ui` in a disabled state. ([#1436](https://github.com/emilk/egui/issues/1436)).

### Removed 🔥
* Removed the `single_threaded/multi_threaded` flags - egui is now always thread-safe ([#1390](https://github.com/emilk/egui/pull/1390)).
Expand Down
5 changes: 5 additions & 0 deletions egui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,9 +1097,14 @@ impl Ui {
if self.is_visible() && !visible {
// temporary make us invisible:
let old_painter = self.painter.clone();
let old_enabled = self.enabled;

self.set_visible(false);

let response = self.add(widget);

self.painter = old_painter;
self.enabled = old_enabled;
response
} else {
self.add(widget)
Expand Down

0 comments on commit d09fa63

Please sign in to comment.