Make popups from MenuButton, OptionButton, and submenus obey the layout direction

This commit is contained in:
Michael Alexsander
2022-02-06 23:07:08 -03:00
parent 8aa4ed8b5b
commit 8bde86da10
3 changed files with 34 additions and 8 deletions
+3
View File
@@ -136,6 +136,9 @@ int MenuButton::get_item_count() const {
void MenuButton::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
popup->set_layout_direction((Window::LayoutDirection)get_layout_direction());
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
if (!is_visible_in_tree()) {
popup->hide();