mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-24 04:02:36 +01:00
[Main] - Fix issues regarding to multi-monitor.
This commit is contained in:
parent
7818b1f915
commit
683c01ed9c
@ -1081,17 +1081,19 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
var screen = Screen.FromControl(this);
|
||||
var ctrlScreen = Screen.FromControl(this);
|
||||
|
||||
if (screen.Bounds.Width < Width)
|
||||
Width = screen.Bounds.Width;
|
||||
if (screen.Bounds.Height < Height)
|
||||
Height = screen.Bounds.Height;
|
||||
if (ctrlScreen.Bounds.Width < Width)
|
||||
Width = ctrlScreen.Bounds.Width;
|
||||
if (ctrlScreen.Bounds.Height < Height)
|
||||
Height = ctrlScreen.Bounds.Height;
|
||||
|
||||
if (screen.Bounds.X + screen.Bounds.Width - 200 < Left)
|
||||
Left = screen.Bounds.X + screen.Bounds.Width - Width;
|
||||
if (screen.Bounds.Y + screen.Bounds.Height - 100 < Top)
|
||||
Top = screen.Bounds.Y + screen.Bounds.Height - Height;
|
||||
// Fix main window coordinate (Multi-Monitor issue)
|
||||
if ((ctrlScreen.Bounds.Right < Left) || (ctrlScreen.Bounds.Bottom < Top) ||
|
||||
(ctrlScreen.Bounds.X > Right) || (ctrlScreen.Bounds.Y > Top))
|
||||
{
|
||||
CenterToScreen();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user