Merge pull request #21062 from Ovnuniarchos/PopupCheckables

PopupMenu item_pressed is sent before checking hide flags.
This commit is contained in:
Juan Linietsky 2018-08-16 08:17:12 -03:00 committed by GitHub
commit b466561c4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1071,6 +1071,9 @@ void PopupMenu::activate_item(int p_item) {
pop = Object::cast_to<PopupMenu>(next);
}
emit_signal("id_pressed", id);
emit_signal("index_pressed", p_item);
// Hides popup by default; unless otherwise specified
// by using set_hide_on_item_selection and set_hide_on_checkable_item_selection
@ -1084,9 +1087,6 @@ void PopupMenu::activate_item(int p_item) {
return;
hide();
emit_signal("id_pressed", id);
emit_signal("index_pressed", p_item);
}
void PopupMenu::remove_item(int p_idx) {