From 2ad63c10979c9731eef1b3092276df82084ec9a4 Mon Sep 17 00:00:00 2001 From: Franz Date: Fri, 16 Dec 2022 15:24:05 +0100 Subject: [PATCH 1/3] Added the "any_popup_open()" function --- crates/egui/src/memory.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/egui/src/memory.rs b/crates/egui/src/memory.rs index 271780eaddd..27b94c7a17d 100644 --- a/crates/egui/src/memory.rs +++ b/crates/egui/src/memory.rs @@ -479,6 +479,10 @@ impl Memory { 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) { self.popup = Some(popup_id); } From d228b8c7fd4ed304b7652ae36326be1466b2fe60 Mon Sep 17 00:00:00 2001 From: Franz Date: Fri, 16 Dec 2022 15:32:53 +0100 Subject: [PATCH 2/3] Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b2798c4a0d..4911539d51a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG ### 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)). * 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. ### Fixed 🐛 * Expose `TextEdit`'s multiline flag to AccessKit ([#2448](https://github.com/emilk/egui/pull/2448)). From c85250672c51a2fa79386e1daafebc32163a42f5 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 19 Dec 2022 10:41:32 +0100 Subject: [PATCH 3/3] add PR link to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4911539d51a..ab5654621db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG ### 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)). * 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. +* Add `Memory::any_popup_open`, which returns true if any popup is currently open ([#2464](https://github.com/emilk/egui/pull/2464)). ### Fixed 🐛 * Expose `TextEdit`'s multiline flag to AccessKit ([#2448](https://github.com/emilk/egui/pull/2448)).