From 84dacf3d759c76865de1da8d7dbc4f54f5a93831 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 7 Oct 2023 11:28:15 +0300 Subject: [PATCH] fixed #7086: Auto hide toolbar if toolbar is bigger than form --- ShareX/Tools/PinToScreen/PinToScreenForm.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ShareX/Tools/PinToScreen/PinToScreenForm.cs b/ShareX/Tools/PinToScreen/PinToScreenForm.cs index 0f20d390d..035728e77 100644 --- a/ShareX/Tools/PinToScreen/PinToScreenForm.cs +++ b/ShareX/Tools/PinToScreen/PinToScreenForm.cs @@ -214,9 +214,8 @@ protected override void Dispose(bool disposing) private void UpdateControls() { - bool isCursorInside = ClientRectangle.Contains(PointToClient(MousePosition)); - - tsMain.Visible = isCursorInside; + tsMain.Visible = ClientRectangle.Contains(PointToClient(MousePosition)) && + ClientRectangle.Contains(tsMain.Bounds.SizeOffset(tsMain.Location.X, tsMain.Location.Y)); tslScale.Text = ImageScale + "%"; } @@ -265,6 +264,8 @@ private void AutoSizeForm() NativeMethods.SetWindowPos(Handle, insertAfter, newLocation.X, newLocation.Y, newSize.Width, newSize.Height, flags); + UpdateControls(); + Refresh(); }