🧙 Collapse Button 新增 Visible 属性,应用 Fore 文本色

This commit is contained in:
jesse
2025-07-16 09:45:23 +00:00
committed by Tom
parent 0b28bdb328
commit 20d541b256
2 changed files with 20 additions and 3 deletions

View File

@@ -665,7 +665,7 @@ namespace AntdUI
{
foreach (var btn in item.buttons)
{
if (btn.Show == false) continue;
if (btn.Show == false || btn.Visible==false) continue;
if (btn.EditType != EButtonEditTypes.Switch)
{
if (btn.EditType == EButtonEditTypes.Input || btn.EditType == EButtonEditTypes.Custom) continue;
@@ -691,7 +691,8 @@ namespace AntdUI
}
}
if (btn.Icon != null) g.Image(btn.Icon, btn.ico_rect);
if (btn.IconSvg != null) g.GetImgExtend(btn.IconSvg, btn.ico_rect, (btn.Select || btn.AnimationClick ? fore_active : fore).Color);
if (btn.IconSvg != null) g.GetImgExtend(btn.IconSvg, btn.ico_rect, btn.Select || btn.AnimationClick ? fore_active.Color : btn.Fore ?? fore.Color);
g.String(btn.Text, Font, btn.Select || btn.AnimationClick ? fore_active : fore, btn.txt_rect, s_c);
}
else

View File

@@ -895,6 +895,22 @@ namespace AntdUI
}
}
bool visible = true;
/// <summary>
/// 是否可见
/// </summary>
[Description("是否可见"), Category("行为"), DefaultValue(true)]
public bool Visible
{
get => visible;
set
{
if (visible == value) return;
visible = value;
Invalidate();
}
}
internal override bool Show { get => Visible; set => base.Show = Visible = value; }
bool switchMode = false;
//[Obsolete("请使用EditType")]
[Browsable(false)]
@@ -1400,7 +1416,7 @@ namespace AntdUI
}
internal bool Show { get; set; }
internal virtual bool Show { get; set; }
internal Rectangle rect { get; set; }
internal bool Contains(int x, int y, int sx, int sy)