Skip to content

Commit cf3545c

Browse files
authored
Add a simplified version of the Anchor behavior editor (#8325)
1 parent ff4256a commit cf3545c

24 files changed

+787
-69
lines changed

Extensions/AnchorBehavior/AnchorBehavior.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
6464
.SetType("Boolean")
6565
.SetLabel(_("Anchor relatively to original window size"))
6666
.SetDescription(_("otherwise, objects are anchored according to the "
67-
"window size when the object is created."));
67+
"window size when the object is created."))
68+
.SetAdvanced();
6869

6970
properties["leftEdgeAnchor"]
7071
.SetValue(GetHorizontalAnchorAsString(static_cast<HorizontalAnchor>(
@@ -76,7 +77,8 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
7677
.AddChoice("WindowRight", _("Window right"))
7778
.AddChoice("Proportional", _("Proportional"))
7879
.SetLabel(_("Left edge"))
79-
.SetDescription(_("Anchor the left edge of the object on X axis."));
80+
.SetDescription(_("Anchor the left edge of the object on X axis."))
81+
.SetAdvanced();
8082

8183
properties["rightEdgeAnchor"]
8284
.SetValue(GetHorizontalAnchorAsString(static_cast<HorizontalAnchor>(
@@ -88,7 +90,8 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
8890
.AddChoice("WindowRight", _("Window right"))
8991
.AddChoice("Proportional", _("Proportional"))
9092
.SetLabel(_("Right edge"))
91-
.SetDescription(_("Anchor the right edge of the object on X axis."));
93+
.SetDescription(_("Anchor the right edge of the object on X axis."))
94+
.SetAdvanced();
9295

9396
properties["topEdgeAnchor"]
9497
.SetValue(GetVerticalAnchorAsString(static_cast<VerticalAnchor>(
@@ -100,7 +103,8 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
100103
.AddChoice("WindowBottom", _("Window bottom"))
101104
.AddChoice("Proportional", _("Proportional"))
102105
.SetLabel(_("Top edge"))
103-
.SetDescription(_("Anchor the top edge of the object on Y axis."));
106+
.SetDescription(_("Anchor the top edge of the object on Y axis."))
107+
.SetAdvanced();
104108

105109
properties["bottomEdgeAnchor"]
106110
.SetValue(GetVerticalAnchorAsString(static_cast<VerticalAnchor>(
@@ -112,7 +116,8 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
112116
.AddChoice("WindowBottom", _("Window bottom"))
113117
.AddChoice("Proportional", _("Proportional"))
114118
.SetLabel(_("Bottom edge"))
115-
.SetDescription(_("Anchor the bottom edge of the object on Y axis."));
119+
.SetDescription(_("Anchor the bottom edge of the object on Y axis."))
120+
.SetAdvanced();
116121

117122
properties["useLegacyBottomAndRightAnchors"]
118123
.SetLabel(_(

newIDE/app/src/BehaviorsEditor/BehaviorsEditorService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import BehaviorPropertiesEditor from './Editors/BehaviorPropertiesEditor';
33
import Physics2Editor from './Editors/Physics2Editor';
44
import Physics3DEditor from './Editors/Physics3DEditor';
5+
import AnchorBehaviorEditor from './Editors/AnchorBehaviorEditor';
56

67
/**
78
* A service returning editor components for each behavior type.
@@ -22,6 +23,9 @@ const BehaviorsEditorService = {
2223
'Physics3D::Physics3DBehavior': {
2324
component: Physics3DEditor,
2425
},
26+
'AnchorBehavior::AnchorBehavior': {
27+
component: AnchorBehaviorEditor,
28+
},
2529
},
2630
};
2731

0 commit comments

Comments
 (0)