Post-merge tweaks

#417
This commit is contained in:
Wojtek Figat
2021-04-07 10:57:17 +02:00
parent 7e5fd8e384
commit dff1374378
2 changed files with 18 additions and 29 deletions

View File

@@ -32,18 +32,13 @@ namespace FlaxEditor.CustomEditors.Dedicated
if (_presets != value) if (_presets != value)
{ {
_presets = value; _presets = value;
OnPresetsChanged(); TooltipText = CustomEditorsUtil.GetPropertyNameUI(_presets.ToString());
} }
} }
} }
public bool IsSelected; public bool IsSelected;
private void OnPresetsChanged()
{
TooltipText = CustomEditorsUtil.GetPropertyNameUI(_presets.ToString());
}
/// <inheritdoc /> /// <inheritdoc />
public override void Draw() public override void Draw()
{ {

View File

@@ -49,8 +49,7 @@ namespace FlaxEngine.GUI
/// <summary> /// <summary>
/// Gets or sets the normalized position in the parent control that the upper left corner is anchored to (range 0-1). /// Gets or sets the normalized position in the parent control that the upper left corner is anchored to (range 0-1).
/// </summary> /// </summary>
[Serialize] [HideInEditor]
[HideInEditor, ExpandGroups, Limit(0.0f, 1.0f, 0.01f), EditorDisplay("Transform"), EditorOrder(990), Tooltip("The normalized position in the parent control that the upper left corner is anchored to (range 0-1).")]
public Vector2 AnchorMin public Vector2 AnchorMin
{ {
get => _anchorMin; get => _anchorMin;
@@ -69,8 +68,7 @@ namespace FlaxEngine.GUI
/// <summary> /// <summary>
/// Gets or sets the normalized position in the parent control that the bottom right corner is anchored to (range 0-1). /// Gets or sets the normalized position in the parent control that the bottom right corner is anchored to (range 0-1).
/// </summary> /// </summary>
[Serialize] [Serialize, HideInEditor]
[HideInEditor, ExpandGroups, Limit(0.0f, 1.0f, 0.01f), EditorDisplay("Transform"), EditorOrder(991), Tooltip("The normalized position in the parent control that the bottom right corner is anchored to (range 0-1).")]
public Vector2 AnchorMax public Vector2 AnchorMax
{ {
get => _anchorMax; get => _anchorMax;
@@ -89,8 +87,7 @@ namespace FlaxEngine.GUI
/// <summary> /// <summary>
/// Gets or sets the offsets of the corners of the control relative to its anchors. /// Gets or sets the offsets of the corners of the control relative to its anchors.
/// </summary> /// </summary>
[Serialize] [Serialize, HideInEditor]
[HideInEditor, ExpandGroups, EditorDisplay("Transform"), EditorOrder(992), Tooltip("The offsets of the corners of the control relative to its anchors.")]
public Margin Offsets public Margin Offsets
{ {
get => _offsets; get => _offsets;
@@ -111,8 +108,8 @@ namespace FlaxEngine.GUI
[NoSerialize, HideInEditor] [NoSerialize, HideInEditor]
internal float Proxy_Offset_Left internal float Proxy_Offset_Left
{ {
get => Offsets.Left; get => _offsets.Left;
set => Offsets = new Margin(value, Offsets.Right, Offsets.Top, Offsets.Bottom); set => Offsets = new Margin(value, _offsets.Right, _offsets.Top, _offsets.Bottom);
} }
/// <summary> /// <summary>
@@ -121,8 +118,8 @@ namespace FlaxEngine.GUI
[NoSerialize, HideInEditor] [NoSerialize, HideInEditor]
internal float Proxy_Offset_Right internal float Proxy_Offset_Right
{ {
get => Offsets.Right; get => _offsets.Right;
set => Offsets = new Margin(Offsets.Left, value, Offsets.Top, Offsets.Bottom); set => Offsets = new Margin(_offsets.Left, value, _offsets.Top, _offsets.Bottom);
} }
/// <summary> /// <summary>
@@ -131,8 +128,8 @@ namespace FlaxEngine.GUI
[NoSerialize, HideInEditor] [NoSerialize, HideInEditor]
internal float Proxy_Offset_Top internal float Proxy_Offset_Top
{ {
get => Offsets.Top; get => _offsets.Top;
set => Offsets = new Margin(Offsets.Left, Offsets.Right, value, Offsets.Bottom); set => Offsets = new Margin(_offsets.Left, _offsets.Right, value, _offsets.Bottom);
} }
/// <summary> /// <summary>
@@ -141,16 +138,15 @@ namespace FlaxEngine.GUI
[NoSerialize, HideInEditor] [NoSerialize, HideInEditor]
internal float Proxy_Offset_Bottom internal float Proxy_Offset_Bottom
{ {
get => Offsets.Bottom; get => _offsets.Bottom;
set => Offsets = new Margin(Offsets.Left, Offsets.Right, Offsets.Top, value); set => Offsets = new Margin(_offsets.Left, _offsets.Right, _offsets.Top, value);
} }
#endif #endif
/// <summary> /// <summary>
/// Gets or sets coordinates of the upper-left corner of the control relative to the upper-left corner of its container. /// Gets or sets coordinates of the upper-left corner of the control relative to the upper-left corner of its container.
/// </summary> /// </summary>
[NoSerialize] [NoSerialize, HideInEditor]
[HideInEditor, ExpandGroups, EditorDisplay("Transform"), EditorOrder(1000), Tooltip("The location of the upper-left corner of the control relative to he upper-left corner of its container.")]
public Vector2 Location public Vector2 Location
{ {
get => _bounds.Location; get => _bounds.Location;
@@ -158,14 +154,13 @@ namespace FlaxEngine.GUI
} }
/// <summary> /// <summary>
/// The local position of the pivot of the control relative to the anchor in parent of its container. /// Gets or sets the local position of the pivot of the control relative to the anchor in parent of its container.
/// </summary> /// </summary>
[NoSerialize] [NoSerialize, HideInEditor]
[HideInEditor, ExpandGroups, EditorDisplay("Transform"), EditorOrder(1000), Tooltip("The local position of the pivot of the control relative to the anchor in parent of its container.")]
public Vector2 LocalLocation public Vector2 LocalLocation
{ {
get => _bounds.Location - (Parent.Size * (AnchorMax + AnchorMin) / 2) + Size * Pivot; get => _bounds.Location - (_parent != null ? _parent._bounds.Size * (_anchorMax + _anchorMin) * 0.5f : Vector2.Zero) + _bounds.Size * _pivot;
set => Bounds = new Rectangle(value + (Parent.Size * (AnchorMax + AnchorMin) / 2) - Size * Pivot, _bounds.Size); set => Bounds = new Rectangle(value + (_parent != null ? _parent.Bounds.Size * (_anchorMax + _anchorMin) * 0.5f : Vector2.Zero) - _bounds.Size * _pivot, _bounds.Size);
} }
/// <summary> /// <summary>
@@ -191,8 +186,7 @@ namespace FlaxEngine.GUI
/// <summary> /// <summary>
/// Gets or sets control's size. /// Gets or sets control's size.
/// </summary> /// </summary>
[NoSerialize] [NoSerialize, HideInEditor]
[HideInEditor, EditorDisplay("Transform"), EditorOrder(1010), Tooltip("The size of the control bounds.")]
public Vector2 Size public Vector2 Size
{ {
get => _bounds.Size; get => _bounds.Size;