When panning set SizeAll cursor

This commit is contained in:
Jaex 2017-10-17 17:54:19 +03:00
parent 096ab1c74d
commit 1c84e7308e
2 changed files with 12 additions and 1 deletions

View file

@ -96,6 +96,7 @@ public Color CurrentColor
private bool pause, isKeyAllowed;
private RectangleAnimation regionAnimation;
private Bitmap bmpBackgroundImage;
private Cursor defaultCursor;
public RegionCaptureForm(RegionCaptureMode mode)
{
@ -105,6 +106,8 @@ public RegionCaptureForm(RegionCaptureMode mode)
ScreenRectangle0Based = CaptureHelpers.ScreenToClient(ScreenRectangle);
ImageRectangle = ScreenRectangle0Based;
defaultCursor = Helpers.CreateCursor(Resources.Crosshair);
InitializeComponent();
Config = new RegionCaptureOptions();
@ -137,7 +140,7 @@ private void InitializeComponent()
AutoScaleDimensions = new SizeF(6F, 13F);
AutoScaleMode = AutoScaleMode.Font;
Cursor = Helpers.CreateCursor(Resources.Crosshair);
SetDefaultCursor();
Icon = ShareXResources.Icon;
StartPosition = FormStartPosition.Manual;
FormBorderStyle = FormBorderStyle.None;
@ -245,6 +248,11 @@ internal void InitBackground(Image img)
}
}
public void SetDefaultCursor()
{
Cursor = defaultCursor;
}
private void RegionCaptureForm_Shown(object sender, EventArgs e)
{
this.ForceActivate();
@ -1244,6 +1252,7 @@ protected override void Dispose(bool disposing)
if (textOuterBorderPen != null) textOuterBorderPen.Dispose();
if (textInnerBorderPen != null) textInnerBorderPen.Dispose();
if (markerPen != null) markerPen.Dispose();
if (defaultCursor != null) defaultCursor.Dispose();
if (regionFillPath != null)
{

View file

@ -730,11 +730,13 @@ private void EndRegionSelection()
private void StartPanning()
{
IsPanning = true;
form.Cursor = Cursors.SizeAll;
}
private void EndPanning()
{
IsPanning = false;
form.SetDefaultCursor();
}
private BaseShape AddShape()