Merge pull request #10021 from Noshyaar/pr-mb
MenuButton: defer grab_click_focus until button_up
This commit is contained in:
commit
64b47574af
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,6 @@ void MenuButton::pressed() {
|
||||||
popup->set_size(Size2(size.width, 0));
|
popup->set_size(Size2(size.width, 0));
|
||||||
popup->set_parent_rect(Rect2(Point2(gp - popup->get_global_position()), get_size()));
|
popup->set_parent_rect(Rect2(Point2(gp - popup->get_global_position()), get_size()));
|
||||||
popup->popup();
|
popup->popup();
|
||||||
popup->call_deferred("grab_click_focus");
|
|
||||||
popup->set_invalidate_click_until_motion();
|
popup->set_invalidate_click_until_motion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +111,7 @@ MenuButton::MenuButton() {
|
||||||
popup->hide();
|
popup->hide();
|
||||||
add_child(popup);
|
add_child(popup);
|
||||||
popup->set_as_toplevel(true);
|
popup->set_as_toplevel(true);
|
||||||
|
connect("button_up", popup, "call_deferred", make_binds("grab_click_focus"));
|
||||||
set_process_unhandled_key_input(true);
|
set_process_unhandled_key_input(true);
|
||||||
set_action_mode(ACTION_MODE_BUTTON_PRESS);
|
set_action_mode(ACTION_MODE_BUTTON_PRESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue