* UIDropControl: 最小高度限制,以防丢失边框
This commit is contained in:
parent
4f91a84ac2
commit
6587289286
@ -42,6 +42,7 @@ namespace Sunny.UI
|
|||||||
SetStyleFlags();
|
SetStyleFlags();
|
||||||
Padding = new Padding(0, 0, 30, 2);
|
Padding = new Padding(0, 0, 30, 2);
|
||||||
|
|
||||||
|
edit.AutoSize = false;
|
||||||
edit.Font = UIFontColor.Font();
|
edit.Font = UIFontColor.Font();
|
||||||
edit.Left = 4;
|
edit.Left = 4;
|
||||||
edit.Top = 3;
|
edit.Top = 3;
|
||||||
@ -64,6 +65,19 @@ namespace Sunny.UI
|
|||||||
ControlBoxRect = new Rectangle(Width - 24, 0, 24, Height);
|
ControlBoxRect = new Rectangle(Width - 24, 0, 24, Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重载字体变更
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">参数</param>
|
||||||
|
protected override void OnFontChanged(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnFontChanged(e);
|
||||||
|
edit.IsScaled = true;
|
||||||
|
edit.Font = Font;
|
||||||
|
SizeChange();
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
[Description("开启后可响应某些触屏的点击事件"), Category("SunnyUI")]
|
[Description("开启后可响应某些触屏的点击事件"), Category("SunnyUI")]
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
public bool TouchPressClick
|
public bool TouchPressClick
|
||||||
@ -338,17 +352,6 @@ namespace Sunny.UI
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重载字体变更
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">参数</param>
|
|
||||||
protected override void OnFontChanged(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnFontChanged(e);
|
|
||||||
edit.Font = Font;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnPaddingChanged(EventArgs e)
|
protected override void OnPaddingChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
if (Padding.Right < 30 || Padding.Bottom < 2)
|
if (Padding.Right < 30 || Padding.Bottom < 2)
|
||||||
@ -365,8 +368,6 @@ namespace Sunny.UI
|
|||||||
/// <param name="e">参数</param>
|
/// <param name="e">参数</param>
|
||||||
protected override void OnSizeChanged(EventArgs e)
|
protected override void OnSizeChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
if (Height < edit.Height + 2 && edit.Height > 0) Height = edit.Height + 2;
|
|
||||||
|
|
||||||
SizeChange();
|
SizeChange();
|
||||||
|
|
||||||
if (tipsBtn != null)
|
if (tipsBtn != null)
|
||||||
@ -377,6 +378,9 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
private void SizeChange()
|
private void SizeChange()
|
||||||
{
|
{
|
||||||
|
if (Height < UIGlobal.EditorMinHeight) Height = UIGlobal.EditorMinHeight;
|
||||||
|
if (Height > UIGlobal.EditorMaxHeight) Height = UIGlobal.EditorMaxHeight;
|
||||||
|
edit.Height = Math.Min(Height - RectSize * 2, edit.PreferredHeight);
|
||||||
edit.Top = (Height - edit.Height) / 2;
|
edit.Top = (Height - edit.Height) / 2;
|
||||||
edit.Left = 4 + Padding.Left;
|
edit.Left = 4 + Padding.Left;
|
||||||
edit.Width = Width - Padding.Left - Padding.Right - 4;
|
edit.Width = Width - Padding.Left - Padding.Right - 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user