improve debug

This commit is contained in:
pointfeev 2022-09-20 15:35:21 -04:00
parent f672e52ffc
commit d5343c9e3d

View file

@ -47,11 +47,13 @@ internal partial class DebugForm : CustomForm
attachedForm.Activated -= OnChange; attachedForm.Activated -= OnChange;
attachedForm.LocationChanged -= OnChange; attachedForm.LocationChanged -= OnChange;
attachedForm.SizeChanged -= OnChange; attachedForm.SizeChanged -= OnChange;
attachedForm.VisibleChanged -= OnChange;
} }
attachedForm = form; attachedForm = form;
attachedForm.Activated += OnChange; attachedForm.Activated += OnChange;
attachedForm.LocationChanged += OnChange; attachedForm.LocationChanged += OnChange;
attachedForm.SizeChanged += OnChange; attachedForm.SizeChanged += OnChange;
attachedForm.VisibleChanged += OnChange;
UpdateAttachment(); UpdateAttachment();
} }
@ -59,13 +61,13 @@ internal partial class DebugForm : CustomForm
internal void UpdateAttachment() internal void UpdateAttachment()
{ {
if (attachedForm is null) if (attachedForm is not null && attachedForm.Visible)
return; {
Size = new(Size.Width, attachedForm.Size.Height); //Size = new(Size.Width, attachedForm.Size.Height);
Location = new(attachedForm.Right, attachedForm.Top); Location = new(attachedForm.Right, attachedForm.Top);
Show();
BringToFrontWithoutActivation(); BringToFrontWithoutActivation();
} }
}
internal void Log(string text) => Log(text, LogTextBox.Error); internal void Log(string text) => Log(text, LogTextBox.Error);