mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 13:10:00 -07:00
This should keep the slack workaround but fix #367
This commit is contained in:
parent
c701aad58c
commit
8ce4735aad
1 changed files with 11 additions and 10 deletions
|
@ -153,9 +153,11 @@ namespace Greenshot.Forms
|
||||||
|
|
||||||
_currentForm = this;
|
_currentForm = this;
|
||||||
|
|
||||||
|
// Enable the AnimatingForm
|
||||||
|
EnableAnimation = true;
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
FormClosed += ClosedHandler;
|
FormClosed += ClosedHandler;
|
||||||
Resize += CaptureForm_Resize;
|
|
||||||
_capture = capture;
|
_capture = capture;
|
||||||
_windows = windows;
|
_windows = windows;
|
||||||
_captureMode = capture.CaptureDetails.CaptureMode;
|
_captureMode = capture.CaptureDetails.CaptureMode;
|
||||||
|
@ -168,8 +170,6 @@ namespace Greenshot.Forms
|
||||||
DoubleBuffered = !IsTerminalServerSession;
|
DoubleBuffered = !IsTerminalServerSession;
|
||||||
Text = @"Greenshot capture form";
|
Text = @"Greenshot capture form";
|
||||||
|
|
||||||
SetSize();
|
|
||||||
|
|
||||||
// Make sure we never capture the capture-form
|
// Make sure we never capture the capture-form
|
||||||
WindowDetails.RegisterIgnoreHandle(Handle);
|
WindowDetails.RegisterIgnoreHandle(Handle);
|
||||||
// Un-register at close
|
// Un-register at close
|
||||||
|
@ -187,8 +187,10 @@ namespace Greenshot.Forms
|
||||||
// Set the zoomer animation
|
// Set the zoomer animation
|
||||||
InitializeZoomer(Conf.ZoomerEnabled);
|
InitializeZoomer(Conf.ZoomerEnabled);
|
||||||
|
|
||||||
// Enable the AnimatingForm
|
// Make sure the size is set correctly
|
||||||
EnableAnimation = true;
|
SetSize();
|
||||||
|
|
||||||
|
Resize += CaptureForm_Resize;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CaptureForm_Resize(object sender, EventArgs e)
|
private void CaptureForm_Resize(object sender, EventArgs e)
|
||||||
|
@ -205,12 +207,12 @@ namespace Greenshot.Forms
|
||||||
|
|
||||||
private void SetSize()
|
private void SetSize()
|
||||||
{
|
{
|
||||||
Log.DebugFormat("Setting CaptureForm with dimensions {0}", _capture.ScreenBounds);
|
Log.DebugFormat("Setting CaptureForm to dimensions {0}", _capture.ScreenBounds);
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
Bounds = _capture.ScreenBounds;
|
Bounds = _capture.ScreenBounds;
|
||||||
ResumeLayout();
|
ResumeLayout();
|
||||||
|
|
||||||
// Fix missing focus
|
// Make sure it's visible and has focus
|
||||||
ToFront = true;
|
ToFront = true;
|
||||||
TopMost = true;
|
TopMost = true;
|
||||||
}
|
}
|
||||||
|
@ -220,16 +222,15 @@ namespace Greenshot.Forms
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeZoomer(bool isOn)
|
private void InitializeZoomer(bool isOn)
|
||||||
{
|
{
|
||||||
var startingPosition = new Rectangle(_cursorPos, Size.Empty);
|
|
||||||
if (isOn)
|
if (isOn)
|
||||||
{
|
{
|
||||||
// Initialize the zoom with a invalid position
|
// Initialize the zoom with a invalid position
|
||||||
_zoomAnimator = new RectangleAnimator( startingPosition , new Rectangle(int.MaxValue, int.MaxValue, 0, 0), FramesForMillis(1000), EasingType.Quintic, EasingMode.EaseOut);
|
_zoomAnimator = new RectangleAnimator(Rectangle.Empty, new Rectangle(int.MaxValue, int.MaxValue, 0, 0), FramesForMillis(1000), EasingType.Quintic, EasingMode.EaseOut);
|
||||||
VerifyZoomAnimation(_cursorPos, false);
|
VerifyZoomAnimation(_cursorPos, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_zoomAnimator?.ChangeDestination(startingPosition, FramesForMillis(1000));
|
_zoomAnimator?.ChangeDestination(new Rectangle(Point.Empty, Size.Empty), FramesForMillis(1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue