Fix attributes editor empty hint text display

This commit is contained in:
2026-09-26 23:15:00 +02:00
parent 330df10902
commit a15838e0c9
+12 -10
View File
@@ -124,19 +124,18 @@ namespace FlaxEditor.Surface
};
editor.Select(_proxy);
_presenter.Modified += OnPresenterModified;
OnPresenterModified();
_presenter.AfterLayout += OnPresenterLayer;
}
private void OnPresenterModified()
private void OnPresenterLayer(LayoutElementsContainer layout)
{
if (_proxy.Value.Length == 0)
{
var label = _presenter.Label("No attributes.\nPress the \"+\" button to add a new one and then select an attribute type using the \"Type\" dropdown.", TextAlignment.Center);
label.Label.Wrapping = TextWrapping.WrapWords;
label.Control.Height = 35f;
label.Label.Margin = new Margin(10f);
label.Label.TextColor = label.Label.TextColorHighlighted = Style.Current.ForegroundGrey;
var label = layout.Label("No attributes.\nPress the \"+\" button to add a new one and then select an attribute type using the \"Type\" dropdown.", TextAlignment.Center).Label;
label.Wrapping = TextWrapping.WrapWords;
label.Height = 45f;
label.Margin = new Margin(10f);
label.TextColor = label.TextColorHighlighted = Style.Current.ForegroundGrey;
}
}
@@ -186,11 +185,14 @@ namespace FlaxEditor.Surface
/// <inheritdoc />
public override void OnDestroy()
{
_presenter = null;
if (_presenter != null)
{
_presenter.AfterLayout -= OnPresenterLayer;
_presenter = null;
}
_oldData = null;
_proxy = null;
Edited = null;
_presenter.Modified -= OnPresenterModified;
base.OnDestroy();
}