summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian <supagu@gmail.com>2019-08-14 16:05:08 +0930
committerFabian <supagu@gmail.com>2019-08-14 16:09:55 +0930
commit97167209cbed3e9c896de73b8b55b225ba007c3c (patch)
treefae24702ac9132d38bf630ada8e12a533ef0c0a2
parent5ff2688064a83f052149d011d894d1ae4432f9ac (diff)
Exposed set_as_minsize to gdscript
-rw-r--r--doc/classes/Popup.xml7
-rw-r--r--scene/gui/popup.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml
index 1e24aadfd9..fb8168c344 100644
--- a/doc/classes/Popup.xml
+++ b/doc/classes/Popup.xml
@@ -56,6 +56,13 @@
Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, scaled at a ratio of size of the screen.
</description>
</method>
+ <method name="set_as_minsize">
+ <return type="void">
+ </return>
+ <description>
+ Shrink popup to keep to the minimum size of content.
+ </description>
+ </method>
</methods>
<members>
<member name="popup_exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" default="false">
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index 3e003af396..9a3070b5c5 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -207,6 +207,7 @@ bool Popup::is_exclusive() const {
void Popup::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_as_minsize"), &Popup::set_as_minsize);
ClassDB::bind_method(D_METHOD("popup_centered", "size"), &Popup::popup_centered, DEFVAL(Size2()));
ClassDB::bind_method(D_METHOD("popup_centered_ratio", "ratio"), &Popup::popup_centered_ratio, DEFVAL(0.75));
ClassDB::bind_method(D_METHOD("popup_centered_minsize", "minsize"), &Popup::popup_centered_minsize, DEFVAL(Size2()));