mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
Merge pull request #9119 from dotCooCoo/feat/toolbar-command-buttons
Toolbars: a toolbar made with New Toolbar holds menu command buttons
This commit is contained in:
11 files changed
+669
-31
No files matched your search
@@ -491,8 +491,20 @@ toolbars Tab hid are turned off. A toolbar's ••• button
|
||||
button (Add Tool…) opens a menu of every tool under the drawer's headings: a click on a tool runs `toolbar.addTool
|
||||
{tool, toolbar}`, which puts it at the end, and the tools under its Remove Tool heading run `toolbar.removeTool
|
||||
{tool, toolbar}`; the tools already in the toolbar are dimmed under their headings. The drawer has no Show section
|
||||
there. `window.floatTools {tool, toolbar}` floats one of its groups, and a group torn off it shows and hides with
|
||||
it. `window.toolbar.list` returns the toolbars (`ui.custom_toolbars` in `ui.inspect`: name, slots, shown flag,
|
||||
there. The same menu's Add Command submenu searches the Command Palette's results other than tools, and a pick runs
|
||||
`toolbar.addCommand {command, toolbar}`, which puts a command button at the end of the toolbar, after its tools;
|
||||
`toolbar.addCommand {command, toolbar, at}` moves one to place `at` among the command buttons (Move Up and Move Down
|
||||
in the button's context menu), and `toolbar.removeCommand {command, toolbar}` takes one off (Remove Command in the
|
||||
menu, Remove from Toolbar in the context menu). `command` is a palette result's id: a command's id, or
|
||||
`plugin:<id>`, `effect:<id>` or `panel:<id>`. A click on the button runs what the command's menu item runs, and the
|
||||
button is dimmed while that item is. 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 a place 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 command that is no longer installed keeps its button, dimmed, and `toolbar.removeCommand` still
|
||||
takes it off.
|
||||
`window.floatTools {tool, toolbar}` floats one of its groups, and a group torn off it shows and hides with it.
|
||||
`window.toolbar.list` returns the toolbars (`ui.custom_toolbars` in `ui.inspect`: name, slots, commands, shown flag,
|
||||
two-column flag, top-left corner, the groups torn off it, and `dock` and `dock_right` while docked or once docked).
|
||||
`window.toolbar.dock {name, side?, order?}` docks a toolbar as a column of the dock along the window's left or right
|
||||
edge, and `window.toolbar.float {name, x?, y?}` floats it again; dragging its title bar does the same (see the docking section in `docs/mcp.md`). They are kept with the workspace they were made in:
|
||||
|
||||
+22
@@ -4202,6 +4202,28 @@ workspace. These are VectorCraft's own layout rules.
|
||||
{"name":"invoke_menu","arguments":{"command":"window.toolbar.dock","params":{"name":"Toolbar 1","side":"left","order":0}}}
|
||||
```
|
||||
|
||||
## Command buttons on toolbars made with New Toolbar
|
||||
|
||||
A toolbar made with New Toolbar holds command buttons after its tools. `toolbar.addCommand {command, toolbar, at?}`
|
||||
(Add Command in the toolbar's Add Tool… menu, remote mode, `invoke_menu`) puts a button for `command` on the 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. 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
|
||||
the workspace, and toolbars saved before command buttons existed load without any. Command buttons are VectorCraft's
|
||||
own.
|
||||
|
||||
```json
|
||||
{"name":"invoke_menu","arguments":{"command":"toolbar.addCommand","params":{"command":"object.group","toolbar":"Toolbar 1"}}}
|
||||
```
|
||||
|
||||
## Help search
|
||||
|
||||
Help › VectorCraft Help… and F1 show the Help panel. `help.discover {query?}` opens it without
|
||||
|
||||
@@ -1219,6 +1219,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- The dock's double arrow collapses Properties, Layers and Libraries to icons at the top of the icon column, popping out like the other icon panels, and expands them again (`window.collapseDock`, kept with the preferences and in saved workspaces). The icon column's own arrow (expanding the icon panels into a full column) is not done.
|
||||
- Window › Toolbars › New Toolbar… and New Toolbar… in the All Tools drawer's menu ask for a name and make a blank toolbar that floats on its own, moved by its title bar and listed under Window › Toolbars, whose item shows or hides it. The title bar's × hides it, and its double arrow shows its tools in one column or two. Its ••• button opens the All Tools drawer beside it, and tools dragged from the drawer fill it. The toolbars are kept with the workspace they were made in: switching workspaces shows that workspace's toolbars, Reset Workspace keeps them, and New Workspace starts the new workspace with a copy of them (<https://helpx.adobe.com/illustrator/using/tools.html>; `window.toolbar.new`, `window.toolbar.custom`, the `toolbar` param of `window.editToolbar` and `toolbar.addTool`/`removeTool`/`reset`; `tools_added_to_a_new_toolbar_survive_a_workspace_reload`).
|
||||
- A toolbar made with New Toolbar has a + button (Add Tool…) above its ••• button. A click on it, or Enter while it has the keyboard focus, opens a menu of every tool under the All Tools drawer's headings, without the drawer: a tool picked there goes at the end of that toolbar, and the tools already in it are dimmed. Under Remove Tool, the menu lists the toolbar's tools, and a click takes one out. This menu is VectorCraft's own way to fill a toolbar without a drag (`toolbar.addTool` and `toolbar.removeTool` with `toolbar`; `the_add_tool_menu_fills_a_new_toolbar_without_a_drag`).
|
||||
- A toolbar made with New Toolbar also holds command buttons, after its tools. The Add Command submenu at the end of its Add Tool… menu searches every Command Palette result other than a tool (menu commands, plug-in commands, effects and panels), and a pick adds a button at the end; Remove Command in the same menu lists the buttons and takes one off. A button shows its command's label without the ellipsis, on up to two lines, and its full name and shortcut on hover. A click runs what the command's menu item runs, so a command whose item ends in … opens its dialog. While that item is dimmed the button is dimmed and runs nothing. The button's context menu has Move Up, Move Down and Remove from Toolbar. The buttons are kept with the toolbar in the workspace, Manage Toolbars' copy keeps them, and a toolbar saved without them loads unchanged. A command that is gone, such as an uninstalled plug-in's, keeps its button, dimmed and labeled with its id, until it comes back or is removed. Not done: dragging a menu item or a Command Palette result onto a toolbar, an Add to Toolbar item in the palette, dragging command buttons to reorder or remove them, and command icons (a button shows its label). Command buttons are VectorCraft's own (`toolbar.addCommand`, `toolbar.removeCommand`; `command_buttons_are_added_moved_and_removed_by_their_commands`, `a_command_button_runs_its_command_and_is_dimmed_while_it_cannot`, `a_missing_command_stays_dimmed_until_it_is_removed`, `a_plugin_command_button_works_again_when_the_plugin_returns`, `a_panel_button_shows_its_panel`, `command_buttons_ask_whether_they_can_run_a_few_at_a_time`, `the_add_tool_menu_adds_and_removes_commands`).
|
||||
- Window › Toolbars › Manage Toolbars… and Manage Toolbars… in the All Tools drawer's menu open a dialog that lists the toolbars made with New Toolbar: a new name typed for the selected toolbar renames it, + copies it with its tools (with none selected, + makes a blank toolbar), and the trash can deletes it. Each change shows under Window › Toolbars and stays in the workspace (<https://helpx.adobe.com/illustrator/using/tools.html>; `window.toolbar.manage`, `window.toolbar.rename`, `window.toolbar.duplicate`, `window.toolbar.delete`; `manage_toolbars_renames_duplicates_and_deletes`).
|
||||
- In the All Tools drawer a tool the toolbar holds is drawn throughout — name, shortcut and icon — in the dim text colour, one step dimmer than a tool not in it, so it still reads as in the toolbar while its name stays readable against the panel; the disabled colour it was drawn in before was about 2.6:1 on the panel, unreadable at the drawer's 12.5 px (#8294; `tools_in_the_toolbar_are_dimmed_in_the_drawer` in `crates/ui-egui/src/edit_toolbar/tests.rs`, which asserts the painted colour's contrast). The dimming is VectorCraft's own (#1018).
|
||||
- A toolbar made with New Toolbar docks in a lane along the window's left or right edge when its title bar is dropped on that edge, or with Dock to Left and Dock to Right in the title bar's context menu. Toolbars docked at one edge stack from the top, each with its share of the lane's height, and the lane is as wide as its widest toolbar; a lane too short for its stack wraps it into more columns, up to half the window's width, and past that the toolbars show only their title bars, which the mouse wheel scrolls through when even they do not fit. Dragging the title bar out of the lane, or Float Toolbar, floats it again, and Escape during the drag puts it back. Hiding and renaming keep its place, and the workspace keeps it. New toolbars still start floating. The lanes and the stacking are VectorCraft's own rules (#1759; `window.toolbar.dock`, `window.toolbar.float`; `toolbars_dock_and_float_by_their_commands`, `docked_toolbars_stack_in_lanes_along_the_window_edges`, `a_title_bar_dropped_on_an_edge_docks_the_toolbar`).
|
||||
|
||||
Reference in new issue
Block a user