mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 11:40:40 -07:00
GetOptimalWindowSize - bound by available screen space
Limiting by working area size was not good enough - having whole chrome on screen is important.
This commit is contained in:
parent
95c759e3fd
commit
ec2c46daa8
1 changed files with 3 additions and 4 deletions
|
@ -1502,10 +1502,9 @@ namespace Greenshot {
|
|||
var newHeight = chromeSize.Height + surfaceSize.Height;
|
||||
|
||||
// Upper bound. Don't make it bigger than the available working area.
|
||||
var screen = Screen.FromControl(this);
|
||||
var workingArea = screen.WorkingArea;
|
||||
newWidth = Math.Min(newWidth, workingArea.Width);
|
||||
newHeight = Math.Min(newHeight, workingArea.Height);
|
||||
var maxWindowSize = GetAvailableScreenSpace();
|
||||
newWidth = Math.Min(newWidth, maxWindowSize.Width);
|
||||
newHeight = Math.Min(newHeight, maxWindowSize.Height);
|
||||
|
||||
// Lower bound. Don't make it smaller than a fixed value.
|
||||
int minimumFormWidth = 650;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue