From 606c43e4a69ff5ac370dab9d19a5659b6ed4b897 Mon Sep 17 00:00:00 2001 From: ericek111 Date: Thu, 10 Sep 2026 17:02:15 +0000 Subject: [PATCH] Take half the room either side of the text in a log cell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The values sit closer to the line between the columns, and a column that is as wide as its values is fifteen pixels narrower. A header takes much more room besides its text than a cell does — its own padding, and the room the theme keeps for the sort arrow — so the two are now measured with an allowance each. One allowance for both clipped "Mode" and "CQ-Zone" to the column width the values needed. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ --- src/Nonemm.App/Windows/LogWindow.Columns.cs | 12 ++++++++---- src/Nonemm.App/Windows/LogWindow.axaml | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Nonemm.App/Windows/LogWindow.Columns.cs b/src/Nonemm.App/Windows/LogWindow.Columns.cs index 610ab5e..e7afbdb 100644 --- a/src/Nonemm.App/Windows/LogWindow.Columns.cs +++ b/src/Nonemm.App/Windows/LogWindow.Columns.cs @@ -19,8 +19,12 @@ namespace Nonemm.App.Windows; /// lasts as long as the window is open. public sealed partial class LogWindow { - /// What a cell takes either side of its text, in device pixels. - private const double CellPadding = 30; + /// What a cell takes besides its text, in device pixels. + private const double CellPadding = 15; + + /// What a header takes besides its text: its own padding and the room the + /// theme keeps for the sort arrow, which is much more than a cell takes. + private const double HeaderPadding = 45; private readonly Dictionary columnOf = []; private IReadOnlyList shown = []; @@ -185,8 +189,8 @@ public sealed partial class LogWindow /// theme's own font — so each is measured in the font it is drawn in. private static double WidthFor(QsoColumn column, DataGrid grid) => Math.Max( - TextWidth(new string('0', column.Width + 1), grid.FontFamily, grid.FontSize), - TextWidth(column.Label + "0", FontFamily.Default, grid.FontSize)) + CellPadding; + TextWidth(new string('0', column.Width + 1), grid.FontFamily, grid.FontSize) + CellPadding, + TextWidth(column.Label + "0", FontFamily.Default, grid.FontSize) + HeaderPadding); private static double TextWidth(string text, FontFamily family, double size) => new FormattedText( diff --git a/src/Nonemm.App/Windows/LogWindow.axaml b/src/Nonemm.App/Windows/LogWindow.axaml index 2a09de0..2a07798 100644 --- a/src/Nonemm.App/Windows/LogWindow.axaml +++ b/src/Nonemm.App/Windows/LogWindow.axaml @@ -12,6 +12,9 @@