summaryrefslogtreecommitdiffstats
path: root/scene/gui/popup.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/popup.h')
-rw-r--r--scene/gui/popup.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/scene/gui/popup.h b/scene/gui/popup.h
index 25edca3657..69a81ad98c 100644
--- a/scene/gui/popup.h
+++ b/scene/gui/popup.h
@@ -43,9 +43,15 @@ class Popup : public Window {
LocalVector<Window *> visible_parents;
bool popped_up = false;
- struct ThemeCache {
- Ref<StyleBox> panel_style;
- } theme_cache;
+public:
+ enum HideReason {
+ HIDE_REASON_NONE,
+ HIDE_REASON_CANCELED, // E.g., because of rupture of UI flow (app unfocused). Includes closed programmatically.
+ HIDE_REASON_UNFOCUSED, // E.g., user clicked outside.
+ };
+
+private:
+ HideReason hide_reason = HIDE_REASON_NONE;
void _initialize_visible_parents();
void _deinitialize_visible_parents();
@@ -64,6 +70,8 @@ protected:
virtual void _post_popup() override;
public:
+ HideReason get_hide_reason() const { return hide_reason; }
+
Popup();
~Popup();
};