* UITextBox: 修改全局字体调整后的默认高度
This commit is contained in:
parent
85a56809f1
commit
a266d608ff
@ -64,7 +64,7 @@ namespace Sunny.UI
|
||||
edit.Invalidate();
|
||||
Controls.Add(edit);
|
||||
|
||||
lastEditHeight = edit.Height;
|
||||
firstEditHeight = lastEditHeight = edit.Height;
|
||||
Width = 150;
|
||||
Height = 29;
|
||||
|
||||
@ -76,6 +76,7 @@ namespace Sunny.UI
|
||||
ControlBoxRect = new Rectangle(Width - 24, 0, 24, Height);
|
||||
}
|
||||
|
||||
int firstEditHeight = -1;
|
||||
int lastEditHeight = -1;
|
||||
private void Edit_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
@ -411,6 +412,14 @@ namespace Sunny.UI
|
||||
NoNeedChange = false;
|
||||
}
|
||||
|
||||
if (edit.Height + RectSize * 2 + 2 < firstEditHeight && Height > firstEditHeight)
|
||||
{
|
||||
NoNeedChange = true;
|
||||
Height = firstEditHeight;
|
||||
edit.Top = (Height - edit.Height) / 2;
|
||||
NoNeedChange = false;
|
||||
}
|
||||
|
||||
if (edit.Top != (Height - edit.Height) / 2 + 1)
|
||||
{
|
||||
edit.Top = (Height - edit.Height) / 2 + 1;
|
||||
|
@ -132,7 +132,7 @@ namespace Sunny.UI
|
||||
bar.MouseEnter += Bar_MouseEnter;
|
||||
TextAlignment = ContentAlignment.MiddleLeft;
|
||||
|
||||
lastEditHeight = edit.Height;
|
||||
firstEditHeight = lastEditHeight = edit.Height;
|
||||
Width = 150;
|
||||
Height = 29;
|
||||
|
||||
@ -140,6 +140,7 @@ namespace Sunny.UI
|
||||
TextAlignmentChange += UITextBox_TextAlignmentChange;
|
||||
}
|
||||
|
||||
int firstEditHeight = -1;
|
||||
int lastEditHeight = -1;
|
||||
private void Edit_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
@ -734,6 +735,14 @@ namespace Sunny.UI
|
||||
NoNeedChange = false;
|
||||
}
|
||||
|
||||
if (edit.Height + RectSize * 2 + 2 < firstEditHeight && Height > firstEditHeight)
|
||||
{
|
||||
NoNeedChange = true;
|
||||
Height = firstEditHeight;
|
||||
edit.Top = (Height - edit.Height) / 2;
|
||||
NoNeedChange = false;
|
||||
}
|
||||
|
||||
if (edit.Top != (Height - edit.Height) / 2 + 1)
|
||||
{
|
||||
edit.Top = (Height - edit.Height) / 2 + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user