Skip to content

Commit 2c9b130

Browse files
Add Memory::any_popup_open() (#2464)
* Added the "any_popup_open()" function * Updated CHANGELOG.md * add PR link to changelog Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
1 parent 6554fbb commit 2c9b130

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
88
### Added ⭐
99
* `Event::Key` now has a `repeat` field that is set to `true` if the event was the result of a key-repeat ([#2435](https://github.com/emilk/egui/pull/2435)).
1010
* Add `Slider::drag_value_speed`, which lets you ask for finer precision when dragging the slider value rather than the actual slider.
11+
* Add `Memory::any_popup_open`, which returns true if any popup is currently open ([#2464](https://github.com/emilk/egui/pull/2464)).
1112

1213
### Fixed 🐛
1314
* Expose `TextEdit`'s multiline flag to AccessKit ([#2448](https://github.com/emilk/egui/pull/2448)).

crates/egui/src/memory.rs

+4
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ impl Memory {
479479
self.popup == Some(popup_id) || self.everything_is_visible()
480480
}
481481

482+
pub fn any_popup_open(&self) -> bool {
483+
self.popup.is_some() || self.everything_is_visible()
484+
}
485+
482486
pub fn open_popup(&mut self, popup_id: Id) {
483487
self.popup = Some(popup_id);
484488
}

0 commit comments

Comments
 (0)