mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 14:11:38 +12:00
If screen smaller than toolbar width then move menu to top left corner
This commit is contained in:
parent
b243116c75
commit
56cf767ab7
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue