summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2022-02-09 01:36:20 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2022-02-09 01:36:20 -0300
commitef81dc1831db37c104091b5f7edf8102c8d72270 (patch)
tree6a3204b08529c827e003a00e6634e86c2bbf47c9
parent64c4ce516a9bc501a9e25421b722cd5245a0f5bb (diff)
Remove code to update the layout direction of submenus from `PopupMenu`
-rw-r--r--doc/classes/Window.xml2
-rw-r--r--scene/gui/popup_menu.cpp21
2 files changed, 2 insertions, 21 deletions
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index ab8f51ced5..82bb74683f 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -435,7 +435,7 @@
<constant name="CONTENT_SCALE_ASPECT_EXPAND" value="4" enum="ContentScaleAspect">
</constant>
<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
- Automatic layout direction, determined from the parent control layout direction.
+ Automatic layout direction, determined from the parent window layout direction.
</constant>
<constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection">
Automatic layout direction, determined from the current locale.
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 6e0f1c5198..b76bb230be 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -736,26 +736,7 @@ void PopupMenu::_notification(int p_what) {
}
} break;
case NOTIFICATION_THEME_CHANGED:
- case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
- // Pass the layout direction to all submenus.
- for (int i = 0; i < items.size(); i++) {
- if (items[i].submenu.is_empty()) {
- continue;
- }
-
- Node *n = get_node(items[i].submenu);
- if (!n) {
- continue;
- }
-
- PopupMenu *pm = Object::cast_to<PopupMenu>(n);
- if (pm) {
- pm->set_layout_direction(get_layout_direction());
- }
- }
-
- [[fallthrough]];
- }
+ case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
case NOTIFICATION_TRANSLATION_CHANGED: {
for (int i = 0; i < items.size(); i++) {
items.write[i].xl_text = atr(items[i].text);