diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-06 23:47:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-06 23:47:43 +0100 |
commit | e334b0c4b29aa018dfa4a292598c3041f2a32730 (patch) | |
tree | c47a0dcca97d8de81a22d583956a65e8cdd8fa96 | |
parent | 9e2fad7e647e67aba90fae60ceb5a709eea68759 (diff) | |
parent | d6d0df4ba6cb7bc33ce9842a309e41fd3ac2289e (diff) |
Merge pull request #13491 from RaXaR/master
Added get_popup() method to ColorPickerButton...
-rw-r--r-- | doc/classes/ColorPickerButton.xml | 7 | ||||
-rw-r--r-- | scene/gui/color_picker.cpp | 5 | ||||
-rw-r--r-- | scene/gui/color_picker.h | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index c8a4b850d0..ee34b2bcd1 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -18,6 +18,13 @@ Returns the [code]ColorPicker[/code] that this [code]ColorPickerButton[/code] toggles. </description> </method> + <method name="get_popup"> + <return type="PopupPanel"> + </return> + <description> + Returns the control's [PopupPanel] which allows you to connect to Popup Signals. This allows you to handle events when the ColorPicker is shown or hidden. + </description> + </method> </methods> <members> <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color"> diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index dbd7c1bbc0..7a0593bc87 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -664,11 +664,16 @@ ColorPicker *ColorPickerButton::get_picker() { return picker; } +PopupPanel *ColorPickerButton::get_popup() { + return popup; +} + void ColorPickerButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pick_color", "color"), &ColorPickerButton::set_pick_color); ClassDB::bind_method(D_METHOD("get_pick_color"), &ColorPickerButton::get_pick_color); ClassDB::bind_method(D_METHOD("get_picker"), &ColorPickerButton::get_picker); + ClassDB::bind_method(D_METHOD("get_popup"), &ColorPickerButton::get_popup); ClassDB::bind_method(D_METHOD("set_edit_alpha", "show"), &ColorPickerButton::set_edit_alpha); ClassDB::bind_method(D_METHOD("is_editing_alpha"), &ColorPickerButton::is_editing_alpha); ClassDB::bind_method(D_METHOD("_color_changed"), &ColorPickerButton::_color_changed); diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 7de67a707c..c02cdc8608 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -130,6 +130,7 @@ public: bool is_editing_alpha() const; ColorPicker *get_picker(); + PopupPanel *get_popup(); ColorPickerButton(); }; |