* UINavBar: 标题选中高亮颜色增加可调整高度

This commit is contained in:
Sunny 2021-06-08 22:08:00 +08:00
parent 1d37a896e9
commit 917888c3c3
8 changed files with 26 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -230,6 +230,26 @@ namespace Sunny.UI
}
}
private int selectedHighColorSize = 4;
/// <summary>
/// 选中页高亮高度
/// </summary>
[Description("选中Tab页高亮高度"), Category("SunnyUI")]
[DefaultValue(4)]
public int SelectedHighColorSize
{
get => selectedHighColorSize;
set
{
value = Math.Max(value, 0);
value = Math.Min(value, 8);
selectedHighColorSize = value;
Invalidate();
}
}
private UIStyle _style = UIStyle.Blue;
/// <summary>
@ -390,9 +410,9 @@ namespace Sunny.UI
e.Graphics.FillRectangle(MenuSelectedColor, rect.X, Height - NodeSize.Height, rect.Width, NodeSize.Height);
}
if (!NavBarMenu.Visible)
if (!NavBarMenu.Visible && SelectedHighColorSize > 0)
{
e.Graphics.FillRectangle(SelectedHighColor, rect.X, Height - 4, rect.Width, 4);
e.Graphics.FillRectangle(SelectedHighColor, rect.X, Height - SelectedHighColorSize, rect.Width, SelectedHighColorSize);
}
textColor = SelectedForeColor;

View File

@ -295,7 +295,7 @@ namespace Sunny.UI
private int tabSelectedHighColorSize = 4;
/// <summary>
/// 边框颜色
/// 选中Tab页高亮高度
/// </summary>
[Description("选中Tab页高亮高度"), Category("SunnyUI")]
[DefaultValue(4)]
@ -305,7 +305,9 @@ namespace Sunny.UI
get => tabSelectedHighColorSize;
set
{
tabSelectedHighColorSize = Math.Max(value, 0);
value = Math.Max(value, 0);
value = Math.Min(value, 8);
tabSelectedHighColorSize = value;
Invalidate();
}
}