* 重构主题
This commit is contained in:
parent
8ce0156d97
commit
ef52687e98
@ -239,15 +239,7 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public void Add(Control control)
|
public void Add(Control control)
|
||||||
{
|
{
|
||||||
if (control is IStyleInterface ctrl)
|
Panel?.Controls.Add(control);
|
||||||
{
|
|
||||||
if (!ctrl.StyleCustomMode) ctrl.Style = Style;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Panel != null)
|
|
||||||
{
|
|
||||||
Panel.Controls.Add(control);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
@ -321,6 +313,12 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//public override void SetInheritedStyle(UIStyle style)
|
||||||
|
//{
|
||||||
|
// UIStyleHelper.SetChildUIStyle(this, style);
|
||||||
|
// base.SetInheritedStyle(style);
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置主题样式
|
/// 设置主题样式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*
|
*
|
||||||
* 2022-07-01: V3.2.0 增加文件说明
|
* 2022-07-01: V3.2.0 增加文件说明
|
||||||
* 2022-07-25: V3.2.2 重写图片刷新流程,减少内存及GC
|
* 2022-07-25: V3.2.2 重写图片刷新流程,减少内存及GC
|
||||||
|
* 2023-11-12: V3.5.2 重构主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -77,6 +78,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
fillColor = uiColor.PanelFillColor;
|
fillColor = uiColor.PanelFillColor;
|
||||||
rectColor = uiColor.PanelFillColor;
|
rectColor = uiColor.PanelFillColor;
|
||||||
|
CalcImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(null)]
|
[DefaultValue(null)]
|
||||||
|
@ -633,7 +633,7 @@ namespace Sunny.UI
|
|||||||
_style = style == UIStyle.Inherited ? UIStyle.Inherited : UIStyle.Custom;
|
_style = style == UIStyle.Inherited ? UIStyle.Inherited : UIStyle.Custom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetInheritedStyle(UIStyle style)
|
public virtual void SetInheritedStyle(UIStyle style)
|
||||||
{
|
{
|
||||||
SetStyle(style);
|
SetStyle(style);
|
||||||
_style = UIStyle.Inherited;
|
_style = UIStyle.Inherited;
|
||||||
|
@ -1380,6 +1380,9 @@ namespace Sunny.UI
|
|||||||
if (!DesignMode && UIStyles.Style.IsValid())
|
if (!DesignMode && UIStyles.Style.IsValid())
|
||||||
{
|
{
|
||||||
Style = UIStyles.Style;
|
Style = UIStyles.Style;
|
||||||
|
this.SuspendLayout();
|
||||||
|
UIStyleHelper.SetChildUIStyle(this, UIStyles.Style);
|
||||||
|
this.ResumeLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,6 +293,9 @@ namespace Sunny.UI
|
|||||||
if (!DesignMode && UIStyles.Style.IsValid())
|
if (!DesignMode && UIStyles.Style.IsValid())
|
||||||
{
|
{
|
||||||
Style = UIStyles.Style;
|
Style = UIStyles.Style;
|
||||||
|
this.SuspendLayout();
|
||||||
|
UIStyleHelper.SetChildUIStyle(this, UIStyles.Style);
|
||||||
|
this.ResumeLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,9 +440,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
if (obj is UIPage) continue;
|
if (obj is UIPage) continue;
|
||||||
if (obj is UITableLayoutPanel) continue;
|
if (obj is UITableLayoutPanel) continue;
|
||||||
if (obj is UIFlowLayoutPanel) continue;
|
//if (obj is UIFlowLayoutPanel) continue;
|
||||||
if (obj is UIUserControl) continue;
|
//if (obj is UIUserControl) continue;
|
||||||
|
|
||||||
if (obj is TableLayoutPanel) continue;
|
if (obj is TableLayoutPanel) continue;
|
||||||
|
|
||||||
if (obj.Controls.Count > 0)
|
if (obj.Controls.Count > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user