GUI: edit layouts, copy a layout, and start with saved files present

- The Layout tab edits the chosen layout: its three rows as text, or
  two keys swapped by clicking them on the board. Copy adds a copy to
  edit; built-in layouts cannot be edited.
- An edit that puts a character on two keys, or leaves a character of
  the texts on no key, is rejected and reported.
- The initial model is a function called from main. As a module-level
  value it read saved-layouts.txt, params.txt and presets/ where no
  scope is open, and the GUI did not start when one of them existed.
- The test covers the editor and runs with saved layouts present. It
  writes saved-layouts.txt back as it was.
- New screenshots, and a README section on editing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-11-17 12:03:16 +01:00
parent 6e6afad071
commit 1da78595bd
8 changed files with 297 additions and 45 deletions

View file

@ -89,6 +89,20 @@ The chosen layout and each part of its score, for each text and as the mean.
You can save a layout under a name, or remove a layout that is not built in.
Saved layouts are kept in `saved-layouts.txt` and are listed at start.
To make a layout of your own, choose one and click **Copy**. Then change the
copy:
- Type in the three row fields. They use the same format as
`src/layouts.bjo`.
- Click two keys on the board to swap them.
The scores change at once. A built-in layout cannot be changed, and the
original of a copy does not change. An edit is rejected if a character is on
two keys, or if a character of the texts is on no key. A changed layout is
saved to the file only when you click **Save layout**.
![A copy of ZYK,Å with Y and Z swapped](docs/editing.png)
### Search
Runs the optimizer from the chosen layout with the current numbers. For each