* UIStyle: 增加全局字体大小设置
This commit is contained in:
parent
c9b6653ad1
commit
017c49a2f7
Binary file not shown.
@ -29,7 +29,7 @@ namespace Sunny.UI
|
||||
{
|
||||
public static float DPIScale()
|
||||
{
|
||||
return GDI.Graphics().DpiX / 96.0f;
|
||||
return GDI.Graphics().DpiX / 96.0f / (UIStyles.FontSize / 12.0f);
|
||||
}
|
||||
|
||||
public static bool DPIScaleIsOne()
|
||||
|
@ -154,6 +154,8 @@ namespace Sunny.UI
|
||||
{
|
||||
public static bool DPIScale { get; set; }
|
||||
|
||||
public static float FontSize { get; set; } = 12;
|
||||
|
||||
public static List<UIStyle> PopularStyles()
|
||||
{
|
||||
List<UIStyle> styles = new List<UIStyle>();
|
||||
|
@ -75,5 +75,12 @@ namespace Sunny.UI
|
||||
get => UIStyles.DPIScale;
|
||||
set => UIStyles.DPIScale = value;
|
||||
}
|
||||
|
||||
[DefaultValue(12f), Description("DPI缩放开启后,可调字体大小,默认12"), Category("SunnyUI")]
|
||||
public float FontSize
|
||||
{
|
||||
get => UIStyles.FontSize;
|
||||
set => UIStyles.FontSize = value;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user