From d5343c9e3d3f401704820ebef1f9522cac7c58fb Mon Sep 17 00:00:00 2001 From: pointfeev Date: Tue, 20 Sep 2022 15:35:21 -0400 Subject: [PATCH] improve debug --- CreamInstaller/Forms/DebugForm.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CreamInstaller/Forms/DebugForm.cs b/CreamInstaller/Forms/DebugForm.cs index 1a607b0..3096cf7 100644 --- a/CreamInstaller/Forms/DebugForm.cs +++ b/CreamInstaller/Forms/DebugForm.cs @@ -47,11 +47,13 @@ internal partial class DebugForm : CustomForm attachedForm.Activated -= OnChange; attachedForm.LocationChanged -= OnChange; attachedForm.SizeChanged -= OnChange; + attachedForm.VisibleChanged -= OnChange; } attachedForm = form; attachedForm.Activated += OnChange; attachedForm.LocationChanged += OnChange; attachedForm.SizeChanged += OnChange; + attachedForm.VisibleChanged += OnChange; UpdateAttachment(); } @@ -59,12 +61,12 @@ internal partial class DebugForm : CustomForm internal void UpdateAttachment() { - if (attachedForm is null) - return; - Size = new(Size.Width, attachedForm.Size.Height); - Location = new(attachedForm.Right, attachedForm.Top); - Show(); - BringToFrontWithoutActivation(); + if (attachedForm is not null && attachedForm.Visible) + { + //Size = new(Size.Width, attachedForm.Size.Height); + Location = new(attachedForm.Right, attachedForm.Top); + BringToFrontWithoutActivation(); + } } internal void Log(string text) => Log(text, LogTextBox.Error);