* UITitlePanel:更新大小调整后的按钮位置

This commit is contained in:
Sunny 2020-08-03 20:28:53 +08:00
parent 28ace61ad3
commit 6a47388f74
5 changed files with 28 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -341,7 +341,7 @@ namespace Sunny.UI
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
/* base.OnMouseWheel(e);
if (Bar.Visible)
{
var si = ScrollBarInfo.GetInfo(Handle);
@ -359,7 +359,7 @@ namespace Sunny.UI
ScrollBarInfo.ScrollDown(Handle);
}
}
}
}*/
SetScrollInfo();
}

View File

@ -233,6 +233,8 @@ namespace Sunny.UI
private bool collapsed;
private int rowHeight = 180;
private bool resizing;
[Description("是否缩放"), Category("SunnyUI"), DefaultValue(false)]
public bool Collapsed
@ -242,8 +244,9 @@ namespace Sunny.UI
{
if (value)
{
rowHeight = Height;
resizing = true;
Height = TitleHeight;
resizing = false;
}
else
{
@ -257,12 +260,32 @@ namespace Sunny.UI
protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
if (ShowCollapse && e.Location.InRect(ControlBoxRect))
{
Collapsed = !Collapsed;
}
base.OnMouseClick(e);
}
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
CalcSystemBoxPos();
if (!resizing)
{
rowHeight = Height;
}
}
protected override void OnMouseDoubleClick(MouseEventArgs e)
{
if (ShowCollapse && e.Location.Y <= TitleHeight)
{
Collapsed = !Collapsed;
}
base.OnMouseDoubleClick(e);
}
}
}