From 5f66ecef7bf6afc4023a019ae4cdcc91e79824bc Mon Sep 17 00:00:00 2001 From: Arda Aydin Date: Fri, 4 Sep 2026 21:28:34 +0300 Subject: [PATCH] Tidy Layout on Ctrl/Cmd+W Joins the Command/Control shortcut pairs, so the chord works the same on either platform, and the View menu entry now shows it. Co-Authored-By: Claude Opus 5 --- README.md | 1 + app_state.py | 2 +- main.py | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04467e2..b215f8d 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Undoing back to the depth of the last save clears the dirty tint rather than lea | `Ctrl`/`Cmd` + `Y` or `Ctrl`/`Cmd` + `Shift` + `Z` | Redo | | `Del` / `Backspace` | Delete selected component | | `Ctrl`/`Cmd` + `B` | Show or hide the tree/palette column | +| `Ctrl`/`Cmd` + `W` | Tidy Layout: re-flow the open sheet | | `Alt` + `Left` / `Alt` + `Right` | Back and forward through the sheets opened this session | Both `Command-` and `Control-` are bound for each, so the same build works on macOS and diff --git a/app_state.py b/app_state.py index 11c3bdf..3f54563 100644 --- a/app_state.py +++ b/app_state.py @@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it. import configparser import os -VERSION = "0.0.0.030" +VERSION = "0.0.0.031" PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties") DEFAULT_GRID_SIZE = 10 DEFAULT_ADD_TIMESTAMP = True diff --git a/main.py b/main.py index 07e8cd1..4035a31 100644 --- a/main.py +++ b/main.py @@ -1174,6 +1174,7 @@ SHORTCUTS = [ ("z", do_undo), ("y", do_redo), ("b", toggle_left_column), + ("w", do_tidy_layout), ] for key, handler in SHORTCUTS: window.bind_all(f"", handler) @@ -1229,7 +1230,9 @@ menu_view.add_command( label=MENU_FORWARD_LABEL, command=go_forward, accelerator="Alt+Right", state="disabled" ) menu_view.add_separator() -menu_view.add_command(label="Tidy Layout", command=do_tidy_layout) +menu_view.add_command( + label="Tidy Layout", command=do_tidy_layout, accelerator=f"{accel_mod}+W" +) menu_bar.add_cascade(label="View", menu=menu_view) menu_kits = tk.Menu(menu_bar, tearoff=0)