From 3588d8adaaf36f7f5fe84f93d736efb7fd1f3cd9 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 17 Apr 2024 00:11:24 +0200 Subject: [PATCH] Output Formatting on Window Changed, and Z-Order --- OBSBlur/OBS/Blur.cs | 4 ++-- OBSBlur/Window/WindowInfo.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OBSBlur/OBS/Blur.cs b/OBSBlur/OBS/Blur.cs index 7017799..1fa91fa 100644 --- a/OBSBlur/OBS/Blur.cs +++ b/OBSBlur/OBS/Blur.cs @@ -171,7 +171,7 @@ public class Blur { uint i = 0; - string print = $"Z-order changed\n{"Z",-3} | {"hWnd",-8} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n"; + string print = $"Z-order changed\n{"Z",3} | {"hWnd",-10} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n"; foreach (IntPtr windowHandle in newOrder) { WindowInfo windowInfo = _windowManager.WindowInfos.FirstOrDefault(w => w.WindowHandle == windowHandle); @@ -186,7 +186,7 @@ public class Blur private void WindowManagerOnWindowsChanged(WindowInfo[] before, WindowInfo[] after) { - string print = $"Window changed\n{"hWnd",-8} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n"; + string print = $"Window changed\n{"hWnd",-10} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n"; foreach (WindowInfo windowInfo in after) print += $"{windowInfo}\n"; _logger?.LogInformation(print); diff --git a/OBSBlur/Window/WindowInfo.cs b/OBSBlur/Window/WindowInfo.cs index 9e691af..1edef7a 100644 --- a/OBSBlur/Window/WindowInfo.cs +++ b/OBSBlur/Window/WindowInfo.cs @@ -45,6 +45,6 @@ public readonly struct WindowInfo const int cutoffStr = 17; string processNameStr = ProcessInfo.ProcessName.Substring(0, Math.Min(cutoffStr, ProcessInfo.ProcessName.Length)); string windowTitleStr = WindowTitle.Substring(0, Math.Min(cutoffStr, WindowTitle.Length)); - return $"0x{WindowHandle,-6:X} | {ProcessInfo.Id,8} | {processNameStr,cutoffStr} | {windowTitleStr,-cutoffStr} | {WindowCommands,-13} | {WindowRectangle}"; + return $"0x{WindowHandle,-8:X} | {ProcessInfo.Id,8} | {processNameStr,cutoffStr} | {windowTitleStr,-cutoffStr} | {WindowCommands,-13} | {WindowRectangle}"; } } \ No newline at end of file