* 重构主题
This commit is contained in:
parent
3ce56b3ed4
commit
f994734c34
@ -269,9 +269,7 @@ namespace Sunny.UI
|
||||
if (_itemSelectBackColor != value)
|
||||
{
|
||||
_itemSelectBackColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
if (DesignMode)
|
||||
Invalidate();
|
||||
if (DesignMode) Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -285,9 +283,7 @@ namespace Sunny.UI
|
||||
if (_itemSelectForeColor != value)
|
||||
{
|
||||
_itemSelectForeColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
if (DesignMode)
|
||||
Invalidate();
|
||||
if (DesignMode) Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -372,11 +368,8 @@ namespace Sunny.UI
|
||||
public Color HoverColor
|
||||
{
|
||||
get => hoverColor;
|
||||
set
|
||||
{
|
||||
hoverColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
}
|
||||
set => hoverColor = value;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnMeasureItem(MeasureItemEventArgs e)
|
||||
|
@ -18,6 +18,7 @@
|
||||
*
|
||||
* 2022-01-22: V3.1.0 增加文件说明
|
||||
* 2022-03-19: V3.1.1 重构主题配色
|
||||
* 2023-11-16: V3.5.2 重构主题
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
@ -117,16 +118,10 @@ namespace Sunny.UI
|
||||
{
|
||||
foreColor = value;
|
||||
forecolorBrush.Color = foreColor;
|
||||
SetStyleCustom();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetStyleCustom(bool needRefresh = true)
|
||||
{
|
||||
_style = UIStyle.Custom;
|
||||
if (needRefresh) Invalidate();
|
||||
}
|
||||
|
||||
public string Version { get; }
|
||||
|
||||
/// <summary>
|
||||
@ -215,7 +210,7 @@ namespace Sunny.UI
|
||||
rectColor = value;
|
||||
if (rectSize != 0) drawPen.Color = rectColor;
|
||||
RectColorChanged?.Invoke(this, null);
|
||||
SetStyleCustom();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -103,12 +103,6 @@ namespace Sunny.UI
|
||||
|
||||
}
|
||||
|
||||
private void SetStyleCustom(bool needRefresh = true)
|
||||
{
|
||||
_style = UIStyle.Custom;
|
||||
if (needRefresh) Invalidate();
|
||||
}
|
||||
|
||||
private Color barColor = Color.FromArgb(56, 56, 56);
|
||||
|
||||
[DefaultValue(typeof(Color), "56, 56, 56"), Category("SunnyUI")]
|
||||
@ -161,7 +155,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
arrowColor = value;
|
||||
SetStyleCustom();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ namespace Sunny.UI
|
||||
{
|
||||
_fillColor = value;
|
||||
AfterSetFillColor(value);
|
||||
SetStyleCustom();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -201,7 +201,7 @@ namespace Sunny.UI
|
||||
if (tabSelectedForeColor != value)
|
||||
{
|
||||
tabSelectedForeColor = value;
|
||||
SetStyleCustom();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -243,7 +243,7 @@ namespace Sunny.UI
|
||||
if (tabSelectedHighColor != value)
|
||||
{
|
||||
tabSelectedHighColor = value;
|
||||
SetStyleCustom();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -305,12 +305,6 @@ namespace Sunny.UI
|
||||
_fillColor = uiColor.TabControlBackColor;
|
||||
}
|
||||
|
||||
private void SetStyleCustom(bool needRefresh = true)
|
||||
{
|
||||
_style = UIStyle.Custom;
|
||||
if (needRefresh) Invalidate();
|
||||
}
|
||||
|
||||
private UIMenuStyle _menuStyle = UIMenuStyle.Black;
|
||||
|
||||
[DefaultValue(UIMenuStyle.Black)]
|
||||
|
@ -279,7 +279,6 @@ namespace Sunny.UI
|
||||
if (fillColor != value)
|
||||
{
|
||||
fillColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
@ -930,7 +929,7 @@ namespace Sunny.UI
|
||||
scrollBarBackColor = fillColor;
|
||||
}
|
||||
|
||||
if (btn != null)
|
||||
if (btn != null && btn.Style == UIStyle.Inherited)
|
||||
{
|
||||
btn.ForeColor = uiColor.ButtonForeColor;
|
||||
btn.FillColor = uiColor.ButtonFillColor;
|
||||
@ -1486,7 +1485,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.FillColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1501,7 +1500,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.SymbolColor = btn.ForeColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1516,7 +1515,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.RectColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1528,7 +1527,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.FillHoverColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1540,7 +1539,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.SymbolHoverColor = btn.ForeHoverColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1552,7 +1551,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.RectHoverColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1564,7 +1563,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.FillPressColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1576,7 +1575,7 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.SymbolPressColor = btn.ForePressColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1588,7 +1587,23 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
btn.RectPressColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
btn.Style = UIStyle.Custom;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 滚动条主题样式
|
||||
/// </summary>
|
||||
[DefaultValue(true), Description("滚动条主题样式"), Category("SunnyUI")]
|
||||
public bool ButtonStyleInherited
|
||||
{
|
||||
get => btn != null && btn.Style == UIStyle.Inherited;
|
||||
set
|
||||
{
|
||||
if (value && btn != null)
|
||||
{
|
||||
btn.Style = UIStyle.Inherited;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,6 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
titleForeColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
@ -123,7 +122,6 @@ namespace Sunny.UI
|
||||
set
|
||||
{
|
||||
titleColor = value;
|
||||
_style = UIStyle.Custom;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user