fixed #7300: Fixed Pin to screen auto hide issue

This commit is contained in:
Jaex 2024-03-13 10:10:31 +03:00
parent a17a1f3047
commit 6d353451be
3 changed files with 9 additions and 3 deletions

View File

@ -35,6 +35,7 @@
this.tsbOptions,
this.tsbClose});
this.tsMain.Name = "tsMain";
this.tsMain.MouseLeave += new System.EventHandler(this.tsMain_MouseLeave);
//
// tsbCopy
//

View File

@ -214,9 +214,9 @@ namespace ShareX
private void UpdateControls()
{
int toolbarMargin = 10;
int toolbarMargin = 20;
tsMain.Visible = ClientRectangle.Contains(PointToClient(MousePosition)) &&
ClientRectangle.Contains(new Rectangle(0, 0, (Options.Border ? Options.BorderSize * 2 : 0) + tsMain.Width + toolbarMargin * 2,
ClientRectangle.Contains(new Rectangle(0, 0, (Options.Border ? Options.BorderSize * 2 : 0) + tsMain.Width + toolbarMargin,
(Options.Border ? Options.BorderSize * 2 : 0) + tsMain.Height + toolbarMargin));
tslScale.Text = ImageScale + "%";
}
@ -501,6 +501,11 @@ namespace ShareX
UpdateControls();
}
private void tsMain_MouseLeave(object sender, EventArgs e)
{
UpdateControls();
}
private void PinToScreenForm_KeyUp(object sender, KeyEventArgs e)
{
switch (e.KeyData)

View File

@ -181,7 +181,7 @@
<value>tsMain</value>
</data>
<data name="&gt;&gt;tsMain.Type" xml:space="preserve">
<value>ShareX.HelpersLib.ToolStripEx, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.ToolStripEx, ShareX.HelpersLib, Version=16.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;tsMain.Parent" xml:space="preserve">
<value>$this</value>