Lay the buttons out the way N1MM lays them out

The twelve function keys were one row of twelve at the bottom of the window,
with the action row under them. N1MM puts both between the entry boxes and the
bearing line, six keys to a row in two rows, each row filling the width.

The action row takes N1MM's widths as well: 23 per cent to the first button and
the rest shared out. N1MM gives the remaining seven 11 per cent each; there are
five here, because Mark and Store are missing, so they share the same 77.

Looked at under Xvfb against the N1MM screenshot: same two rows of six, same
action row under them, same order down the window.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
2026-08-30 22:07:11 +00:00
parent 13a1acfcab
commit bb35848e11
3 changed files with 40 additions and 22 deletions

View File

@@ -23,6 +23,10 @@ public sealed partial class EntryWindow : Window
private readonly List<Button> functionButtons = [];
private const double MilesPerKilometre = 0.621371;
/// The width of the function key panel, in buttons. N1MM's is six wide and
/// two deep; the XAML holds the same six columns.
private const int FunctionKeyColumns = 6;
private static readonly IBrush Dark = new SolidColorBrush(Color.FromArgb(0x33, 0x80, 0x80, 0x80));
private bool sending;
@@ -850,7 +854,8 @@ public sealed partial class EntryWindow : Window
/// The labels come from the message file, so what the buttons say is what
/// the operator wrote. Right-clicking one opens the editor, as it does on
/// the telnet window's buttons.
/// the telnet window's buttons. Twelve keys in two rows of six, as N1MM
/// lays them out.
private void BuildFunctionKeys()
{
FunctionKeys.Children.Clear();
@@ -868,6 +873,8 @@ public sealed partial class EntryWindow : Window
_ = EditMessages();
}
};
Grid.SetColumn(button, at % FunctionKeyColumns);
Grid.SetRow(button, at / FunctionKeyColumns);
FunctionKeys.Children.Add(button);
functionButtons.Add(button);
}