summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-11-30 15:08:39 +0100
committerkobewi <kobewi4e@gmail.com>2022-11-30 15:08:39 +0100
commitb65a3a52accf9b415fff20c0c534e343a97c02a4 (patch)
tree6eabaa74fd556d3611d5c9e60a71ba525165be81
parentcd491c6e47bb41ccf596189676c0c5d4a72226cc (diff)
Display transform properties of contained controls
-rw-r--r--scene/gui/control.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 5ce17abf18..e90a6a69ab 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -485,10 +485,10 @@ void Control::_validate_property(PropertyInfo &p_property) const {
}
} else if (Object::cast_to<Container>(parent_node)) {
// If the parent is a container, display only container-related properties.
- if (p_property.name.begins_with("anchor_") || p_property.name.begins_with("offset_") || p_property.name.begins_with("grow_") || p_property.name == "anchors_preset" ||
- p_property.name == "position" || p_property.name == "rotation" || p_property.name == "scale" || p_property.name == "size" || p_property.name == "pivot_offset") {
- p_property.usage ^= PROPERTY_USAGE_EDITOR;
-
+ if (p_property.name.begins_with("anchor_") || p_property.name.begins_with("offset_") || p_property.name.begins_with("grow_") || p_property.name == "anchors_preset") {
+ p_property.usage ^= PROPERTY_USAGE_DEFAULT;
+ } else if (p_property.name == "position" || p_property.name == "rotation" || p_property.name == "scale" || p_property.name == "size" || p_property.name == "pivot_offset") {
+ p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY;
} else if (p_property.name == "layout_mode") {
// Set the layout mode to be disabled with the proper value.
p_property.hint_string = "Position,Anchors,Container,Uncontrolled";