From 56cf767ab7a9e4c57a3c04c7279097783eb9e43f Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 1 Oct 2016 14:13:54 +0300 Subject: [PATCH] If screen smaller than toolbar width then move menu to top left corner --- .../Shapes/ShapeManagerMenu.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs index ab02a4a41..f1ea63c81 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs @@ -67,11 +67,10 @@ private void CreateMenu() Dock = DockStyle.None, GripStyle = ToolStripGripStyle.Hidden, Location = new Point(0, 0), - MinimumSize = new Size(100, 30), + MinimumSize = new Size(600, 30), Padding = new Padding(0, 0, 0, 0), Renderer = new CustomToolStripProfessionalRenderer(), - TabIndex = 0, - Text = "ToolStrip" + TabIndex = 0 }; tsMain.SuspendLayout(); @@ -609,7 +608,15 @@ private void CreateMenu() menuForm.Show(form); Rectangle rect = CaptureHelpers.GetActiveScreenBounds0Based(); - menuForm.Location = new Point(rect.X + rect.Width / 2 - tsMain.Width / 2, rect.Y + 20); + + if (rect.Width > tsMain.Width) + { + menuForm.Location = new Point(rect.X + rect.Width / 2 - tsMain.Width / 2, rect.Y + 20); + } + else + { + menuForm.Location = rect.Location; + } form.Activate();