* UIIntegerUpDown: 可以设置按钮大小和颜色

This commit is contained in:
Sunny 2022-02-20 13:11:29 +08:00
parent 3fdd288ae1
commit f13b5f4aba
3 changed files with 27 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -312,5 +312,32 @@ namespace Sunny.UI
if (Height < UIGlobal.EditorMinHeight) Height = UIGlobal.EditorMinHeight;
if (Height > UIGlobal.EditorMaxHeight) Height = UIGlobal.EditorMaxHeight;
}
protected override void AfterSetRectColor(Color color)
{
base.AfterSetRectColor(color);
if (btnAdd == null || btnDec == null) return;
btnAdd.FillColor = btnDec.FillColor = color;
btnAdd.RectColor = btnDec.RectColor = color;
}
protected override void AfterSetFillColor(Color color)
{
base.AfterSetFillColor(color);
if (pnlValue == null) return;
pnlValue.FillColor = color;
}
private int buttonWidth = 29;
public int ButtonWidth
{
get => buttonWidth;
set
{
buttonWidth = Math.Max(value, 29);
if (btnAdd == null || btnDec == null) return;
btnAdd.Width = btnDec.Width = buttonWidth;
}
}
}
}