Remove code to update the layout direction of submenus from PopupMenu
This commit is contained in:
parent
64c4ce516a
commit
ef81dc1831
2 changed files with 2 additions and 21 deletions
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue