summaryrefslogtreecommitdiff
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-01-10 23:07:57 +0300
committerYuri Sizov <yuris@humnom.net>2023-01-10 23:51:27 +0300
commit42cbdbc7df9e71c0ad806c8e6321794a23d912ad (patch)
treefc70c5e9be0f722c933e9cb102f9e76804f5722a /scene/gui/control.cpp
parent91713ced81792b10fdc9367b7f355738e5d52777 (diff)
Ensure that the cached layout mode is in sync
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 8460728448..a2fdcd688c 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -864,6 +864,14 @@ void Control::_set_layout_mode(LayoutMode p_mode) {
}
}
+void Control::_update_layout_mode() {
+ LayoutMode computed_layout = _get_layout_mode();
+ if (data.stored_layout_mode != computed_layout) {
+ data.stored_layout_mode = computed_layout;
+ notify_property_list_changed();
+ }
+}
+
Control::LayoutMode Control::_get_layout_mode() const {
Node *parent_node = get_parent_control();
// In these modes the property is read-only.
@@ -2870,6 +2878,8 @@ void Control::_notification(int p_notification) {
data.parent_window = Object::cast_to<Window>(parent_node);
data.theme_owner->assign_theme_on_parented(this);
+
+ _update_layout_mode();
} break;
case NOTIFICATION_UNPARENTED: {