From 37a3c4dbb508fd5ccf7dc8a48c397d193c2ff6d4 Mon Sep 17 00:00:00 2001 From: Nils Hausfeld Date: Tue, 18 Jun 2024 19:01:53 +0200 Subject: [PATCH] - Added separator line between description and inputs/outputs --- Source/Editor/Surface/ContextMenu/VisjectCM.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Editor/Surface/ContextMenu/VisjectCM.cs b/Source/Editor/Surface/ContextMenu/VisjectCM.cs index b25b4c6e0..2ebdc1c3b 100644 --- a/Source/Editor/Surface/ContextMenu/VisjectCM.cs +++ b/Source/Editor/Surface/ContextMenu/VisjectCM.cs @@ -60,6 +60,7 @@ namespace FlaxEditor.Surface.ContextMenu private readonly bool _useDescriptionPanel; private bool _descriptionPanelVisible; private readonly Panel _descriptionPanel; + private readonly Panel _descriptionPanelSeparator; private readonly Image _descriptionClassImage; private readonly Label _descriptionSignatureLabel; private readonly Label _descriptionLabel; @@ -279,6 +280,13 @@ namespace FlaxEditor.Surface.ContextMenu }; _descriptionLabel.SetAnchorPreset(AnchorPresets.TopLeft, true); + _descriptionPanelSeparator = new Panel(ScrollBars.None) + { + Parent = _descriptionPanel, + Bounds = new Rectangle(8, Height, Width - 16, 2), + BackgroundColor = Style.Current.BackgroundHighlighted, + }; + _descriptionInputPanel = new VerticalPanel() { Parent = _descriptionPanel, @@ -892,16 +900,18 @@ namespace FlaxEditor.Surface.ContextMenu _descriptionLabel.Y = _descriptionSignatureLabel.Bounds.Bottom + 6f; _descriptionLabel.Text = archetype.Description; - panelHeight += _descriptionLabel.Height + 6f + 18f; + _descriptionPanelSeparator.Y = _descriptionLabel.Bounds.Bottom + 8f; + + panelHeight += _descriptionLabel.Height + 32f; _descriptionInputPanel.Y = panelHeight; _descriptionOutputPanel.Y = panelHeight; panelHeight += Mathf.Max(_descriptionInputPanel.Height, _descriptionOutputPanel.Height); - // Forcing the description panel to at least have a height of 120 to not make the window size change too much in order to reduce jittering + // Forcing the description panel to at least have a minimum height to not make the window size change too much in order to reduce jittering // TODO: Remove the Mathf.Max and just set the height to panelHeight once the window jitter issue is fixed - Nils - _descriptionPanel.Height = Mathf.Max(120f, panelHeight); + _descriptionPanel.Height = Mathf.Max(135f, panelHeight); Height = 400 + _descriptionPanel.Height; UpdateWindowSize(); _descriptionPanelVisible = true;