diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index a56496c5..4e65c8a7 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/Bin/net45/SunnyUI.dll b/Bin/net45/SunnyUI.dll index 2c90e1e2..679993ea 100644 Binary files a/Bin/net45/SunnyUI.dll and b/Bin/net45/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll index 03086e49..7494450f 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/ref/SunnyUI.dll b/Bin/net5.0-windows/ref/SunnyUI.dll index a8c86694..f0d11e4e 100644 Binary files a/Bin/net5.0-windows/ref/SunnyUI.dll and b/Bin/net5.0-windows/ref/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index 39107b17..d31ab283 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI/Controls/UIPipe.cs b/SunnyUI/Controls/UIPipe.cs index 9bdfbc93..34df47e3 100644 --- a/SunnyUI/Controls/UIPipe.cs +++ b/SunnyUI/Controls/UIPipe.cs @@ -20,6 +20,7 @@ ******************************************************************************/ using System; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; @@ -37,6 +38,18 @@ namespace Sunny.UI fillColor = Color.White; StyleCustomMode = true; Style = UIStyle.Custom; + Width = 200; + Height = 16; + } + + private List linked = new List(); + + public void Link(UIPipe pipe) + { + if (linked.IndexOf(pipe) < 0) + { + linked.Add(pipe); + } } private UILine.LineDirection direction = UILine.LineDirection.Horizontal; @@ -48,9 +61,25 @@ namespace Sunny.UI get => direction; set { - Radius = 0; - direction = value; - Invalidate(); + if (direction != value) + { + Radius = 0; + direction = value; + + if (direction == UILine.LineDirection.Horizontal) + { + Width = 200; + Height = 16; + } + + if (direction == UILine.LineDirection.Vertical) + { + Width = 16; + Height = 200; + } + + Invalidate(); + } } } @@ -368,6 +397,8 @@ namespace Sunny.UI g.DrawLine(colors[idx], 0, Height - i, Width - i, Height - i); } } + + } PaintFlow(g); diff --git a/SunnyUI/Style/UIStyle.cs b/SunnyUI/Style/UIStyle.cs index e20b3eb4..2258a9bd 100644 --- a/SunnyUI/Style/UIStyle.cs +++ b/SunnyUI/Style/UIStyle.cs @@ -797,6 +797,8 @@ namespace Sunny.UI if (obj is UIFlowLayoutPanel) continue; if (obj is UIPanel) continue; + if (obj is TableLayoutPanel) continue; + if (obj.Controls.Count > 0) { values.AddRange(obj.GetUIStyleControls(interfaceName)); @@ -835,21 +837,23 @@ namespace Sunny.UI { if (control is IStyleInterface item) { - item.Style = style; + if (!item.StyleCustomMode) + item.Style = style; } } return; } - if (e.Control is TableLayoutPanel) + if (e.Control is FlowLayoutPanel) { List controls = e.Control.GetUIStyleControls("IStyleInterface"); foreach (var control in controls) { if (control is IStyleInterface item) { - item.Style = style; + if (!item.StyleCustomMode) + item.Style = style; } } @@ -863,7 +867,8 @@ namespace Sunny.UI { if (control is IStyleInterface item) { - item.Style = style; + if (!item.StyleCustomMode) + item.Style = style; } } }