Merge pull request #22301 from YeldhamDev/button_popup_highlight

Enable toggle behaviour for buttons that trigger popups
This commit is contained in:
Rémi Verschelde
2019-04-25 17:47:23 +02:00
committed by GitHub
5 changed files with 19 additions and 2 deletions

View File

@@ -340,6 +340,7 @@ void OptionButton::_bind_methods() {
OptionButton::OptionButton() {
current = -1;
set_toggle_mode(true);
set_text_align(ALIGN_LEFT);
set_action_mode(ACTION_MODE_BUTTON_PRESS);
@@ -350,6 +351,7 @@ OptionButton::OptionButton() {
popup->set_pass_on_modal_close_click(false);
popup->connect("id_pressed", this, "_selected");
popup->connect("id_focused", this, "_focused");
popup->connect("popup_hide", this, "set_pressed", varray(false));
}
OptionButton::~OptionButton() {