* UITitlePanel: 修复Padding设置
This commit is contained in:
parent
5603bc88fe
commit
7fb7c21f4c
@ -20,6 +20,7 @@
|
|||||||
* 2020-04-25: V2.2.4 更新主题配置类
|
* 2020-04-25: V2.2.4 更新主题配置类
|
||||||
* 2020-07-30: V2.2.6 增加可收缩选项
|
* 2020-07-30: V2.2.6 增加可收缩选项
|
||||||
* 2020-09-03: V3.0.6 增加标题文字颜色
|
* 2020-09-03: V3.0.6 增加标题文字颜色
|
||||||
|
* 2022-05-30: V3.1.9 修复Padding设置
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -41,13 +42,25 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
get => _titleHeight;
|
get => _titleHeight;
|
||||||
set
|
set
|
||||||
|
{
|
||||||
|
if (_titleHeight != value)
|
||||||
{
|
{
|
||||||
_titleHeight = Math.Max(19, value);
|
_titleHeight = Math.Max(19, value);
|
||||||
Padding = new Padding(0, value, 0, 0);
|
Padding = new Padding(Padding.Left, Math.Max(value, Padding.Top), Padding.Right, Padding.Bottom);
|
||||||
CalcSystemBoxPos();
|
CalcSystemBoxPos();
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaddingChanged(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnPaddingChanged(e);
|
||||||
|
if (Padding.Top != Math.Max(TitleHeight, Padding.Top))
|
||||||
|
{
|
||||||
|
Padding = new Padding(Padding.Left, Math.Max(TitleHeight, Padding.Top), Padding.Right, Padding.Bottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnControlAdded(ControlEventArgs e)
|
protected override void OnControlAdded(ControlEventArgs e)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user