From 5f22cc40c4fe7d01c08aa88de3c700240fced096 Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 21 Feb 2022 17:13:42 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIDoubleUpDown:=20=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=8C=89=E9=92=AE=E5=A4=A7=E5=B0=8F=E5=92=8C?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIDoubleUpDown.cs | 28 ++++++++++++++++++++++++++++ SunnyUI/Controls/UIIntegerUpDown.cs | 1 + 2 files changed, 29 insertions(+) diff --git a/SunnyUI/Controls/UIDoubleUpDown.cs b/SunnyUI/Controls/UIDoubleUpDown.cs index 96135f94..472b790d 100644 --- a/SunnyUI/Controls/UIDoubleUpDown.cs +++ b/SunnyUI/Controls/UIDoubleUpDown.cs @@ -22,6 +22,7 @@ * 2020-12-10: V3.0.9 增加Readonly属性 * 2022-01-28: V3.1.0 修正默认值不为0时,编辑值为0的问题 * 2022-02-07: V3.1.0 增加圆角控制 + * 2022-02-24: V3.1.1 可以设置按钮大小和颜色 ******************************************************************************/ using System; @@ -335,5 +336,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; + } + } } } \ No newline at end of file diff --git a/SunnyUI/Controls/UIIntegerUpDown.cs b/SunnyUI/Controls/UIIntegerUpDown.cs index f2526e52..42d6054e 100644 --- a/SunnyUI/Controls/UIIntegerUpDown.cs +++ b/SunnyUI/Controls/UIIntegerUpDown.cs @@ -21,6 +21,7 @@ * 2020-08-14: V2.2.7 增加字体调整 * 2020-12-10: V3.0.9 增加Readonly属性 * 2022-02-07: V3.1.0 增加圆角控制 + * 2022-02-24: V3.1.1 可以设置按钮大小和颜色 ******************************************************************************/ using System;