* 重构主题

This commit is contained in:
Sunny 2023-11-18 11:52:19 +08:00
parent e25fe74d87
commit ee63065623
2 changed files with 12 additions and 2 deletions

View File

@ -116,7 +116,6 @@
this.uiLogo1.MinimumSize = new System.Drawing.Size(300, 80);
this.uiLogo1.Name = "uiLogo1";
this.uiLogo1.Size = new System.Drawing.Size(300, 80);
this.uiLogo1.Style = Sunny.UI.UIStyle.Custom;
this.uiLogo1.TabIndex = 4;
this.uiLogo1.Text = "uiLogo1";
//

View File

@ -402,10 +402,21 @@ namespace Sunny.UI
foreach (var control in controls)
{
if (control is IStyleInterface item && item.Style == UIStyle.Inherited)
{
if (item is UIPage uipage && uipage.Parent is TabPage tabpage)
{
TabControl tabControl = tabpage.Parent as TabControl;
if (tabControl.SelectedTab == tabpage)
{
item.SetInheritedStyle(style);
}
}
else
{
item.SetInheritedStyle(style);
}
}
}
FieldInfo[] fieldInfo = ctrl.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
foreach (var info in fieldInfo)