From eb589757a87903247c7b1565e6d5493753bd38b4 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 10 Feb 2019 22:27:41 +0100 Subject: [PATCH] Add function to check if user is interacting with anything --- emigui/src/layout.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emigui/src/layout.rs b/emigui/src/layout.rs index e817f16d..d8b7167e 100644 --- a/emigui/src/layout.rs +++ b/emigui/src/layout.rs @@ -220,6 +220,11 @@ impl Data { self.memory.lock().unwrap().active_id = None; } } + + /// Is the user interacting with anything? + pub fn any_active(&self) -> bool { + self.memory.lock().unwrap().active_id.is_some() + } } /// Show a pop-over window