Toolbars: a toolbar's command buttons are looked up together

The footer of a toolbar made with New Toolbar looked up each command
button's label on its own, which rebuilt the tool homes once per button
on every render. `palette::button_texts` looks up all of a toolbar's
buttons from one kept build, and `command_looks` uses it.

docs/mcp.md now says which errors apply to `toolbar.addCommand` and
which to both commands, and that `toolbar.removeCommand` answers with
the unchanged list for a command the toolbar has no button for.
This commit is contained in:
dotCooCoo committed 2026-11-25 18:19:41 -08:00
1 parent 2e8cc468f1
commit cbbb98149e
4 files changed
+38 -10

No files matched your search

+5 -3
View File
@@ -3798,9 +3798,11 @@ A toolbar made with New Toolbar holds command buttons after its tools. `toolbar.
named `toolbar`, or moves the button when the toolbar has it already: at place `at` among its command buttons, 0 for
the first, or at the end without `at`. `command` is a Command Palette result's id: a command's id, or
`plugin:<id>`, `effect:<id>` or `panel:<id>`. `toolbar.removeCommand {command, toolbar}` takes a button off. Both
answer with the toolbar's command buttons, and `window.toolbar.list` reports `commands` for each toolbar. An unknown
command, a tool, a command that needs params a click does not give (`toolbar.addTool`), an `at` past the end or a
missing `toolbar` is an error and changes nothing. A click on a button runs what the command's menu item runs, so a
answer with the toolbar's command buttons, and `window.toolbar.list` reports `commands` for each toolbar. A missing
`toolbar` is an error for both and changes nothing. For `toolbar.addCommand`, an unknown command, a tool, a command
that needs params a click does not give (`toolbar.addTool`) or an `at` past the end is also an error and changes
nothing. `toolbar.removeCommand` with a command the toolbar has no button for, a tool's id included, is not an error:
it answers with the toolbar's command buttons unchanged. A click on a button runs what the command's menu item runs, so a
command whose item ends in … opens its dialog, and the button is dimmed while that item is. A command that is no
longer installed, such as an uninstalled plug-in's, keeps its button, dimmed and labeled with its id, until it is
installed again or removed. `toolbar.reset {toolbar}` takes the buttons off with the tools. The buttons are kept with