summaryrefslogtreecommitdiffstats
path: root/scene/gui/popup.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-03-12 09:37:40 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-03-26 15:49:42 +0100
commit441f1a5fe9a3bf0e4e5dab578f793500b1ff6e3d (patch)
tree6421bcc3235e6fdcd726244ac7d455886e17734b /scene/gui/popup.h
parent543fb1c4dadd75914d595b089820aef42e691075 (diff)
downloadredot-engine-441f1a5fe9a3bf0e4e5dab578f793500b1ff6e3d.tar.gz
Popups are now windows also (broken!)
Diffstat (limited to 'scene/gui/popup.h')
-rw-r--r--scene/gui/popup.h39
1 files changed, 11 insertions, 28 deletions
diff --git a/scene/gui/popup.h b/scene/gui/popup.h
index fc4158d41c..20b355bc18 100644
--- a/scene/gui/popup.h
+++ b/scene/gui/popup.h
@@ -31,44 +31,24 @@
#ifndef POPUP_H
#define POPUP_H
-#include "scene/gui/control.h"
+#include "scene/main/window.h"
-class Popup : public Control {
+class Popup : public Window {
- GDCLASS(Popup, Control);
+ GDCLASS(Popup, Window);
- bool exclusive;
- bool popped_up;
+ Window *parent_visible;
-private:
- void _popup(const Rect2 &p_bounds = Rect2(), const bool p_centered = false);
+ void _input_from_window(const Ref<InputEvent> &p_event);
+ void _parent_focused();
+ void _close_pressed();
protected:
- virtual void _post_popup() {}
-
- void _gui_input(Ref<InputEvent> p_event);
void _notification(int p_what);
- virtual void _fix_size();
static void _bind_methods();
public:
- enum {
- NOTIFICATION_POST_POPUP = 80,
- NOTIFICATION_POPUP_HIDE = 81
- };
-
- void set_exclusive(bool p_exclusive);
- bool is_exclusive() const;
-
- void popup_centered_ratio(float p_screen_ratio = 0.75);
- void popup_centered_size(const Size2 &p_size = Size2());
- void popup_centered_minsize(const Size2 &p_minsize = Size2());
void set_as_minsize();
- void popup_centered_clamped(const Size2 &p_size = Size2(), float p_fallback_ratio = 0.75);
- virtual void popup(const Rect2 &p_bounds = Rect2());
-
- virtual String get_configuration_warning() const;
-
Popup();
~Popup();
};
@@ -77,13 +57,16 @@ class PopupPanel : public Popup {
GDCLASS(PopupPanel, Popup);
+ Panel *panel;
+
protected:
void _update_child_rects();
void _notification(int p_what);
+ virtual Size2 _get_contents_minimum_size() const;
+
public:
void set_child_rect(Control *p_child);
- virtual Size2 get_minimum_size() const;
PopupPanel();
};