From 1708d57ef10a89bd53a56697f5ec96a017e22f4c Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 19 Nov 2024 09:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Charts/UIChart.cs | 2 +- SunnyUI/Charts/UILineChart.cs | 2 +- SunnyUI/Controls/UITransparentPanel.cs | 18 ++---------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/SunnyUI/Charts/UIChart.cs b/SunnyUI/Charts/UIChart.cs index 703c98fe..24b4e447 100644 --- a/SunnyUI/Charts/UIChart.cs +++ b/SunnyUI/Charts/UIChart.cs @@ -73,7 +73,7 @@ namespace Sunny.UI tip.Visible = false; } - protected readonly UITransparentPanel tip = new UITransparentPanel(); + internal readonly UITransparentPanel tip = new UITransparentPanel(); private UIChartStyleType chartStyleType = UIChartStyleType.Plain; [DefaultValue(UIChartStyleType.Plain)] diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index f98f8b88..8cc92de1 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -983,7 +983,7 @@ namespace Sunny.UI using Graphics g = this.CreateGraphics(); using var TempFont = Font.DPIScaleFont(UIStyles.DefaultSubFontSize); Size sf = TextRenderer.MeasureText(sb.ToString(), TempFont); - tip.Size = new Size(sf.Width + 4, sf.Height + 4); + tip.Size = new Size(sf.Width + 4, sf.Height + 10); int x = e.Location.X + 15; int y = e.Location.Y + 20; diff --git a/SunnyUI/Controls/UITransparentPanel.cs b/SunnyUI/Controls/UITransparentPanel.cs index 65acce75..f39f03a3 100644 --- a/SunnyUI/Controls/UITransparentPanel.cs +++ b/SunnyUI/Controls/UITransparentPanel.cs @@ -6,28 +6,14 @@ using System.Windows.Forms; namespace Sunny.UI { [ToolboxItem(false)] - public class UITransparentPanel : UIPanel + internal class UITransparentPanel : UIPanel { - private int _opacity = 150; - public UITransparentPanel() { + Opacity = 200; SetStyleFlags(true, false); } - [Bindable(true), Category("Custom"), DefaultValue(150), Description("背景的透明度. 有效值0-255")] - public int Opacity - { - get { return _opacity; } - set - { - if (value > 255) value = 255; - else if (value < 0) value = 0; - _opacity = value; - Invalidate(); - } - } - protected override CreateParams CreateParams { get