diff --git a/source/Lucid.Sample/SideViews/ToolWindow.Designer.cs b/source/Lucid.Sample/SideViews/ToolWindow.Designer.cs index f53e1aa..e4e0880 100644 --- a/source/Lucid.Sample/SideViews/ToolWindow.Designer.cs +++ b/source/Lucid.Sample/SideViews/ToolWindow.Designer.cs @@ -39,6 +39,7 @@ private void InitializeComponent() lucidTreeView.MaxDragChange = 20; lucidTreeView.Name = "lucidTreeView"; lucidTreeView.Size = new Size(319, 273); + lucidTreeView.ShowSelectedNodeRoundedRectangle = true; lucidTreeView.TabIndex = 2; lucidTreeView.Text = "lucidTreeView1"; // diff --git a/source/Lucid/Controls/LucidTreeView.cs b/source/Lucid/Controls/LucidTreeView.cs index ac6159c..cd17c89 100644 --- a/source/Lucid/Controls/LucidTreeView.cs +++ b/source/Lucid/Controls/LucidTreeView.cs @@ -8,6 +8,7 @@ using System.ComponentModel; using System.Drawing.Drawing2D; using Lucid.Common; +using Lucid.Helper; namespace Lucid.Controls; @@ -174,6 +175,11 @@ public int Indent [DefaultValue(false)] public bool ShowIcons { get; set; } + [Category("Appearance")] + [Description("Determines whether selected node is displayed with a rounded rectangle.")] + [DefaultValue(false)] + public bool ShowSelectedNodeRoundedRectangle { get; set; } + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int VisibleNodeCount { get; private set; } @@ -1382,6 +1388,10 @@ private void DrawNode(LucidTreeNode node, Graphics g) using (var b = new SolidBrush(bgColor)) { + + if (ShowSelectedNodeRoundedRectangle) + g.FillPath(b, RoundedRectangleHelper.CreateRoundedRectanglePath(rect, 8)); + else g.FillRectangle(b, rect); }