mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Center region capture toolbar to active monitor
This commit is contained in:
parent
a66c056254
commit
afd81c2181
1 changed files with 17 additions and 12 deletions
|
@ -973,24 +973,29 @@ private void ConfigureMenuState()
|
|||
|
||||
internal void UpdateMenuPosition()
|
||||
{
|
||||
Rectangle rectScreen = form.RectangleToScreen(form.ScreenRectangle0Based);
|
||||
Rectangle rectScreen;
|
||||
|
||||
if (Config.RememberMenuState && rectScreen.Contains(Config.MenuPosition))
|
||||
if (form.IsFullscreen)
|
||||
{
|
||||
menuForm.Location = Config.MenuPosition;
|
||||
rectScreen = CaptureHelpers.GetActiveScreenBounds();
|
||||
rectScreen.Y += 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Rectangle rectActiveScreen = CaptureHelpers.GetActiveScreenBounds();
|
||||
rectScreen = form.RectangleToScreen(form.ScreenRectangle0Based);
|
||||
}
|
||||
|
||||
if (tsMain.Width < rectScreen.Width)
|
||||
{
|
||||
menuForm.Location = new Point(rectScreen.X + rectScreen.Width / 2 - tsMain.Width / 2, rectScreen.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
menuForm.Location = rectScreen.Location;
|
||||
}
|
||||
if (!form.IsEditorMode && Config.RememberMenuState && rectScreen.Contains(Config.MenuPosition))
|
||||
{
|
||||
menuForm.Location = Config.MenuPosition;
|
||||
}
|
||||
else if (tsMain.Width < rectScreen.Width)
|
||||
{
|
||||
menuForm.Location = new Point(rectScreen.X + rectScreen.Width / 2 - tsMain.Width / 2, rectScreen.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
menuForm.Location = rectScreen.Location;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue