重构
This commit is contained in:
parent
7e6ee8e98b
commit
1708d57ef1
@ -73,7 +73,7 @@ namespace Sunny.UI
|
|||||||
tip.Visible = false;
|
tip.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected readonly UITransparentPanel tip = new UITransparentPanel();
|
internal readonly UITransparentPanel tip = new UITransparentPanel();
|
||||||
private UIChartStyleType chartStyleType = UIChartStyleType.Plain;
|
private UIChartStyleType chartStyleType = UIChartStyleType.Plain;
|
||||||
|
|
||||||
[DefaultValue(UIChartStyleType.Plain)]
|
[DefaultValue(UIChartStyleType.Plain)]
|
||||||
|
@ -983,7 +983,7 @@ namespace Sunny.UI
|
|||||||
using Graphics g = this.CreateGraphics();
|
using Graphics g = this.CreateGraphics();
|
||||||
using var TempFont = Font.DPIScaleFont(UIStyles.DefaultSubFontSize);
|
using var TempFont = Font.DPIScaleFont(UIStyles.DefaultSubFontSize);
|
||||||
Size sf = TextRenderer.MeasureText(sb.ToString(), TempFont);
|
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 x = e.Location.X + 15;
|
||||||
int y = e.Location.Y + 20;
|
int y = e.Location.Y + 20;
|
||||||
|
@ -6,28 +6,14 @@ using System.Windows.Forms;
|
|||||||
namespace Sunny.UI
|
namespace Sunny.UI
|
||||||
{
|
{
|
||||||
[ToolboxItem(false)]
|
[ToolboxItem(false)]
|
||||||
public class UITransparentPanel : UIPanel
|
internal class UITransparentPanel : UIPanel
|
||||||
{
|
{
|
||||||
private int _opacity = 150;
|
|
||||||
|
|
||||||
public UITransparentPanel()
|
public UITransparentPanel()
|
||||||
{
|
{
|
||||||
|
Opacity = 200;
|
||||||
SetStyleFlags(true, false);
|
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
|
protected override CreateParams CreateParams
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
Loading…
x
Reference in New Issue
Block a user