From 44fe29939c248c039dabc3e32d8310536f37d430 Mon Sep 17 00:00:00 2001 From: Pr0metheus2 Date: Wed, 18 Nov 2026 13:09:43 +0100 Subject: [PATCH 1/2] Compact filter panel spacing ## Summary Reduces unused vertical space in the filter UI. - The Advanced / ProFilter section now sizes itself to its actual controls instead of reserving a fixed 110 px height. - The F4 Text filter row is reduced from 46 px to 41 px, leaving only a minimal bottom margin. - The content below the Text filter row moves up accordingly. ## Verification - Built `LogExpert.UI` in Debug configuration successfully. - Checked manually that the Advanced and F4 filter areas have less unused space. --- src/LogExpert.UI/Controls/LogWindow/LogWindow.cs | 14 ++++++++++---- .../Controls/LogWindow/LogWindow.designer.cs | 8 ++++---- src/setup/GeneratedFiles.iss | 6 ------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs index 56174ee8..ce92aa4b 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs @@ -48,7 +48,7 @@ internal partial class LogWindow : DockContent, ILogPaintContextUI, ILogView, IL #region Fields private const int PROGRESS_BAR_MODULO = 1000; - private const int FILTER_ADVANCED_SPLITTER_DISTANCE = 110; + private const int FILTER_ADVANCED_PANEL_BOTTOM_MARGIN = 1; private const int FILTER_PANEL2_CONTROL_GAP = 6; private const int WAIT_TIME = 500; private const int OVERSCAN = 20; @@ -257,7 +257,7 @@ public LogWindow (ILogWindowCoordinator logWindowCoordinator, string fileName, b filterTailCheckBox.Checked = _filterParams.IsFilterTail; splitContainerLogWindow.Panel2Collapsed = true; - advancedFilterSplitContainer.SplitterDistance = FILTER_ADVANCED_SPLITTER_DISTANCE; + SetAdvancedFilterSplitterDistance(); _timeShiftSyncTask = Task.Factory.StartNew(SyncTimestampDisplayWorker, _cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); _tailFollowEngine = new TailFollowEngine(this); @@ -2404,7 +2404,7 @@ private void OnFreeThisWindowFromTimeSyncToolStripMenuItemClick (object sender, [SupportedOSPlatform("windows")] private void OnSplitContainerSplitterMoved (object sender, SplitterEventArgs e) { - advancedFilterSplitContainer.SplitterDistance = FILTER_ADVANCED_SPLITTER_DISTANCE; + SetAdvancedFilterSplitterDistance(); } [SupportedOSPlatform("windows")] @@ -5203,10 +5203,16 @@ private void ShowAdvancedFilterPanel (bool show) } advancedFilterSplitContainer.Panel1Collapsed = !show; - advancedFilterSplitContainer.SplitterDistance = FILTER_ADVANCED_SPLITTER_DISTANCE; + SetAdvancedFilterSplitterDistance(); _showAdvanced = show; } + private void SetAdvancedFilterSplitterDistance () + { + var contentBottom = pnlProFilter.Controls.Cast().Max(control => control.Bottom); + advancedFilterSplitContainer.SplitterDistance = pnlProFilter.Top + contentBottom + FILTER_ADVANCED_PANEL_BOTTOM_MARGIN; + } + [SupportedOSPlatform("windows")] private void CheckForAdvancedButtonDirty () { diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs index 90594731..be9dc2f8 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs @@ -429,9 +429,9 @@ private void InitializeComponent () // advancedBackPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; advancedBackPanel.Controls.Add(advancedFilterSplitContainer); - advancedBackPanel.Location = new Point(3, 48); + advancedBackPanel.Location = new Point(3, 43); advancedBackPanel.Name = "advancedBackPanel"; - advancedBackPanel.Size = new Size(1855, 561); + advancedBackPanel.Size = new Size(1855, 566); advancedBackPanel.TabIndex = 3; // // advancedFilterSplitContainer @@ -869,7 +869,7 @@ private void InitializeComponent () pnlFilterInput.Controls.Add(filterSplitContainer); pnlFilterInput.Location = new Point(3, 2); pnlFilterInput.Name = "pnlFilterInput"; - pnlFilterInput.Size = new Size(1855, 46); + pnlFilterInput.Size = new Size(1855, 41); pnlFilterInput.TabIndex = 0; // // filterSplitContainer @@ -894,7 +894,7 @@ private void InitializeComponent () filterSplitContainer.Panel2.Controls.Add(filterCaseSensitiveCheckBox); filterSplitContainer.Panel2.Controls.Add(btnfilterSearch); filterSplitContainer.Panel2MinSize = 726; - filterSplitContainer.Size = new Size(1855, 46); + filterSplitContainer.Size = new Size(1855, 41); filterSplitContainer.SplitterDistance = 518; filterSplitContainer.TabIndex = 11; filterSplitContainer.MouseDoubleClick += OnFilterSplitContainerMouseDoubleClick; diff --git a/src/setup/GeneratedFiles.iss b/src/setup/GeneratedFiles.iss index 207134bb..ee40060c 100644 --- a/src/setup/GeneratedFiles.iss +++ b/src/setup/GeneratedFiles.iss @@ -16,7 +16,6 @@ Source: "{#ReleaseFolder}\LogExpert.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\LogExpert.PluginRegistry.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\LogExpert.Resources.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\LogExpert.UI.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleaseFolder}\Microsoft.Win32.SystemEvents.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\NAudio.Asio.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\NAudio.Core.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\NAudio.dll"; DestDir: "{app}"; Flags: ignoreversion @@ -29,12 +28,7 @@ Source: "{#ReleaseFolder}\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignorev Source: "{#ReleaseFolder}\NLog.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\NuGet.Versioning.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\System.CommandLine.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleaseFolder}\System.Drawing.Common.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleaseFolder}\System.Formats.Nrbf.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\System.Numerics.Tensors.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleaseFolder}\System.Private.Windows.Core.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleaseFolder}\System.Private.Windows.GdiPlus.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleaseFolder}\System.Resources.Extensions.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\Vanara.Core.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\Vanara.PInvoke.ComCtl32.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleaseFolder}\Vanara.PInvoke.Cryptography.dll"; DestDir: "{app}"; Flags: ignoreversion From e7b854b228f24d6cf7cb440de9cae2fcdd340459 Mon Sep 17 00:00:00 2001 From: Pr0metheus2 Date: Wed, 18 Nov 2026 15:19:38 +0100 Subject: [PATCH 2/2] Improve F4 filter-panel layout at high DPI Improves the Text Filter / F4 panel layout and removes unnecessary vertical space. - Sizes the Advanced/ProFilter area from its actual content instead of a fixed splitter position. - Reduces unused space around the F4 Text Filter and Advanced panels. - Keeps Search, filter checkboxes, and Show advanced compact and visible at high DPI (including 200%). - Uses consistent checkbox spacing without scaling empty gaps with DPI. - Recalculates the layout after DPI changes and once initial control scaling has completed. - Aligns all fields in F4 row vertically Verification: - Built LogExpert.UI Debug successfully (0 errors). - Manually checked at 100%, 150%, and 200% display scaling. --- .../Controls/LogWindow/LogWindow.cs | 53 +++++++++++++++++-- .../Controls/LogWindow/LogWindow.designer.cs | 10 ++-- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs index ce92aa4b..6447ea05 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs @@ -49,7 +49,9 @@ internal partial class LogWindow : DockContent, ILogPaintContextUI, ILogView, IL private const int PROGRESS_BAR_MODULO = 1000; private const int FILTER_ADVANCED_PANEL_BOTTOM_MARGIN = 1; - private const int FILTER_PANEL2_CONTROL_GAP = 6; + private const int FILTER_INPUT_PANEL_BOTTOM_MARGIN = 1; + private const int FILTER_PANEL2_CONTROL_GAP = 7; + private const int MINIMUM_FILTER_TEXT_BOX_WIDTH = 100; private const int WAIT_TIME = 500; private const int OVERSCAN = 20; private const int COLUMN_FINDER_HEIGHT = 28; @@ -196,6 +198,7 @@ public LogWindow (ILogWindowCoordinator logWindowCoordinator, string fileName, b InitializeComponent(); SetResources(); + SetFilterInputPanelHeight(); CreateDefaultViewStyle(); @@ -247,9 +250,7 @@ public LogWindow (ILogWindowCoordinator logWindowCoordinator, string fileName, b filterComboBox.DropDownHeight = filterComboBox.ItemHeight * configManager.Settings.Preferences.MaximumFilterEntriesDisplayed; - // Keep Panel2 wide enough that "Show advanced..." (btnAdvanced, the rightmost left-anchored - // control) never overlaps the right-anchored filter-count label when the text filter grows. - filterSplitContainer.Panel2MinSize = FilterSplitterLayout.RequiredPanel2Width(btnAdvanced.Right, lblFilterCount.Width, FILTER_PANEL2_CONTROL_GAP); + LayoutFilterControls(); AutoResizeFilterBox(); filterRegexCheckBox.Checked = _filterParams.IsRegex; @@ -724,6 +725,10 @@ protected override string GetPersistString () protected override void OnDpiChangedAfterParent (EventArgs e) { base.OnDpiChangedAfterParent(e); + LayoutFilterControls(); + AutoResizeFilterBox(); + SetFilterInputPanelHeight(); + SetAdvancedFilterSplitterDistance(); ApplyMarkerPreferences(); } @@ -877,6 +882,10 @@ private void OnLogWindowLoad (object sender, EventArgs e) var lastColumnWidth = Preferences.LastColumnWidth; PreferencesChanged(Preferences.Font, setLastColumnWidth, lastColumnWidth, true, SettingsFlags.GuiOrColors); + LayoutFilterControls(); + AutoResizeFilterBox(); + SetFilterInputPanelHeight(); + SetAdvancedFilterSplitterDistance(); } [SupportedOSPlatform("windows")] @@ -5213,6 +5222,40 @@ private void SetAdvancedFilterSplitterDistance () advancedFilterSplitContainer.SplitterDistance = pnlProFilter.Top + contentBottom + FILTER_ADVANCED_PANEL_BOTTOM_MARGIN; } + private void SetFilterInputPanelHeight () + { + var contentBottom = filterSplitContainer.Panel1.Controls.Cast() + .Concat(filterSplitContainer.Panel2.Controls.Cast()) + .Max(control => control.Bottom); + pnlFilterInput.Height = contentBottom + FILTER_INPUT_PANEL_BOTTOM_MARGIN; + advancedBackPanel.Top = pnlFilterInput.Bottom; + } + + private void LayoutFilterControls () + { + // Keep gaps in screen pixels so high-DPI scaling enlarges controls, not empty space between them. + var gap = FILTER_PANEL2_CONTROL_GAP; + var nextLeft = btnfilterSearch.Right + gap; + lblTextFilter.AutoSize = true; + var filterComboBoxRight = filterComboBox.Right; + filterComboBox.Left = lblTextFilter.Right + gap; + filterComboBox.Width = filterComboBoxRight - filterComboBox.Left; + filterSplitContainer.Panel1MinSize = filterComboBox.Left + MINIMUM_FILTER_TEXT_BOX_WIDTH; + + foreach (var checkBox in new[] { filterCaseSensitiveCheckBox, filterRegexCheckBox, filterTailCheckBox, syncFilterCheckBox }) + { + checkBox.Left = nextLeft; + checkBox.Top = btnfilterSearch.Top + (btnfilterSearch.Height - checkBox.Height) / 2; + nextLeft = checkBox.Right + gap; + } + + lblTextFilter.Top = filterCaseSensitiveCheckBox.Top + (filterCaseSensitiveCheckBox.Height - lblTextFilter.Height) / 2; + btnAdvanced.Left = nextLeft; + + // Keep Panel2 wide enough that the rightmost left-anchored control never overlaps the filter-count label. + filterSplitContainer.Panel2MinSize = FilterSplitterLayout.RequiredPanel2Width(btnAdvanced.Right, lblFilterCount.Width, gap); + } + [SupportedOSPlatform("windows")] private void CheckForAdvancedButtonDirty () { @@ -8189,4 +8232,4 @@ public void RefreshLogView () /// Line navigation waiting for the load's first visibility scan. private readonly record struct PendingNavigation (Action Navigate, bool IsTimeSyncFollow); -} +} \ No newline at end of file diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs index be9dc2f8..8db2c878 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs @@ -429,9 +429,9 @@ private void InitializeComponent () // advancedBackPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; advancedBackPanel.Controls.Add(advancedFilterSplitContainer); - advancedBackPanel.Location = new Point(3, 43); + advancedBackPanel.Location = new Point(3, 48); advancedBackPanel.Name = "advancedBackPanel"; - advancedBackPanel.Size = new Size(1855, 566); + advancedBackPanel.Size = new Size(1855, 561); advancedBackPanel.TabIndex = 3; // // advancedFilterSplitContainer @@ -869,7 +869,7 @@ private void InitializeComponent () pnlFilterInput.Controls.Add(filterSplitContainer); pnlFilterInput.Location = new Point(3, 2); pnlFilterInput.Name = "pnlFilterInput"; - pnlFilterInput.Size = new Size(1855, 41); + pnlFilterInput.Size = new Size(1855, 46); pnlFilterInput.TabIndex = 0; // // filterSplitContainer @@ -894,7 +894,7 @@ private void InitializeComponent () filterSplitContainer.Panel2.Controls.Add(filterCaseSensitiveCheckBox); filterSplitContainer.Panel2.Controls.Add(btnfilterSearch); filterSplitContainer.Panel2MinSize = 726; - filterSplitContainer.Size = new Size(1855, 41); + filterSplitContainer.Size = new Size(1855, 46); filterSplitContainer.SplitterDistance = 518; filterSplitContainer.TabIndex = 11; filterSplitContainer.MouseDoubleClick += OnFilterSplitContainerMouseDoubleClick; @@ -1290,4 +1290,4 @@ private void InitializeComponent () private ToolStripSeparator menuToolStripSeparator5; private ToolStripSeparator menuToolStripSeparator6; } -} +} \ No newline at end of file