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>
This commit is contained in:
parent
6554fbb151
commit
2c9b130423
2 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
* `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)).
|
* `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)).
|
||||||
* Add `Slider::drag_value_speed`, which lets you ask for finer precision when dragging the slider value rather than the actual slider.
|
* Add `Slider::drag_value_speed`, which lets you ask for finer precision when dragging the slider value rather than the actual slider.
|
||||||
|
* Add `Memory::any_popup_open`, which returns true if any popup is currently open ([#2464](https://github.com/emilk/egui/pull/2464)).
|
||||||
|
|
||||||
### Fixed 🐛
|
### Fixed 🐛
|
||||||
* Expose `TextEdit`'s multiline flag to AccessKit ([#2448](https://github.com/emilk/egui/pull/2448)).
|
* Expose `TextEdit`'s multiline flag to AccessKit ([#2448](https://github.com/emilk/egui/pull/2448)).
|
||||||
|
|
|
@ -479,6 +479,10 @@ impl Memory {
|
||||||
self.popup == Some(popup_id) || self.everything_is_visible()
|
self.popup == Some(popup_id) || self.everything_is_visible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn any_popup_open(&self) -> bool {
|
||||||
|
self.popup.is_some() || self.everything_is_visible()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn open_popup(&mut self, popup_id: Id) {
|
pub fn open_popup(&mut self, popup_id: Id) {
|
||||||
self.popup = Some(popup_id);
|
self.popup = Some(popup_id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue