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 @@