summaryrefslogtreecommitdiff
path: root/scene/gui/popup.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/popup.h')
-rw-r--r--scene/gui/popup.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/scene/gui/popup.h b/scene/gui/popup.h
index 6cd2b4028f..48e7ea9452 100644
--- a/scene/gui/popup.h
+++ b/scene/gui/popup.h
@@ -33,30 +33,40 @@
#include "scene/main/window.h"
-class Popup : public Window {
+#include "core/templates/local_vector.h"
+class Popup : public Window {
GDCLASS(Popup, Window);
- Window *parent_visible;
+ LocalVector<Window *> visible_parents;
+ bool popped_up = false;
+ bool close_on_parent_focus = true;
void _input_from_window(const Ref<InputEvent> &p_event);
+
+ void _initialize_visible_parents();
+ void _deinitialize_visible_parents();
+
void _parent_focused();
protected:
void _close_pressed();
- virtual Rect2i _popup_adjust_rect() const;
+ virtual Rect2i _popup_adjust_rect() const override;
void _notification(int p_what);
static void _bind_methods();
public:
void set_as_minsize();
+
+ void set_close_on_parent_focus(bool p_close);
+ bool get_close_on_parent_focus();
+
Popup();
~Popup();
};
class PopupPanel : public Popup {
-
GDCLASS(PopupPanel, Popup);
Panel *panel;
@@ -65,7 +75,7 @@ protected:
void _update_child_rects();
void _notification(int p_what);
- virtual Size2 _get_contents_minimum_size() const;
+ virtual Size2 _get_contents_minimum_size() const override;
public:
void set_child_rect(Control *p_child);