* UITreeView: 不显示连线时,重绘节点前展开与收缩的图标

This commit is contained in:
Sunny 2024-08-06 20:13:39 +08:00
parent f865be8731
commit 1317d552b5

View File

@ -38,6 +38,7 @@
* 2024-01-01: V3.6.2
* 2024-01-20: V3.6.3 SetNodePainter
* 2024-05-27: V3.6.6
* 2024-08-06: V3.6.8 线
******************************************************************************/
using System;
@ -1344,6 +1345,8 @@ namespace Sunny.UI
//绘制左侧+号
if (ShowPlusMinus && e.Node.Nodes.Count > 0)
{
if (ShowLines)
{
e.Graphics.FillRectangle(Color.White, new Rectangle(lineX - 4, lineY - 4, 8, 8));
e.Graphics.DrawRectangle(UIFontColor.Primary, new Rectangle(lineX - 4, lineY - 4, 8, 8));
@ -1351,6 +1354,24 @@ namespace Sunny.UI
if (!e.Node.IsExpanded)
e.Graphics.DrawLine(UIFontColor.Primary, lineX, lineY - 2, lineX, lineY + 2);
}
else
{
Color fcf = ForeColor;
if (e.Node == SelectedNode) fcf = SelectedForeColor;
if (Painter.ContainsKey(e.Node)) fcf = Painter[e.Node].ForeColor;
if (e.Node.IsExpanded)
{
e.Graphics.DrawFontImage(61703, 24, fcf,
new RectangleF(lineX - 12, lineY - 12, 24, 24), -1, 1);
}
else
{
e.Graphics.DrawFontImage(61701, 24, fcf,
new RectangleF(lineX - 12, lineY - 12, 24, 24), -2, 1);
}
}
}
}
}
catch (Exception ex)