`document.export`, `document.serialize` and `document.exportSelection`
accept a key that only another format takes. `{"format": "pdf",
"quality": 80}` wrote the PDF and gave no warning about `quality`.
The reply's `warnings` now name each such key, in the wording of a
save's note: "`quality` was not used: PDF files don't read it".
- The format's own options, the commands' own keys, null values and an
exporter plug-in's format get no note.
- The note names the kind of file written. A legacy `.ai` file
(`aiVersion: "7"`) reads `outlineText`, `hiddenObjects`,
`transparentImages`, the artboard choice and `useArtboards`, and
beside `aiVersion` no other option. The other `.ai` files don't read
those three options or `preserveEditing`, which is always on for
them.
- An export doesn't read `separateArtboards`, or `range` for a
`vectorcraft` or `template` file. A save reads them to write each
artboard to a file of its own.
- In the app, an export that automation asked for (`app.export` with a
path, `file.exportAs` run as a command) gives the same notes in its
reply and in the status bar. A Background Export replies before the
file is written, and that reply has the notes. An export that a
person starts from the File menu gets none.
- Export As gives a template export no `useArtboards` or `range`: a
template doesn't read them.
- `vectorcraft-cli convert` sends `outlineText` only with
`--outline-text`, and `hiddenLayers` only to the formats that read
it. A conversion then warns only about an option the command line
gave.
`document.save` gives its notes as before: it does not apply the `.ai`
rules above.
Docs: docs/mcp.md, docs/control-protocol.md,
docs/target-app-parity.md, the params text of the three commands.
The Layers panel's trash button, rows dropped on it, the panel menu's
Delete Selection, and Delete or Backspace on highlighted rows now run
ui.layerDelete. When a layer or sublayer among the rows holds art
(hidden, locked and nested objects count; guides do not), a confirm
dialog asks first. OK deletes the rows it asked about, by id, in the
document it was asked in, as one undo step; Cancel keeps them. Empty
layers, guide-only layers and object or group rows alone are deleted at
once. layer.delete itself is unchanged and never asks.
With Background Save on, Package's OK started the save of a dirty
document on the worker and then wrote the package whether or not that
save succeeded. With both preferences off, a failed save already stopped
the package, so the result depended on the preferences.
The package now starts only after the save is written, with both
preferences in every combination. With Background Export on, it is still
collected from the document as it was at OK and starts once the save's
result arrives; when the save fails, or asks a question first, no package
is written and the save's error stays in the status bar. With Background
Export off, the dialog shows the save's error.
background::after runs a step on the UI thread once a job's result is
applied.
The double-click right of an RGB field was the only way to switch R, G and B
between percent and 0 to 255 from the UI. ui.colorRgbPercent (Toggle RGB
Percent) is listed in the command palette and in Keyboard Shortcuts without a
default key, and switches the same setting. A parameter answers an error and
changes nothing. The label has a row in every complete catalog.
File > Save as PDF... leaves the file to the save panel. When the panel
picked the file the document was opened from, and opening it left
things out, Save PDF's OK replaced it without asking. It now asks first,
as it does for a given path.
Export As PDF with Use Artboards off wrote DisplayDocTitle true for a
document without a title of its own, titled after its file, while the
same dialog with Use Artboards on, and document.exportPdf, wrote false.
Every PDF Export As writes now shows the title in the viewer only when
it is the document's own.
docs/control-protocol.md: app.export continues in savePdf for any PDF,
and ui.savePdfDialog's reply with useArtboards false is Export As's.
The progress-doc line is its own line.
In RGB mode a double-click in the cell right of the R, G or B field
switches all three fields and sliders between 0 to 255 and percent (0 to
100 with a % suffix, as the CMYK fields show). The color does not change;
a typed percent converts back (50% is 127.5 of 255) and a slider click
picks a whole percent. Web Safe RGB, the hex field and the other modes
keep their units.
Only RGB rows have the cell. It is blank, is highlighted under the
pointer, and takes no keyboard focus, so Tab does not stop on it. The
RGB sliders are narrower by the cell's width and spacing, so an RGB row
is as wide as a row in the other modes and Tint, in a narrow panel too.
While a mixed selection disables the rows, a double-click on the cell
does nothing, as the fields beside it take no input.
The double-click runs ui.colorPanel {rgbPercent}, which takes a bool and
answers it. The setting is off by default and is kept with the
preferences (ui.color_rgb_percent); a saved value that is not true or
false reads as off. The color mixer in the Fill and Stroke chips'
popovers (Control bar and Properties panel) and the gradient stop dialog
show the same rows and follow the same setting.
Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
Export As starts with Use Artboards off. For a PDF it then wrote one
page of the art's bounds straight away with the default preset, so the
Save PDF dialog never showed and none of its options applied there,
"Write pages longer than 200 in at full size in points" included.
Export As now opens Save PDF with Use Artboards on or off. With it off,
the dialog has no Artboards section, and OK writes one page of the
visible art's bounds the way Export As writes its other formats: with
Background Export, the progress dialog and its Cancel, and the question
before replacing the file the document was opened from. View PDF after
Saving opens that file too.
document.exportPdf listed useArtboards among its options but did not
read it. false now writes the page that document.export writes, and
ignores artboard, artboards and range; both commands use one helper
for it. document.pdfSettings refuses a useArtboards that isn't true or
false, and with includeDocument it exports that page, so the Summary's
warnings are about it.
While an opacity mask or symbol is being edited, document.exportPdf
and document.pdfSettings leave out the editing layer, from the drawn
pages and from the Preserve Editing data, as document.export does.
With the artboards as pages too, Save PDF's OK over the file the
document was opened from, when opening it left things out, now asks
first (file.export.pdf), and the question stays open when the dialog
closes.
On Linux, ui.sampleScreenColor and the Color Picker's eyedropper button
now show the XDG desktop portal's color sampler (Screenshot.PickColor,
https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Screenshot.html).
A thread of its own makes the call and waits for the person, and the
picked sRGB color goes through the same conversion into the working RGB
space as on macOS and the web. A cancel leaves the colors as they were.
A session without a portal that has PickColor, a portal that does not
return from the call within 25 seconds (VectorCraft's own limit) or
leaves the bus before it answers, and a portal that ends the request in
another way each show a status message and end the wait. The two new
messages are translated in every catalog that has the sampler's other
messages. The request token is random, as the Request documentation
asks (https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Request.html).
The window is named for the portal on the UI thread, as for the save
dialog, and the sampler's thread keeps the window and its export until
the portal answers.
`__savePresetAs` makes OK save a preset instead of writing the PDF or
printing. ui.dialog.set now accepts it only while Save Preset... has
added the field, so a request cannot add it and confirm in one step.
ui.dialog.set took every field whose name starts with `__`, so a control
request (or MCP's answer_dialog, which goes through it) could rewrite the
`__command` and `__params` of a confirmation or the generic parameter
dialog, a plug-in command dialog's `__command`, or the paste a swatch
conflict waits to finish, after a person opened the dialog. The person's
OK then ran something else.
A `__` field is now settable only when it is a control of that kind of
dialog: a section or tab shown, a link between two fields, a name or
search being typed (for example Save PDF's `__section`, Transform Each's
`__constrain`, the Preferences `__search`). Every other `__` field, held
or not, is refused with "the `<kind>` dialog cannot set protected field
`<field>`". The request sets no field, and with `action: "confirm"` OK
does not run. Flags a button sets together with other fields are refused
too: the style dialogs' `__reset*`, Artboard Options' `__fit`,
`__sizeChoice`, `__refx` and `__refy`, and Scribble's `__scribbleSetting`.
Recolor's Merge takes a row listed twice in the selection once, and
Randomize keeps a seed at u64::MAX instead of overflowing it.
Docs: docs/control-protocol.md, docs/mcp.md, docs/target-app-parity.md.
A save or export that writes a file per artboard, linked images or image
maps names them after the file picked in the save panel, which asked only
about that name. A file already there under one of the other names was
replaced without a question.
Save As, Save a Copy, Save as Template, Save and Export now check those
files before writing anything. When any is there, nothing is written and
a replaceFiles question names it (and lists all of them when there are
several). OK runs the save or export again on the document that asked and
replaces the named files; a file it would now write that the question did
not name is asked about again. Cancel writes nothing. A background save
or export checks from its worker and asks once it ends, after a dialog
open then. Files the document's last Save or Save As wrote are replaced
without asking.
Services::exists is now an Arc<dyn Fn(&str) -> bool + Send + Sync>.
An approval question that a control request, MCP, injected input, or a
file dialog one of them opened leads to now keeps OK disabled and
refuses every confirm, a person's click included. The dialog says to
choose Object › Plug-ins › Install Plug-in…, and ui.installPlugin answers
approval: "personMustStartInstall". The person's own Install Plug-in…,
File › Open or drop inspects the module again and asks a new question
with its half-second delay.
The origin is fixed when the request is made and goes with a native
file dialog's deferred answer and the web picker's answers, which now
arrive apart from drops and from window.vectorcraft.openFile (always
automation). A question about taking another module's place now opens
in the approval dialog, and automation's replace: true no longer skips
it. A module that needs no approval still installs at once.
DXF Options gets Include Placed Images and Include Fill Hatches, and
document.exportDxf and document.export {format: dxf} take
includeImages and includeHatches. Both are VectorCraft's own options
and default to true, so Custom exports write what they wrote before.
- includeImages: false writes no IMAGE entity, IMAGEDEF, reactor or
linked file for a placed image, and does not decode its pixels.
- includeHatches: false writes each filled area's outlines without the
solid HATCH after them.
- Each adds one note to warnings when it left something out. R12,
which has neither, keeps its own notes.
- The CNC / CAM preset sets both to false, so its drawing holds the
cutting paths alone; the options given still override it, and
changing either checkbox shows Custom.
Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
A save or an export with several notes named only the first of them in
the status bar, with the count, and the others could not be seen. The
status bar now keeps every note of a save or an export for the status
message's hover, as it does for an open's notes since #6752: resting
the pointer on the message lists them in the order the reply gives them
(a save's notes start with what the format loses), and screen readers
receive the list after the message. The status text is unchanged.
This covers Save, Save As, Save a Copy, Save as Template, Save a
Timestamped Copy, Save as PDF, Export As, Export Selection, Export for
Screens, Asset Export, Save for Web, Preview in Browser, Save for Office
Documents, Text Export Options, a print to a file and the CSS Properties
panel's export. The open, the saves and the exports read a reply's notes
through one helper.
Docs: docs/mcp.md and the css.exportFile params text,
docs/control-protocol.md, docs/target-app-parity.md.
VectorCraft could open and place HP-GL plot files but not write them,
so art for a pen plotter or a vinyl cutter had to go through another
program.
Export As, document.export and Export Selection now write HP-GL.
vectorcraft_cad::hpgl::export draws each visible path once along its
own line: a filled shape is its closed outline and a stroked path its
center line. Type is drawn as glyph outlines, a gradient mesh as its
outline, and a symbol instance as its art with its effects and the
instance's stain. Clipping masks cut the art they clip, and the art is
cut at the artboard's edges. Hidden and non-printing layers, hidden objects,
objects at 0% opacity, template layers, guides and placed images are
left out. Coordinates are plotter units (1016 to the inch, y up) from
the artboard's bottom-left corner or its center, and art more than
8,388,607 units from the origin is cut off.
Each color is a pen, in the order the plot first draws in it (up to
255), or a pen table maps each path to the pen of the nearest color.
With Use Artboards every file of the export uses the same numbering.
The pens draw in turn, each in paint order or, with sortPaths, nearest
path first. Curves are flattened to curveTolerance (0.1 pt by default).
hpglVersion "hpgl" writes IN, SP, PU and PD; "hpgl2" also writes the
palette (NP, PC) and each pen's paths as one encoded polyline (PE).
Options are checked, and Export As writes the file with the defaults.
Plots read back by the HP-GL reader give the same lines.
Docs: docs/mcp.md, docs/control-protocol.md, docs/file-format-parity.md,
docs/target-app-parity.md.
Document Setup gets a Color tab with the document color mode (RGB Color
or CMYK Color), a Convert to CMYK or Convert to RGB box for a mode
change (cleared, the colors keep their numbers), and the RGB and CMYK
profiles assigned to the document, with a working-space entry for none.
When the tab changes something, OK runs document.setup, then
edit.assignProfile, then file.documentColorMode in one command.batch,
and the document's changes are one undo step. Assign Profile runs first,
so a mode change converts through the profile picked with it. An
unchanged Color tab adds no color commands, and Cancel, or OK with
nothing changed, records no undo step. A Color tab field with a value of
the wrong kind is an error, and the dialog stays open with nothing
changed. File › Document Color Mode and Edit › Assign Profile… stay
where they are.
Catalogs: "Working RGB (don't tag)" and "Assign Profile" rows in every
complete catalog, and the "`{key}` must be a profile name or null"
message in every complete-message catalog. Docs: docs/mcp.md,
docs/control-protocol.md, docs/target-app-parity.md.
Save As to an EPS file showed Preview Format, Overprints and Flattener
Preset as text fields holding their ids (tiffColor, preserve, medium),
the PostScript level as a number field, and labeled every EPS option
except Use Artboards from its name ("Cmyk Post Script", "Thumbnails").
The dialog now shows the options Export's EPS Options shows. Preview,
Overprints, Flattener preset (the built-in presets, then saved ones) and
PostScript are menus of readable names. Transparent and Opaque apply to
the color TIFF preview only. Embed Fonts shows checked and disabled. The
PostScript level comes last. A pick writes the same values as before
(previewFormat "tiffColor", a built-in preset's id, a saved preset's
name, the level as a number). A value that the save would reject shows
as it is.
Every option the dialog shows has a written label. "Preview:" has a row
in every catalog, and the de, it, ja, ko, uk, vi and zh-hant catalogs
gain the menu names, which Export's EPS Options also showed in English.
Export As's Range field shows the "1-3, 5" example when emptied, as
Save As's does.
After File > Open the status bar showed only the first of the import's
notes. A file whose layers weren't read could give another note first:
the EPS reader adds its note about brushes left out of the Brushes panel
before the note that the file came in as its page, so the status bar
named the brushes and not the page.
The status bar now names the first note that says reading the file left
something out (the notes that make Save ask before writing over the
file), else the first note, and still counts them all. When there are
several, hovering the message lists them in that order, translated where
the catalogs have them, as many as fit in the window and at most 30,
then how many more. Screen readers get the list after the message. The
status bar shows the list only while it shows the open's message. The
open's reply keeps its notes in the import's order.
Docs: docs/control-protocol.md (app.open), docs/target-app-parity.md.
The Color panel's menu gets a checked Show Recent Colors item under Show
Options / Hide Options. Unchecking it hides the panel's Recent Colors row;
checking it shows the row again. Applied colors still join the list while
the row is hidden, Hide Options hides the row either way, and the Swatches
panel keeps its own row.
The setting is on by default and is kept with the preferences
(ui.color_show_recent_colors); a saved value that is not true or false
reads as on. ui.colorPanel takes recentColors: bool and answers it.
Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
A plain Save that the location refuses (read-only filesystem or permission denied) now opens Save As with the name filled in, instead of ending in an error dialog. The refusal travels as a typed engine error (READ_ONLY_LOCATION), so the control protocol and MCP still return an error and never open a panel. Recovery failures, explicit destinations, a busy picker and Close/Quit keep their existing flow.
Closes#6146
A toolbar made with New Toolbar was filled only by dragging tools from
its All Tools drawer, which the ••• button opens. It now also has a +
button (Add Tool…) above the ••• button. Its menu lists every tool under
the drawer's headings; a click adds the tool at the end of that toolbar
(toolbar.addTool with 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 (toolbar.removeTool). The button takes the keyboard focus, and
the menu scrolls inside the window like the other long menus.
The drawer and its drags work as before. Add Tool… and Remove Tool have
rows in every catalog.