* <fix> 信息窗口避开鼠标指针指向区域
This commit is contained in:
nsnail 2022-12-05 16:40:44 +08:00 committed by GitHub
parent 1ba7f3fcfe
commit deebd018f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ public class WinInfo : Form
_graphics.InterpolationMode = InterpolationMode.NearestNeighbor; //指定最临近插值法,禁止平滑缩放(模糊)
_graphics.CompositingQuality = CompositingQuality.HighQuality;
_graphics.SmoothingMode = SmoothingMode.None;
_pbox.MouseEnter += PboxOnMouseEnter;
Controls.Add(_pbox);
}
@ -36,6 +37,12 @@ public class WinInfo : Form
Dispose(false);
}
private void PboxOnMouseEnter(object sender, EventArgs e)
{
// 信息窗口避开鼠标指针指向区域
Location = new Point(Location.X, Location.Y == 0 ? Screen.PrimaryScreen!.Bounds.Height - _WINDOW_SIZE : 0);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);