From 400febf58517631651ffdb6707e483db3271f04c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 19 Jun 2016 02:08:22 -0300 Subject: [PATCH] Add function to get the color picker dialog from ColorPickerButton, closes #4415 --- scene/gui/color_picker.cpp | 5 +++++ scene/gui/color_picker.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index bd24b437619..d6bbdf2d218 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -664,10 +664,15 @@ bool ColorPickerButton::is_editing_alpha() const{ } +ColorPicker *ColorPickerButton::get_picker() { + return picker; +} + void ColorPickerButton::_bind_methods(){ ObjectTypeDB::bind_method(_MD("set_color","color"),&ColorPickerButton::set_color); ObjectTypeDB::bind_method(_MD("get_color"),&ColorPickerButton::get_color); + ObjectTypeDB::bind_method(_MD("get_picker:ColorPicker"),&ColorPickerButton::get_picker); ObjectTypeDB::bind_method(_MD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha); ObjectTypeDB::bind_method(_MD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha); ObjectTypeDB::bind_method(_MD("_color_changed"),&ColorPickerButton::_color_changed); diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 4559bc7391b..f5de9822007 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -133,6 +133,8 @@ public: void set_edit_alpha(bool p_show); bool is_editing_alpha() const; + ColorPicker *get_picker(); + ColorPickerButton(); };