fixed #7086: Auto hide toolbar if toolbar is bigger than form

This commit is contained in:
Jaex 2023-10-07 11:28:15 +03:00
parent 2f07fba591
commit 84dacf3d75

View file

@ -214,9 +214,8 @@ protected override void Dispose(bool disposing)
private void UpdateControls() private void UpdateControls()
{ {
bool isCursorInside = ClientRectangle.Contains(PointToClient(MousePosition)); tsMain.Visible = ClientRectangle.Contains(PointToClient(MousePosition)) &&
ClientRectangle.Contains(tsMain.Bounds.SizeOffset(tsMain.Location.X, tsMain.Location.Y));
tsMain.Visible = isCursorInside;
tslScale.Text = ImageScale + "%"; tslScale.Text = ImageScale + "%";
} }
@ -265,6 +264,8 @@ private void AutoSizeForm()
NativeMethods.SetWindowPos(Handle, insertAfter, newLocation.X, newLocation.Y, newSize.Width, newSize.Height, flags); NativeMethods.SetWindowPos(Handle, insertAfter, newLocation.X, newLocation.Y, newSize.Width, newSize.Height, flags);
UpdateControls();
Refresh(); Refresh();
} }