mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Fixed an issue which was described in #217, also did some hardening that it doesn't happen on other locations in the TextContainer.
This commit is contained in:
parent
80c262d47f
commit
ca0095491b
1 changed files with 13 additions and 3 deletions
|
@ -157,11 +157,17 @@ namespace Greenshot.Drawing
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SwitchParent(Surface newParent)
|
protected override void SwitchParent(Surface newParent)
|
||||||
|
{
|
||||||
|
if (_parent != null)
|
||||||
{
|
{
|
||||||
_parent.SizeChanged -= Parent_SizeChanged;
|
_parent.SizeChanged -= Parent_SizeChanged;
|
||||||
|
}
|
||||||
base.SwitchParent(newParent);
|
base.SwitchParent(newParent);
|
||||||
|
if (_parent != null)
|
||||||
|
{
|
||||||
_parent.SizeChanged += Parent_SizeChanged;
|
_parent.SizeChanged += Parent_SizeChanged;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Parent_SizeChanged(object sender, EventArgs e)
|
private void Parent_SizeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -320,8 +326,12 @@ namespace Greenshot.Drawing
|
||||||
|
|
||||||
private void HideTextBox()
|
private void HideTextBox()
|
||||||
{
|
{
|
||||||
_parent.Focus();
|
_parent?.Focus();
|
||||||
_textBox?.Hide();
|
_textBox?.Hide();
|
||||||
|
if (_parent == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
_parent.KeysLocked = false;
|
_parent.KeysLocked = false;
|
||||||
_parent.Controls.Remove(_textBox);
|
_parent.Controls.Remove(_textBox);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue