* UIProcessBar: 调整最小宽度,以适应垂直方向显示

This commit is contained in:
Sunny 2024-05-09 14:21:38 +08:00
parent 6b047520f4
commit 1c0d65d816
2 changed files with 8 additions and 10 deletions

View File

@ -25,6 +25,7 @@
* 2022-09-05: V3.2.3 1
* 2023-05-12: V3.3.6 DrawString函数
* 2023-09-05: V3.4.2 Int越界问题
* 2024-05-09: V3.6.6
******************************************************************************/
using System;
@ -48,7 +49,7 @@ namespace Sunny.UI
public UIProcessBar()
{
SetStyleFlags(true, false);
MinimumSize = new Size(70, 3);
MinimumSize = new Size(3, 3);
Size = new Size(300, 29);
ShowText = false;
@ -151,8 +152,12 @@ namespace Sunny.UI
else
processText = posValue.ToString();
Size sf = TextRenderer.MeasureText(processText, Font);
bool canShow = Height > sf.Height + 4;
Size sf = TextRenderer.MeasureText("100%", Font);
bool canShow;
if (Direction == UILine.LineDirection.Horizontal)
canShow = Height > sf.Height + 4;
else
canShow = Width > sf.Width + 4;
if (ShowValue && canShow)
{

View File

@ -37,13 +37,6 @@
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Remove="Common\FastLZx64.dat" />
<None Remove="Common\FastLZx86.dat" />
<None Remove="Font\MaterialIcons-Regular.ttf" />
<None Remove="Font\sa-digital-number.ttf" />
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>