From e5086a9609d6743be34db85264ee9e15265688e0 Mon Sep 17 00:00:00 2001 From: campbeb Date: Sat, 9 Jul 2016 16:37:02 -0400 Subject: [PATCH] Scale Greenshot editor window size when icons larger than default Scales based on approximate number of icons displayed and size of icon over 16 pixels --- Greenshot.ImageEditor/Forms/ImageEditorForm.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Greenshot.ImageEditor/Forms/ImageEditorForm.cs b/Greenshot.ImageEditor/Forms/ImageEditorForm.cs index cbf2f36f5..de7c1cb6a 100644 --- a/Greenshot.ImageEditor/Forms/ImageEditorForm.cs +++ b/Greenshot.ImageEditor/Forms/ImageEditorForm.cs @@ -327,8 +327,9 @@ private void SurfaceSizeChanged(object sender, EventArgs e) Size imageSize = Surface.Image.Size; Size currentFormSize = Size; Size currentImageClientSize = panel1.ClientSize; - int minimumFormWidth = 650; - int minimumFormHeight = 530; + // Scale minimum size based on icons over default 16 pixels + int minimumFormWidth = 650 + 24 * Math.Max(coreConfiguration.IconSize.Width - 16, 0); + int minimumFormHeight = 530 + 17 * Math.Max(coreConfiguration.IconSize.Height - 16, 0); int newWidth = Math.Max(minimumFormWidth, currentFormSize.Width - currentImageClientSize.Width + imageSize.Width); int newHeight = Math.Max(minimumFormHeight, currentFormSize.Height - currentImageClientSize.Height + imageSize.Height); Size = new Size(newWidth, newHeight);