@@ -10,14 +10,46 @@ namespace UnityEngine
1010 [ Conditional ( "UNITY_EDITOR" ) ]
1111 public class BeginHorizontalAttribute : ToolboxDecoratorAttribute
1212 {
13+ public BeginHorizontalAttribute ( )
14+ { }
15+
16+ [ Obsolete ( "Ratios are no longer valid, use ControlFieldWidth and linked properties to specify width of layout elements." ) ]
1317 public BeginHorizontalAttribute ( float labelToWidthRatio = 0.0f , float fieldToWidthRatio = 0.0f )
1418 {
1519 LabelToWidthRatio = labelToWidthRatio ;
1620 FieldToWidthRatio = fieldToWidthRatio ;
1721 }
1822
19- public float LabelToWidthRatio { get ; private set ; }
23+ /// <summary>
24+ /// Indicates whether layout elements should be sized automatically or using associated properties.
25+ /// Associated properties: <see cref="ElementsInLayout"/>, <see cref="WidthOffset"/>, <see cref="WidthOffsetPerElement"/>.
26+ /// </summary>
27+ public bool ControlFieldWidth { get ; set ; }
28+ /// <summary>
29+ /// Indicates how many elements are placed in the layout.
30+ /// Used to specify how big should be the field width for each element.
31+ /// Used only when the <see cref="ControlFieldWidth"/> is set to <see langword="true"/>.
32+ /// </summary>
33+ public int ElementsInLayout { get ; set ; } = - 1 ;
34+ /// <summary>
35+ /// Value substracted from the available space when calculating field width for each element.
36+ /// Used only when the <see cref="ControlFieldWidth"/> is set to <see langword="true"/>.
37+ /// </summary>
38+ public float WidthOffset { get ; set ; }
39+ /// <summary>
40+ /// Value substracted from the available space when calculating field width for each element.
41+ /// Used only when the <see cref="ControlFieldWidth"/> is set to <see langword="true"/>.
42+ /// </summary>
43+ public float WidthOffsetPerElement { get ; set ; }
44+ /// <summary>
45+ /// Overrides label width within the layout for each element.
46+ /// Set to 0 to keep the default width.
47+ /// </summary>
48+ public float LabelWidth { get ; set ; } = 100.0f ;
2049
50+ [ Obsolete ( "Ratios are no longer valid, use ControlFieldWidth and linked properties to specify width of layout elements." ) ]
51+ public float LabelToWidthRatio { get ; private set ; }
52+ [ Obsolete ( "Ratios are no longer valid, use ControlFieldWidth and linked properties to specify width of layout elements." ) ]
2153 public float FieldToWidthRatio { get ; private set ; }
2254 }
2355}
0 commit comments