mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 22:21:23 +12:00
Also move toolbar when annotate form moved
This commit is contained in:
parent
48681af900
commit
0c36f82302
|
@ -170,6 +170,7 @@ private void InitializeComponent()
|
|||
KeyUp += RegionCaptureForm_KeyUp;
|
||||
MouseDown += RegionCaptureForm_MouseDown;
|
||||
Resize += RegionCaptureForm_Resize;
|
||||
LocationChanged += RegionCaptureForm_LocationChanged;
|
||||
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
@ -277,6 +278,29 @@ private void CenterCanvas(bool updateCoordinates = true)
|
|||
}
|
||||
}
|
||||
|
||||
private void OnMoved()
|
||||
{
|
||||
if (ShapeManager != null)
|
||||
{
|
||||
UpdateCoordinates();
|
||||
|
||||
if (IsEditorMode && WindowState != lastWindowState)
|
||||
{
|
||||
lastWindowState = WindowState;
|
||||
|
||||
if (WindowState == FormWindowState.Normal || WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
CenterCanvas(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsAnnotationMode && ShapeManager.ToolbarCreated)
|
||||
{
|
||||
ShapeManager.UpdateMenuPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefaultCursor()
|
||||
{
|
||||
if (Cursor != defaultCursor)
|
||||
|
@ -294,22 +318,12 @@ private void RegionCaptureForm_Shown(object sender, EventArgs e)
|
|||
|
||||
private void RegionCaptureForm_Resize(object sender, EventArgs e)
|
||||
{
|
||||
UpdateCoordinates();
|
||||
OnMoved();
|
||||
}
|
||||
|
||||
if (WindowState != lastWindowState)
|
||||
{
|
||||
lastWindowState = WindowState;
|
||||
|
||||
if (WindowState == FormWindowState.Normal || WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
CenterCanvas(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsAnnotationMode && ShapeManager != null && ShapeManager.ToolbarCreated)
|
||||
{
|
||||
ShapeManager.UpdateMenuPosition();
|
||||
}
|
||||
private void RegionCaptureForm_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnMoved();
|
||||
}
|
||||
|
||||
internal void RegionCaptureForm_KeyDown(object sender, KeyEventArgs e)
|
||||
|
|
Loading…
Reference in a new issue