mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-07 07:26:05 +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,
|
Dock = DockStyle.None,
|
||||||
GripStyle = ToolStripGripStyle.Hidden,
|
GripStyle = ToolStripGripStyle.Hidden,
|
||||||
Location = new Point(0, 0),
|
Location = new Point(0, 0),
|
||||||
MinimumSize = new Size(100, 30),
|
MinimumSize = new Size(600, 30),
|
||||||
Padding = new Padding(0, 0, 0, 0),
|
Padding = new Padding(0, 0, 0, 0),
|
||||||
Renderer = new CustomToolStripProfessionalRenderer(),
|
Renderer = new CustomToolStripProfessionalRenderer(),
|
||||||
TabIndex = 0,
|
TabIndex = 0
|
||||||
Text = "ToolStrip"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tsMain.SuspendLayout();
|
tsMain.SuspendLayout();
|
||||||
|
@ -609,7 +608,15 @@ private void CreateMenu()
|
||||||
menuForm.Show(form);
|
menuForm.Show(form);
|
||||||
|
|
||||||
Rectangle rect = CaptureHelpers.GetActiveScreenBounds0Based();
|
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();
|
form.Activate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue