Compare commits

...
Author SHA1 Message Date
bflatasticandClaude Opus 5.5 d11daabdc7 Contextual Task Bar: drag it by its handle, pin and reset its position
The grip at the bar's left end now drags the bar anywhere on the canvas
(grab cursor), which always holds it whole, also when the window shrinks.
Unpinned, the bar keeps that offset as it follows the selection (in the
document it was moved in); the "…" button opens a More Options menu with
Hide Bar, Pin Bar Position (checked while pinned: the bar stays where it
is across selection changes and the handle still moves it; unpinned it
follows the selection again from there), Reset Bar Position (unpinned,
back under the selection) and Show Properties Panel, as in Illustrator.
As there, the position and the pin last for the session only.

- UI commands window.taskBar.pin {pinned?} and window.taskBar.reset, so
  the control channel and MCP reach them; ui.inspect reports taskBar
  {pinned, rect}.
- One opt_bool helper reads the {key?: bool} params of the toggling window
  commands (toolbarColumns, floatTools, collapseDock, taskBar.pin).
- New strings in ja, es, zh-hans, zh-hant, pt-br and cs; the dropped
  "Hide Contextual Task Bar" tooltip and per-key es messages removed.
- Headless egui test: dragging the grip moves the bar, the offset follows
  the selection, pin holds it across selection changes and a shrinking
  window, unpin follows from there, reset restores.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 20:23:15 +07:00
bflatasticandClaude Opus 5.5 d728c47e6f Auto-Collapse Iconic Panels: dialogs keep the panel, the dock doesn't (review of #488)
- A press inside a dialog the popped-out panel opened (Swatch Options from its
  menu, say), or on a modal dialog's backdrop, put the panel away under the
  dialog. The press now counts as away only when it lands on no foreground
  layer (the flyout itself, dialogs, palettes) and not on the modal backdrop
  (`dialogs::modal::backdrop`), as the popovers decide a click elsewhere.
- A press in the expanded dock's panel group left the flyout open: only the
  icon column is spared now (its icons swap or close the flyout themselves),
  so a click in another docked panel puts it away, as a click anywhere else in
  the workspace does in the reference app.
- The test covers a click in a dialog, on its backdrop and in the docked group.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 20:22:15 +07:00
wstockandClaude Fable 5.1 948f696f52 Part of #394: Auto-Collapse Iconic Panels
Preferences › User Interface › Auto-Collapse Iconic Panels was stored
and never read: a panel popped out of the icon column stayed until its
» or its icon. On, a press away from the flyout now puts it away. A
press on the icon column is left to the icons (they swap or close the
flyout on release, so acting on the press would reopen the one being
closed), and a press in a popup the flyout opened (a panel menu, a
dropdown) keeps it. Off by default, as in Illustrator.

Developed with AI assistance (Claude Code); reviewed and tested locally.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-08 20:22:14 +07:00
bflatasticandClaude Opus 5.5 077e4f34ec Numbers Without Units Are Points: picas fields, on by default (review of #486)
The option tells points from picas, where a bare `12` could be either: the
reference app dims it unless a unit is Picas, and it starts on. A number typed
with no unit into a field in picas is now read in points with it on (the
default again, as before #486), and in picas with it off; fields in any other
unit read it in their unit either way, as there. The Preferences dialog dims
the checkbox unless one of the Units is Picas.

The fields learn the preference when it changes, through
`prefs_dialog::apply_runtime` as Scrub Numeric Fields does, rather than from a
write into the egui context every frame. Tests for picas and other fields, the
wiring and the dimming; docs/mcp.md and ROADMAP say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 20:22:11 +07:00
wstockandClaude Fable 5.1 b1aac0cc1b Part of #394: Numbers Without Units Are Points
Preferences › Units › Numbers Without Units Are Points was stored and
never read. On, a number typed with no unit into any length field
(`num_field`, `opt_field`, and so the spin fields built on them) is read
in points whatever the field's unit; a typed unit (`12 mm`, `1in`)
still wins, and the field keeps showing its value in its own unit. The
app sets the frame's rule from the preference in `logic`, the fields
read it through the egui context (`widgets::typed_unit`), so none of
the 45 callers change.

The default flips from true to false, which is Illustrator's default
and the behaviour the fields had while the option was unread.

Developed with AI assistance (Claude Code); reviewed and tested locally.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-08 20:22:10 +07:00
wstockandClaude Fable 5.1 f1935596ef Part of #394: Show The Home Screen When No Documents Are Open
Preferences › General › Show The Home Screen When No Documents Are Open
was stored and never read: the Home screen always replaced the canvas
while no document was open. Off, the window is now empty while no
document is open (as when Illustrator's option is off), and the Home
button (`app.home`) still shows the screen; closing the last document
returns to the empty window. `menus::home_showing` is the one place
that decides, for the canvas and the Home button's lit state.

Developed with AI assistance (Claude Code); reviewed and tested locally.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-08 20:21:42 +07:00
21 changed files with 501 additions and 56 deletions

No files matched your search

+4 -3
View File
@@ -4,7 +4,7 @@ VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adob
This file tracks **how far we are and what's left**. Time estimates are wall-clock hours of continuous Claude Opus 5.5 agent work (including builds and the CI gate), given both for **one agent** and for **4–6 parallel agents** on disjoint crates. They are counted from the remaining work (see [Parity estimate](#parity-estimate)), calibrated against measured throughput, and updated as work lands.
_Last updated: 2026-10-08 (after M4.14–M4.98, M8.1–M8.20, M14.4–M14.7, the MCP prompts, resource templates, completions and logging, the 2026-10-07 issue fixes, the Layers panel rework and the 2026-10-08 community contributions: Pen and shape-tool modifiers, path editing, Layers, Artboards, Swatches/Brushes and dialogs, Japanese composition and PDF text, Hebrew/Arabic type, interface languages (Spanish among them), the font menu, saved selections, MCP and EPS, the missing-font export warning (#319), open paths in the Shape Builder (#374), PDF/`.ai` import keeping strokes live and hidden and nested layers (#372), per-corner Live Corners (#381), SVG type opening at the size it draws at (#396), the Wayland clipboard with copied-file paste (#398), ruler guides that can be selected, moved and deleted (#414), two batches of Preferences options that were stored but unused (#394), skeleton reads with `document.find` for large documents over MCP (#416) and anchors dragged with Direct Selection snapping to points, segments and smart guides, clipped SVG layers opening as clipping layers (#420), PDF/`.ai` layers read on pages of tens of millions of operators (#419), Document Color Mode putting RGB greys on the black plate on request and converting pattern tiles (#421) and movable dialogs with Offset Path's Joins dropdown (#423) and numeric fields scrubbed by dragging their label (#400), stroke weight presets in the stroke unit (#426), the Appearance panel's Opacity popup (#430), type on a path brackets, flip and Type on a Path Options that keep the type in place (#429), Layers rows dragged with a ghost and dropped on the trash or New Layer (#435), tool flyouts opening on a right or corner press (#436), tool flyouts torn off into floating toolbars (#437), the Shape Builder's erase mode deleting edges too (#439), installed fonts registered outside the font folders and fonts installed while the app runs listed in the font menus (#443), alike circular corners on rectangles that aren't square (#442), tool cursors as OS cursors so the pointer no longer trails over the canvas (#444), artboards copied and pasted with their art (#446), guides dragged out of the rulers snapping to the art's side midpoints and the artboards, artboard guides (#451), the toolbar's double arrow and Window › Toolbars › Double Column switching between one and two columns in any window height (#455), the Smart Guides display options and Snapping Tolerance (#394), Font Size and Leading combo boxes with preset lists in the Character and Properties panels and the Control bar (#458), screenshots pasted from the clipboard on macOS, Windows and the web (#457), the Properties panel's Fill and Stroke matching the Control bar's, Illustrator's Window menu panel keys (Shift+F7 for Align…) and Alt-wheel zoom whatever the wheel preference (Discord feedback), the point/area type widget (Discord feedback), groups in legacy Illustrator .ai files (Discord feedback), a rotating desktop log file (#465), image controls in the Control bar and Properties panel: Image Trace with its presets, Mask, Crop Image, Embed/Unembed, and an Image Trace object's preset, Expand and Release (Discord feedback), the Pen working as the Anchor Point tool with Alt held over a selected path's handles and anchors, and anchor buttons that convert, connect and cut paths at the selected anchors (Discord feedback), Japanese hanging punctuation (burasagari, #463), Escape leaving Presentation Mode with no screen mode saved across restarts, documents dropped on the desktop app opening as tabs of their own and a note that an `.ai` file's art off its artboards isn't in the part read (#472), Add/Delete Anchor Point tool icons drawn from the Pen tool's (#479), EPS files from Illustrator 2026, Inkscape/cairo, matplotlib, CorelDRAW, Affinity, LibreOffice and Ghostscript opening as vectors, and a preview that stands in saying why (Discord feedback, #466, #469, #474), chords with modifiers recorded in Edit › Keyboard Shortcuts (#487), Type Object Selection by Path Only (#394), Anti-aliased Artwork (#394), Show Pixel Grid (#394), pen and touch taps pressed and lifted within one frame clicking where they tapped and the Linux/Wayland pen-tablet workaround (#491), bounding-box resizes landing on the other objects' anchors and centres with labels, and the Rotate, Scale, Shear and Reflect tools snapping their drags (#482), Shift-drag marquees that toggle the objects or anchors they reach and a Lasso whose Alt subtraction keeps the rest of the selection (#483), the mouse wheel stepping the focused numeric field, the dialogs' and preferences' drag values made such fields (#485); see [Honest assessment](#honest-assessment-2026-10-05))._
_Last updated: 2026-10-08 (after M4.14–M4.98, M8.1–M8.20, M14.4–M14.7, the MCP prompts, resource templates, completions and logging, the 2026-10-07 issue fixes, the Layers panel rework and the 2026-10-08 community contributions: Pen and shape-tool modifiers, path editing, Layers, Artboards, Swatches/Brushes and dialogs, Japanese composition and PDF text, Hebrew/Arabic type, interface languages (Spanish among them), the font menu, saved selections, MCP and EPS, the missing-font export warning (#319), open paths in the Shape Builder (#374), PDF/`.ai` import keeping strokes live and hidden and nested layers (#372), per-corner Live Corners (#381), SVG type opening at the size it draws at (#396), the Wayland clipboard with copied-file paste (#398), ruler guides that can be selected, moved and deleted (#414), two batches of Preferences options that were stored but unused (#394), skeleton reads with `document.find` for large documents over MCP (#416) and anchors dragged with Direct Selection snapping to points, segments and smart guides, clipped SVG layers opening as clipping layers (#420), PDF/`.ai` layers read on pages of tens of millions of operators (#419), Document Color Mode putting RGB greys on the black plate on request and converting pattern tiles (#421) and movable dialogs with Offset Path's Joins dropdown (#423) and numeric fields scrubbed by dragging their label (#400), stroke weight presets in the stroke unit (#426), the Appearance panel's Opacity popup (#430), type on a path brackets, flip and Type on a Path Options that keep the type in place (#429), Layers rows dragged with a ghost and dropped on the trash or New Layer (#435), tool flyouts opening on a right or corner press (#436), tool flyouts torn off into floating toolbars (#437), the Shape Builder's erase mode deleting edges too (#439), installed fonts registered outside the font folders and fonts installed while the app runs listed in the font menus (#443), alike circular corners on rectangles that aren't square (#442), tool cursors as OS cursors so the pointer no longer trails over the canvas (#444), artboards copied and pasted with their art (#446), guides dragged out of the rulers snapping to the art's side midpoints and the artboards, artboard guides (#451), the toolbar's double arrow and Window › Toolbars › Double Column switching between one and two columns in any window height (#455), the Smart Guides display options and Snapping Tolerance (#394), Font Size and Leading combo boxes with preset lists in the Character and Properties panels and the Control bar (#458), screenshots pasted from the clipboard on macOS, Windows and the web (#457), the Properties panel's Fill and Stroke matching the Control bar's, Illustrator's Window menu panel keys (Shift+F7 for Align…) and Alt-wheel zoom whatever the wheel preference (Discord feedback), the point/area type widget (Discord feedback), groups in legacy Illustrator .ai files (Discord feedback), a rotating desktop log file (#465), image controls in the Control bar and Properties panel: Image Trace with its presets, Mask, Crop Image, Embed/Unembed, and an Image Trace object's preset, Expand and Release (Discord feedback), the Pen working as the Anchor Point tool with Alt held over a selected path's handles and anchors, and anchor buttons that convert, connect and cut paths at the selected anchors (Discord feedback), Japanese hanging punctuation (burasagari, #463), Escape leaving Presentation Mode with no screen mode saved across restarts, documents dropped on the desktop app opening as tabs of their own and a note that an `.ai` file's art off its artboards isn't in the part read (#472), Add/Delete Anchor Point tool icons drawn from the Pen tool's (#479), EPS files from Illustrator 2026, Inkscape/cairo, matplotlib, CorelDRAW, Affinity, LibreOffice and Ghostscript opening as vectors, and a preview that stands in saying why (Discord feedback, #466, #469, #474), chords with modifiers recorded in Edit › Keyboard Shortcuts (#487), Type Object Selection by Path Only (#394), Anti-aliased Artwork (#394), Show Pixel Grid (#394), pen and touch taps pressed and lifted within one frame clicking where they tapped and the Linux/Wayland pen-tablet workaround (#491), bounding-box resizes landing on the other objects' anchors and centres with labels, and the Rotate, Scale, Shear and Reflect tools snapping their drags (#482), Shift-drag marquees that toggle the objects or anchors they reach and a Lasso whose Alt subtraction keeps the rest of the selection (#483), the mouse wheel stepping the focused numeric field, the dialogs' and preferences' drag values made such fields (#485), Show The Home Screen When No Documents Are Open (#394), Numbers Without Units Are Points (#394), Auto-Collapse Iconic Panels (#394), the Contextual Task Bar moved by its handle and its More Options menu pinning and resetting its position; see [Honest assessment](#honest-assessment-2026-10-05))._
## Where we are
@@ -97,6 +97,7 @@ grade by behaviour against `plan/illustrator/`, not by whether a menu item exist
- **UI:** Illustrator 2026 layout restyled to measured values:
- Medium Dark theme, categorized and Advanced toolbars (a tool group's flyout opens on a right press, a long press or a press on its corner triangle), 35 pt document tabs, 33 pt panel tabs.
- Hint bar, contextual task bar, 19 dock panels with ≡ menus.
- The contextual task bar's handle drags it anywhere on the canvas (kept whole on it as the window resizes); unpinned it keeps that offset as it follows the selection, and its More Options menu hides it, pins its position across selection changes (`window.taskBar.pin`), resets it under the selection (`window.taskBar.reset`) and shows the Properties panel. As in Illustrator the position isn't kept across launches. Not done: the bar's tool-specific variants (only the selection tools show it).
- Tool flyouts tear off: dragging or clicking the tear-off bar on a flyout's right side (or releasing the long press over it) floats its group as a strip of tool buttons, moved by the same bar and put back in the toolbar by the × at its top (`window.floatTools`). While a group floats, the presses that would open its flyout raise the strip instead. Floating strips are kept with the preferences and in user workspaces. Not done: turning a strip vertical, docking it.
- 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.
- Localised UI: menus (in-window and native), panels, dialogs, toolbar and Preferences read from per-language catalogs (`crates/ui-egui/src/i18n`, see `docs/development.md`); Traditional Chinese (Taiwan), Simplified Chinese (mainland), Japanese and Spanish ship complete, and Czech and Brazilian Portuguese cover every menu label (and more), with system-locale detection on macOS, Windows, Linux and the web (the browser's languages, or `?lang=`), a VectorCraft ▸ Language menu and a Language preference. Names are never translated (fonts and their styles, layers, artboards, saved presets, user libraries, custom workspaces, recent files, plug-ins).
@@ -105,7 +106,7 @@ grade by behaviour against `plan/illustrator/`, not by whether a menu item exist
- A canvas context menu: right-click selects the object under the pointer and lists what applies to the selection (Undo/Redo, clipboard, group, isolation, join, Remove Anchor Points when anchors are selected, masks, compound paths, guides, Transform, Arrange, Select, Export Selection), or the view commands on empty canvas.
- Save / Don't Save / Cancel before closing or quitting with unsaved documents (tabs, Close, Close All, Quit, window close).
- Four brightness themes, persistent preferences.
- Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). About 35 stored options still do nothing yet (the rest of #394: Auto Size New Area Type, Show Font Names in English, Highlight Alternate Glyphs, Construction and Spacing Guides, performance, devices…).
- Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). About 32 stored options still do nothing yet (the rest of #394: Auto Size New Area Type, Show Font Names in English, Highlight Alternate Glyphs, Construction and Spacing Guides, performance, devices…).
- Dialogs move by dragging their heading (the band down from the top edge, as a title bar), stay on screen and keep where they were moved for the session; the form dialogs' choices are dropdowns (Offset Path's Joins, Average's and Shear's and Reflect's axis), and Offset Path lists Offset, Joins, Miter Limit and previews (#423).
- Dialogs open with their first field focused and its value selected: type a value and press Enter (Move, Rotate, Scale…). Number fields in panels, the Control bar and dialogs (preferences too) step with Up/Down, or with the mouse wheel over the focused field (#485: a notch a step; the panel under it then stays put, and an unfocused field leaves the wheel to scrolling) (Shift: ten, Ctrl/Cmd: a tenth of their unit), applied at once.
- Scrubby labels (#400, beyond Illustrator, as in Photoshop): dragging a numeric field's label left or right (the ↔ cursor shows over it) steps the value one unit every 2 points (Shift: ten, Ctrl/Cmd: a tenth; counts stay whole), in the field's unit and within its limits, applied live as the art follows; the whole drag is one undo step and Escape puts the value back. A click on the label focuses the field; the text box itself never scrubs, and a field with no label doesn't. Text labels before a field (Transform, Properties, Control bar, Stroke, Transparency, form rows in dialogs) and the Character and Paragraph panels' icons act as labels. Preferences › General › Scrub Numeric Fields by Dragging (on by default) turns it off.
@@ -215,7 +216,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale)
| Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 |
| Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done) | 1–2 |
| Automation | 3 | 60% | Variables (data merge), scripting surface, batch | 8–12 |
| UI chrome (panels, contextual Properties, workspaces, prefs) | 6 | 78% | Variables, SVG Interactivity, Properties per context, Consolidate All Windows, context menus beyond the canvas (Links, Asset Export, CSS Properties, Attributes and the canvas context menu are done), about 35 Preferences options stored but not yet acted on (#394: Construction and Spacing Guides, Auto Size New Area Type, Show Font Names in English, Highlight Alternate Glyphs, performance, devices…) | 14–22 |
| UI chrome (panels, contextual Properties, workspaces, prefs) | 6 | 78% | Variables, SVG Interactivity, Properties per context, Consolidate All Windows, context menus beyond the canvas (Links, Asset Export, CSS Properties, Attributes and the canvas context menu are done), about 32 Preferences options stored but not yet acted on (#394: Construction and Spacing Guides, Auto Size New Area Type, Show Font Names in English, Highlight Alternate Glyphs, performance, devices…) | 14–22 |
| Libraries, Links, Package | 2 | 50% | a local Libraries panel (no cloud by design); Links and Package are done | 5–8 |
| **Feature parity** | **103** | **~75%** | | **~210–330** |
| Interaction-fidelity pass (side by side with Illustrator: every tool modifier, cursor, dialog, Properties context) | | | | 60–90 |
+2
View File
@@ -397,6 +397,8 @@ pub struct Prefs {
pub units_stroke: String,
pub units_type: String,
pub units_asian_type: String,
/// Numbers Without Units Are Points: a number typed with no unit into a length field in picas
/// is read in points (on by default; the reference app dims it unless a unit is Picas).
pub numbers_without_units_are_points: bool,
pub identify_objects_by: String,
// Guides & Grid
+169 -16
View File
@@ -1,7 +1,7 @@
//! The document canvas: rendering, rulers, navigation, pointer routing to tools and on-canvas
//! selection visuals (bounding box, anchors, handles, smart-guide style labels).
use egui::{Color32, CornerRadius, Pos2, Sense, Shape, Stroke, StrokeKind, Ui, pos2, vec2};
use egui::{Color32, CornerRadius, Pos2, Sense, Shape, Stroke, StrokeKind, Ui, Vec2, pos2, vec2};
use serde_json::json;
use vectorcraft_doc::{Node, NodeKind, Unit};
use vectorcraft_geom::{Affine, BezPath, PathEl, Point, Rect};
@@ -158,10 +158,15 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
if app.ui.home.is_some_and(|k| k != crate::menus::home_key(app)) {
app.ui.home = None;
}
if app.session.active().is_none() || app.ui.home.is_some() {
if crate::menus::home_showing(app) {
home(app, ui, full);
return;
}
if app.session.active().is_none() {
// No document and Show The Home Screen When No Documents Are Open off: an empty window.
ui.painter().rect_filled(full, 0.0, t.panel_darker);
return;
}
let rect = if app.ui.view.rulers && app.ui.screen_mode < 3 { egui::Rect::from_min_max(full.min + vec2(RULER, RULER), full.max) } else { full };
app.canvas_rect = Some(rect);
let fitted = app.view().is_some_and(|v| v.fitted);
@@ -1572,7 +1577,7 @@ fn draw_overlays(p: &egui::Painter, xf: &Xf, overlays: &[Overlay], t: &Tokens, l
}
}
/// The Home screen shown when no document is open.
/// The Home screen (`app.home`; with no document open, unless its preference is off).
fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) {
let t = Tokens::get(ui.ctx());
ui.painter().rect_filled(rect, 0.0, t.panel_darker);
@@ -1624,7 +1629,20 @@ fn upload(app: &mut VectorcraftApp, ctx: &egui::Context, img: &vectorcraft_rende
}
}
/// The Contextual Task Bar's area.
fn task_bar_id() -> egui::Id {
egui::Id::new("task-bar")
}
/// Where the Contextual Task Bar was last drawn (none while it isn't shown).
pub(crate) fn task_bar_rect(ctx: &egui::Context) -> Option<egui::Rect> {
let id = task_bar_id();
ctx.memory(|m| m.areas().is_visible(&egui::LayerId::new(egui::Order::Middle, id)).then(|| m.area_rect(id)).flatten())
}
/// The Contextual Task Bar: a floating pill under the selection with the most likely next actions.
/// Its handle drags it anywhere on the canvas; unpinned it keeps that offset as it follows the
/// selection, pinned it stays put ([`crate::state::TaskBarPlace`]).
fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) {
let t = Tokens::get(ui.ctx());
let Some(st) = app.session.active() else { return };
@@ -1657,12 +1675,36 @@ fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) {
}
items.push((tl!("Duplicate"), "copy", "edit.duplicate"));
let fill = first.as_ref().map(|f| f.appearance.fill_paint()).unwrap_or_default();
let doc = st.uid;
let anchor = xf.to_screen(Point::new(b.center().x, b.y1));
let est_w = 118.0 + items.iter().map(|(l, _, _)| l.len() as f32 * 7.2 + 44.0).sum::<f32>();
let x = (anchor.x - est_w / 2.0).clamp(xf.rect.left() + 8.0, (xf.rect.right() - est_w - 8.0).max(xf.rect.left() + 8.0));
let y = (anchor.y + 28.0).min(xf.rect.bottom() - 56.0);
let mut run: Option<String> = None;
egui::Area::new(egui::Id::new("task-bar")).order(egui::Order::Middle).fixed_pos(pos2(x, y)).show(ui.ctx(), |ui| {
// Its place under the selection, then where the handle moved it, kept on the canvas (with the
// bar's size last frame, the estimate before it first shows).
let under = pos2(anchor.x - est_w / 2.0, anchor.y + 28.0);
let id = task_bar_id();
let size = egui::AreaState::load(ui.ctx(), id).and_then(|s| s.size).unwrap_or(vec2(est_w, 44.0));
let bounds = xf.rect.shrink(8.0);
let keep_in = |p: Pos2| p.clamp(bounds.min, (bounds.max - size).max(bounds.min));
let place = &mut app.ui.task_bar_place;
// Just unpinned: follow the selection from the pinned spot.
if !place.pinned
&& let Some(at) = place.pin_at.take()
{
place.offset = Some((doc, xf.rect.min + at - under));
}
let pos = keep_in(match place.pin_at {
Some(at) => xf.rect.min + at,
None => under + place.offset.filter(|(d, _)| *d == doc).map_or(Vec2::ZERO, |(_, o)| o),
});
place.shown_at = Some(pos - xf.rect.min);
// Pinned before it ever showed: hold it here.
if place.pinned && place.pin_at.is_none() {
place.pin_at = place.shown_at;
}
let pinned = place.pinned;
let mut moved = Vec2::ZERO;
let mut run: Option<(&str, serde_json::Value)> = None;
egui::Area::new(id).order(egui::Order::Middle).fixed_pos(pos).show(ui.ctx(), |ui| {
egui::Frame::NONE
.fill(t.panel)
.stroke(Stroke::new(1.0, t.tool_active))
@@ -1672,8 +1714,15 @@ fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) {
.show(ui, |ui| {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 6.0;
let (g, _) = ui.allocate_exact_size(vec2(4.0, 28.0), Sense::hover());
ui.painter().rect_filled(g.shrink2(vec2(0.5, 4.0)), CornerRadius::same(2), t.button_border);
let (g, grip) = ui.allocate_exact_size(vec2(4.0, 28.0), Sense::drag());
let active = grip.hovered() || grip.dragged();
ui.painter().rect_filled(g.shrink2(vec2(0.5, 4.0)), CornerRadius::same(2), if active { t.text_dim } else { t.button_border });
if grip.dragged() {
ui.ctx().set_cursor_icon(egui::CursorIcon::Grabbing);
moved = grip.drag_delta();
} else if grip.hovered() {
ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);
}
for (label, icon, cmd) in &items {
let galley = ui.painter().layout_no_wrap(label.to_string(), egui::FontId::proportional(13.0), t.text_strong);
let (r, resp) = ui.allocate_exact_size(vec2(galley.size().x + 38.0, 30.0), Sense::click());
@@ -1684,7 +1733,7 @@ fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) {
crate::icons::paint(ui, icon, egui::Rect::from_min_size(r.min + vec2(8.0, 7.0), vec2(16.0, 16.0)), t.icon);
ui.painter().galley(pos2(r.left() + 30.0, r.center().y - galley.size().y / 2.0), galley, t.text_strong);
if resp.clicked() {
run = Some(cmd.to_string());
run = Some((*cmd, json!({})));
}
}
let (r, resp) = ui.allocate_exact_size(vec2(26.0, 30.0), Sense::click());
@@ -1700,16 +1749,41 @@ fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) {
app.ui.open_panel = Some("swatches".into());
}
if widgets::icon_button(ui, "lock", tl!("Lock (⌘2)"), false, 30.0).clicked() {
run = Some("object.lock".into());
}
if widgets::icon_button(ui, "ellipsis", tl!("Hide Contextual Task Bar"), false, 30.0).clicked() {
run = Some("window.taskBar".into());
run = Some(("object.lock", json!({})));
}
let more = widgets::icon_button(ui, "ellipsis", tl!("More Options"), false, 30.0);
egui::Popup::menu(&more).show(|ui| {
ui.set_min_width(170.0);
let bar = [
(tl!("Hide Bar"), "window.taskBar", false),
(tl!("Pin Bar Position"), "window.taskBar.pin", pinned),
(tl!("Reset Bar Position"), "window.taskBar.reset", false),
];
for (label, cmd, checked) in bar {
if widgets::menu_item(ui, label, true, checked) {
run = Some((cmd, json!({})));
}
}
ui.separator();
if widgets::menu_item(ui, tl!("Show Properties Panel"), true, false) {
run = Some(("window.panel", json!({"panel": "properties"})));
}
});
});
});
});
if let Some(c) = run {
crate::menus::invoke(app, &c, json!({}));
if moved != Vec2::ZERO {
let to = keep_in(pos + moved);
let place = &mut app.ui.task_bar_place;
if place.pinned {
place.pin_at = Some(to - xf.rect.min);
} else {
place.offset = Some((doc, to - under));
}
ui.ctx().request_repaint();
}
if let Some((c, p)) = run {
crate::menus::invoke(app, c, p);
}
}
@@ -2812,4 +2886,83 @@ mod tests {
assert_eq!(doc.selection.objects, vec![vectorcraft_doc::NodeId(id)]);
assert_eq!(doc.doc.art_bounds(), before, "the tap moved nothing");
}
/// The Contextual Task Bar's handle drags it: unpinned it keeps that offset as it follows the
/// selection, pinned it stays put when the selection changes, unpinned again it follows from
/// there, and Reset Bar Position puts it back under the selection. It never leaves the canvas,
/// also when the window shrinks.
#[test]
fn the_task_bar_is_dragged_by_its_handle_pinned_and_reset() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
let mut square =
|x: f64, y: f64| app.session.execute("shape.rectangle", &json!({"x": x, "y": y, "width": 40, "height": 40})).unwrap()["id"].clone();
let (a, b) = (square(120.0, 40.0), square(220.0, 150.0));
app.select_tool("selection");
let ctx = egui::Context::default();
let bar = || task_bar_rect(&ctx).expect("the task bar shows");
let select = |app: &mut VectorcraftApp, id: &serde_json::Value| {
app.session.execute("select.set", &json!({"ids": [id]})).unwrap();
frame(app, &ctx, vec![]);
frame(app, &ctx, vec![]);
bar().min
};
let button = |pos, pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
let drag = |app: &mut VectorcraftApp, by: Vec2| {
let grip = pos2(bar().left() + 11.0, bar().center().y);
frame(app, &ctx, vec![egui::Event::PointerMoved(grip)]);
frame(app, &ctx, vec![button(grip, true)]);
frame(app, &ctx, vec![egui::Event::PointerMoved(grip + by)]);
frame(app, &ctx, vec![button(grip + by, false)]);
frame(app, &ctx, vec![]);
bar().min
};
let near = |p: Pos2, q: Pos2| assert!((p - q).length() < 1.5, "{p:?} is not at {q:?}");
let (under_a, under_b) = (select(&mut app, &a), select(&mut app, &b));
assert!(under_b.y > under_a.y + 100.0, "each bar sits under its selection");
// Dragged unpinned: it keeps its offset from the selection.
select(&mut app, &a);
let by = vec2(40.0, -30.0);
near(drag(&mut app, by), under_a + by);
near(select(&mut app, &b), under_b + by);
assert!(!app.ui.task_bar_place.pinned);
// Pinned: it stays where it is across selection changes, and the handle still moves it.
assert_eq!(app.run("window.taskBar.pin", json!({})).unwrap(), json!(true));
assert_eq!(crate::menus::checked(&app, "window.taskBar.pin", &json!({})), Some(true));
near(select(&mut app, &a), under_b + by);
let spot = drag(&mut app, vec2(-20.0, 10.0));
near(spot, under_b + by + vec2(-20.0, 10.0));
near(select(&mut app, &b), spot);
// Unpinned: it follows the selection from where it is, kept on the canvas.
assert_eq!(app.run("window.taskBar.pin", json!({"pinned": false})).unwrap(), json!(false));
near(select(&mut app, &a), spot);
let canvas = app.canvas_rect.unwrap();
let last = canvas.max - vec2(8.0, 8.0) - bar().size();
near(select(&mut app, &b), (under_b + (spot - under_a)).min(last));
assert!(app.run("window.taskBar.pin", json!({"pinned": "yes"})).is_err());
// Kept on the canvas: dragged far off, then pinned in the corner of a shrinking window.
near(drag(&mut app, vec2(-2000.0, -2000.0)), canvas.min + vec2(8.0, 8.0));
app.run("window.taskBar.pin", json!({"pinned": true})).unwrap();
drag(&mut app, vec2(2000.0, 2000.0));
near(bar().max, canvas.max - vec2(8.0, 8.0));
let small = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(640.0, 480.0))), ..Default::default() };
for _ in 0..2 {
let mut out = ctx.run_ui(small.clone(), |ui| show(&mut app, ui));
out.textures_delta.clear();
}
let canvas = app.canvas_rect.unwrap();
assert!(canvas.width() < 700.0, "the canvas shrank: {canvas:?}");
near(bar().max, canvas.max - vec2(8.0, 8.0));
// Reset: back under the selection, unpinned.
frame(&mut app, &ctx, vec![]);
app.run("window.taskBar.reset", json!({})).unwrap();
assert!(!app.ui.task_bar_place.pinned);
near(select(&mut app, &a), under_a);
near(select(&mut app, &b), under_b);
}
}
+1 -1
View File
@@ -29,7 +29,7 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) {
let (r, _) = ui.allocate_exact_size(vec2(22.0, 22.0), Sense::hover());
crate::brand::paint_mark(ui, r);
ui.add_space(4.0);
let on_home = app.ui.home.is_some() || app.session.active().is_none();
let on_home = menus::home_showing(app);
if widgets::icon_button(ui, "house", tl!("Home"), on_home, 24.0).clicked() {
app.run("app.home", json!({})).ok();
}
+5
View File
@@ -79,6 +79,11 @@ pub fn inspect(app: &VectorcraftApp, ctx: &egui::Context) -> Value {
"ui": serde_json::to_value(&app.ui).unwrap_or_default(),
// Not saved with the UI state, so not in `ui`: 0 normal … 3 Presentation Mode.
"screenMode": app.ui.screen_mode,
// The Contextual Task Bar: pinned (not saved either) and where it shows.
"taskBar": {
"pinned": app.ui.task_bar_place.pinned,
"rect": crate::canvas::task_bar_rect(ctx).map(|r| json!([r.left(), r.top(), r.width(), r.height()])),
},
"view": app.view().map(|v| serde_json::to_value(v).unwrap_or_default()),
"canvasRect": app.canvas_rect.map(|c| json!([c.left(), c.top(), c.width(), c.height()])),
"window": [r.width(), r.height()],
+8 -1
View File
@@ -12,7 +12,8 @@ use crate::theme::{self, Tokens};
/// should start with [`heading`] (or [`drag_band`]) so the window can be moved.
pub(crate) fn show<R>(ctx: &egui::Context, title: &str, id: Id, nudge: f32, margin: i8, add: impl FnOnce(&mut egui::Ui) -> R) -> Option<R> {
let t = Tokens::get(ctx);
egui::Area::new(Id::new("modal-dim")).order(egui::Order::Middle).fixed_pos(egui::Pos2::ZERO).show(ctx, |ui| {
let dim = backdrop();
egui::Area::new(dim.id).order(dim.order).fixed_pos(egui::Pos2::ZERO).show(ctx, |ui| {
// Modal, but the canvas isn't dimmed so previews stay readable (as in the reference app).
ui.allocate_rect(ctx.content_rect(), egui::Sense::click());
});
@@ -28,6 +29,12 @@ pub(crate) fn show<R>(ctx: &egui::Context, title: &str, id: Id, nudge: f32, marg
.and_then(|r| r.inner)
}
/// The layer of the backdrop behind a modal dialog window, which takes the clicks the rest of
/// the app would get.
pub(crate) fn backdrop() -> egui::LayerId {
egui::LayerId::new(egui::Order::Middle, Id::new("modal-dim"))
}
/// The dialog's heading, which also moves the window ([`drag_band`]).
pub(crate) fn heading(ui: &mut egui::Ui, text: &str) {
let t = Tokens::get(ui.ctx());
+61
View File
@@ -227,6 +227,19 @@ pub fn floating_panel(app: &mut VectorcraftApp, ctx: &egui::Context) {
});
});
});
// User Interface › Auto-Collapse Iconic Panels (#394): a press away from the flyout puts it
// away, on the canvas or a docked panel. Not one on the icon column (its icons swap or close the
// flyout themselves, on release), nor one on a foreground layer (the flyout itself, a dialog, a palette) or a modal dialog's
// backdrop, nor one that closes a popup (a panel menu, a dropdown the flyout opened).
if open && app.session.prefs.auto_collapse_icon_panels && !egui::Popup::is_any_open(ctx) {
let away = |p: egui::Pos2| {
!(column..=column + ICON_COL).contains(&p.x)
&& ctx.layer_id_at(p).is_none_or(|l| l.order != egui::Order::Foreground && l != crate::dialogs::modal::backdrop())
};
if ctx.input(|i| i.pointer.any_pressed().then(|| i.pointer.interact_pos()).flatten()).is_some_and(away) {
open = false;
}
}
if !open {
app.ui.open_panel = None;
}
@@ -319,6 +332,7 @@ mod tests {
.run_ui(input, |ui| {
show(app, ui);
floating_panel(app, ui.ctx());
crate::dialogs::show(app, ui.ctx());
})
.textures_delta
.clear();
@@ -416,6 +430,53 @@ mod tests {
assert!(rect.height() > 450.0 && rect.bottom() <= SCREEN.y, "Properties flyout {rect:?}");
}
/// User Interface › Auto-Collapse Iconic Panels (#394): on, a click away from a popped-out
/// panel puts it away; off (the default), the panel stays until its » or its icon.
#[test]
fn auto_collapse_puts_a_flyout_away_on_a_click_elsewhere() {
let mut h = Harness::new();
h.app.run("window.collapseDock", json!({"collapsed": true})).unwrap();
h.settle();
let (properties, layers) = (h.icons()[0], h.icons()[1]);
let away = egui::pos2(300.0, 500.0);
h.click(layers.center());
assert_eq!(h.app.ui.open_panel.as_deref(), Some("layers"));
h.click(away);
assert_eq!(h.app.ui.open_panel.as_deref(), Some("layers"), "off: a click elsewhere leaves it");
h.app.session.execute("prefs.set", &json!({"key": "autoCollapseIconPanels", "value": true})).unwrap();
h.click(away);
assert_eq!(h.app.ui.open_panel, None, "on: a click elsewhere puts it away");
h.click(layers.center());
assert_eq!(h.app.ui.open_panel.as_deref(), Some("layers"), "its icon still pops it out");
let rect = h.ctx.memory(|m| m.area_rect(egui::Id::new("icon-panel"))).unwrap();
h.click(egui::pos2(rect.center().x, rect.top() + 13.0 + 26.0 + 10.0));
assert_eq!(h.app.ui.open_panel.as_deref(), Some("layers"), "a click inside keeps it");
// The icons still swap the flyout and put it away.
h.click(properties.center());
assert_eq!(h.app.ui.open_panel.as_deref(), Some("properties"), "another icon swaps it");
h.click(properties.center());
assert_eq!(h.app.ui.open_panel, None, "the same icon puts it away");
// A dialog (one a panel menu opens, say): a click in it or on its backdrop keeps the panel.
h.click(layers.center());
h.app.ui.dialog = Some(crate::state::Dialog::new("move", json!({"dx": "0 pt", "dy": "0 pt"})));
h.settle();
let dialog = h.ctx.memory(|m| m.area_rect(egui::Id::new(("dialog", "move")))).expect("the Move dialog");
h.click(dialog.left_top() + vec2(20.0, 30.0));
assert_eq!(h.app.ui.open_panel.as_deref(), Some("layers"), "a click in the dialog keeps it");
h.click(egui::pos2(dialog.left() - 40.0, dialog.center().y));
assert_eq!(h.app.ui.open_panel.as_deref(), Some("layers"), "a click on the backdrop keeps it");
h.app.ui.dialog = None;
// The dock expanded: a click in its panel group puts a popped-out icon panel away too.
h.app.run("window.collapseDock", json!({"collapsed": false})).unwrap();
h.settle();
let icon = h.icons()[0];
h.click(icon.center());
let open = h.app.ui.open_panel.clone();
assert!(open.is_some(), "an icon panel pops out beside the expanded dock");
h.click(egui::pos2(SCREEN.x - 100.0, 300.0));
assert_eq!(h.app.ui.open_panel, None, "a click in the docked group puts {open:?} away");
}
#[test]
fn the_collapse_command_sets_or_toggles_the_dock() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
+2
View File
@@ -490,6 +490,8 @@
Manage Workspaces… Spravovat pracovní prostory…
Control Ovládací panel
Contextual Task Bar Kontextový panel úloh
Pin Bar Position Připnout polohu panelu
Reset Bar Position Obnovit polohu panelu
Tools Nástroje
Toolbars Panely nástrojů
Advanced Rozšířený
Can't render this file because it contains an unexpected character in line 2 and column 73.
+5 -4
View File
@@ -435,6 +435,8 @@
Construction Guides Guías de construcción
Contextual Alternates Alternativas contextuales
Contextual Task Bar Barra de tareas contextual
Pin Bar Position Fijar posición de la barra
Reset Bar Position Restablecer posición de la barra
Contrast Contraste
Control Control
Convert Convertir
@@ -1089,7 +1091,9 @@
Hide Artboards Ocultar mesas de trabajo
Hide Bounding Box Ocultar cuadro delimitador
Hide Code Ocultar código
Hide Contextual Task Bar Ocultar barra de tareas contextual
Hide Bar Ocultar barra
More Options Más opciones
Show Properties Panel Mostrar panel Propiedades
Hide Corner Widget Ocultar widget de esquina
Hide Corner Widget for angles greater than Ocultar widget de esquina para ángulos mayores que
Hide Edges Ocultar bordes
@@ -3213,7 +3217,6 @@ axis Both Ambos
@msg choose a folder to export to elige una carpeta a la que exportar
@msg choose a location for the package elige una ubicación para el paquete
@msg clipboard is empty el portapapeles está vacío
@msg collapsed must be true or false collapsed debe ser true o false
@msg colorTable.{what}: `{h}` is not a colour such as "#ff8800" colorTable.{what}: `{h}` no es un color como "#ff8800"
@msg colorTable.{what}: at most {MAX_TABLE} colours colorTable.{what}: como máximo {MAX_TABLE} colores
@msg command `{0}` is not available right now: {1} el comando `{0}` no está disponible ahora: {1}
@@ -3568,7 +3571,5 @@ axis Both Ambos
@msg The graphics were lost and couldn't be restarted. Se perdieron los gráficos y no se pudieron reiniciar.
@msg Your unsaved changes are kept in this browser: reload the page to get them back. Tus cambios sin guardar se conservan en este navegador: vuelve a cargar la página para recuperarlos.
@msg Reload the page to go on (changes not saved yet may be lost). Vuelve a cargar la página para continuar (los cambios que aún no se guardaron podrían perderse).
@msg floating must be true or false floating debe ser true o false
@msg tool (a tool id) is required se requiere tool (un id de herramienta)
@msg {tool} isn't in a toolbar group of several tools {tool} no está en un grupo de la barra de herramientas con varias herramientas
@msg double must be true or false double debe ser true o false
Can't render this file because it contains an unexpected character in line 2 and column 73.
+5 -1
View File
@@ -511,6 +511,8 @@
Manage Workspaces… ワークスペースを管理…
Control コントロール
Contextual Task Bar コンテキストタスクバー
Pin Bar Position バーの位置を固定
Reset Bar Position バーの位置をリセット
Tools ツール
Toolbars ツールバー
Advanced 詳細
@@ -1372,7 +1374,9 @@
Height: 高さ:
Help › Search Commands… ヘルプ › コマンドを検索…
Hide Code コードを隠す
Hide Contextual Task Bar コンテキストタスクバーを隠す
Hide Bar バーを隠す
More Options その他のオプション
Show Properties Panel プロパティパネルを表示
Hide Corner Widget for angles greater than 次の角度より大きい場合はコーナーウィジェットを隠す
Hide Note メモを隠す
Hide Options オプションを隠す
Can't render this file because it contains an unexpected character in line 2 and column 73.
+5 -1
View File
@@ -447,6 +447,8 @@
Construction Guides Guias de Construção
Contextual Alternates Variantes Contextuais
Contextual Task Bar Barra de Tarefas Contextual
Pin Bar Position Fixar Posição da Barra
Reset Bar Position Redefinir Posição da Barra
Control Controle
Convert Converter
Convert All Spot Colors to Process Converter Todas as Cores Spot em Processo
@@ -1006,7 +1008,9 @@
Hide Artboards Ocultar Mesas de Trabalho
Hide Bounding Box Ocultar Caixa Delimitadora
Hide Code Ocultar Código
Hide Contextual Task Bar Ocultar Barra de Tarefas Contextual
Hide Bar Ocultar Barra
More Options Mais Opções
Show Properties Panel Mostrar Painel Propriedades
Hide Corner Widget Ocultar Widget de Canto
Hide Corner Widget for angles greater than Ocultar Widget de Canto para ângulos maiores que
Hide Edges Ocultar Bordas
Can't render this file because it contains an unexpected character in line 6 and column 47.
+5 -1
View File
@@ -436,6 +436,8 @@
Construction Guides 构造参考线
Contextual Alternates 上下文替代
Contextual Task Bar 上下文任务栏
Pin Bar Position 固定任务栏位置
Reset Bar Position 重置任务栏位置
Contrast 对比
Control 控制栏
Convert 转换
@@ -1080,7 +1082,9 @@
Hide Artboards 隐藏画板
Hide Bounding Box 隐藏定界框
Hide Code 隐藏代码
Hide Contextual Task Bar 隐藏快捷工作列
Hide Bar 隐藏任务栏
More Options 更多选项
Show Properties Panel 显示属性面板
Hide Corner Widget 隐藏角控件
Hide Corner Widget for angles greater than 角度大于此值时隐藏圆角控件
Hide Edges 隐藏边缘
Can't render this file because it contains an unexpected character in line 2 and column 73.
+5 -1
View File
@@ -450,6 +450,8 @@
Construction Guides 建構參考線
Contextual Alternates 前後關聯替代字
Contextual Task Bar 快捷工作列
Pin Bar Position 釘選工作列位置
Reset Bar Position 重設工作列位置
Contrast 對比
Control 控制
Convert 轉換
@@ -1106,7 +1108,9 @@
Hide Artboards 隱藏工作區域
Hide Bounding Box 隱藏邊框
Hide Code 隱藏程式碼
Hide Contextual Task Bar 隱藏快捷工作列
Hide Bar 隱藏工作列
More Options 更多選項
Show Properties Panel 顯示內容面板
Hide Corner Widget 隱藏轉角 Widget
Hide Corner Widget for angles greater than 角度大於以下數值時隱藏轉角 Widget
Hide Edges 隱藏邊緣
Can't render this file because it contains an unexpected character in line 6 and column 47.
+53 -20
View File
@@ -216,6 +216,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"{tool: id, floating?: bool} float the toolbar group holding `tool` (in the current Basic or Advanced layout) as its own strip of tool buttons (true), put it back in the toolbar (false) or toggle (omitted), as dragging or clicking a flyout's tear-off bar and the strip's × do; returns the new state",
),
("window.taskBar", "Contextual Task Bar", "", "{}"),
(
"window.taskBar.pin",
"Pin Bar Position",
"",
"{pinned?: bool} keep the Contextual Task Bar where it is instead of following the selection (true), let it follow the selection again from where it is (false) or toggle (omitted), as the bar's More Options menu does; returns the new state",
),
("window.taskBar.reset", "Reset Bar Position", "", "{} unpin the Contextual Task Bar and put it back under the selection"),
("window.dock", "Panels", "Tab", "{} show/hide all panels"),
("window.panel", "Show Panel", "", "{panel: id} e.g. layers, swatches, stroke (case-insensitive; display labels like \"Layers\" work too)"),
(
@@ -770,6 +777,15 @@ fn normalize_panel(input: &str) -> Option<&'static str> {
crate::state::all_panels().find(|(id, label)| name.eq_ignore_ascii_case(id) || name.eq_ignore_ascii_case(label)).map(|(id, _)| id)
}
/// An optional `{key?: bool}` param: none when it is omitted or null (the commands then toggle).
fn opt_bool(p: &Value, key: &str) -> Result<Option<bool>, String> {
match p.get(key) {
None | Some(Value::Null) => Ok(None),
Some(Value::Bool(b)) => Ok(Some(*b)),
Some(_) => Err(format!("`{key}` must be true or false")),
}
}
/// Handle a UI command. `None` = not a UI command (the engine handles it).
pub fn run_ui_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<Value, String>> {
if id == "app.language" {
@@ -994,25 +1010,38 @@ pub fn run_ui_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<R
}
"window.control" => flag(&mut app.ui.control_bar),
"window.toolbar" => flag(&mut app.ui.toolbar),
"window.toolbarColumns" => {
app.ui.toolbar_double = match p.get("double") {
None | Some(Value::Null) => !app.ui.toolbar_double,
Some(Value::Bool(b)) => *b,
Some(_) => return Some(Err("double must be true or false".into())),
};
Ok(json!(app.ui.toolbar_double))
}
"window.toolbarColumns" => opt_bool(p, "double").map(|on| {
let on = on.unwrap_or(!app.ui.toolbar_double);
app.ui.toolbar_double = on;
json!(on)
}),
"window.toolbarAdvanced" => flag(&mut app.ui.toolbar_advanced),
"window.floatTools" => {
let floating = match p.get("floating") {
None | Some(Value::Null) => None,
Some(Value::Bool(b)) => Some(*b),
Some(_) => return Some(Err("floating must be true or false".into())),
let floating = match opt_bool(p, "floating") {
Ok(on) => on,
Err(e) => return Some(Err(e)),
};
let Some(tool) = s("tool") else { return Some(Err("tool (a tool id) is required".into())) };
crate::toolbar::float_group(app, &tool, floating).map(Value::Bool)
}
"window.taskBar" => flag(&mut app.ui.task_bar),
"window.taskBar.pin" => {
let place = &mut app.ui.task_bar_place;
opt_bool(p, "pinned").map(|pinned| {
let pinned = pinned.unwrap_or(!place.pinned);
// Pinning holds the bar where it shows; unpinning lets it follow the selection from
// there (the bar turns its pinned spot into an offset when it is next drawn).
if pinned && !place.pinned {
place.pin_at = place.shown_at;
}
place.pinned = pinned;
json!(pinned)
})
}
"window.taskBar.reset" => {
app.ui.task_bar_place = Default::default();
Ok(Value::Null)
}
"window.dock" => {
let on = !(app.ui.dock && app.ui.toolbar);
app.ui.dock = on;
@@ -1020,15 +1049,11 @@ pub fn run_ui_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<R
app.ui.control_bar = on;
Ok(json!(on))
}
"window.collapseDock" => {
let collapsed = match p.get("collapsed") {
None | Some(Value::Null) => !app.ui.dock_collapsed,
Some(Value::Bool(b)) => *b,
Some(_) => return Some(Err("collapsed must be true or false".into())),
};
"window.collapseDock" => opt_bool(p, "collapsed").map(|collapsed| {
let collapsed = collapsed.unwrap_or(!app.ui.dock_collapsed);
crate::dock::set_collapsed(app, collapsed);
Ok(json!(collapsed))
}
json!(collapsed)
}),
"window.panel" => {
let raw = s("panel").unwrap_or_default();
// Canonical id (case-insensitive; display labels work too), then the
@@ -1340,6 +1365,7 @@ pub fn checked(app: &VectorcraftApp, id: &str, p: &Value) -> Option<bool> {
app.ui.floating_flyouts.iter().any(|f| f.tools.iter().any(|id| id == tool))
}
"window.taskBar" => app.ui.task_bar,
"window.taskBar.pin" => app.ui.task_bar_place.pinned,
"window.panel" => {
let panel = p.get("panel").and_then(Value::as_str).unwrap_or("");
let canonical = normalize_panel(panel);
@@ -2672,6 +2698,13 @@ pub(crate) fn home_key(app: &VectorcraftApp) -> (Option<u64>, usize) {
(app.session.active().map(|d| d.uid), app.session.documents().len())
}
/// Whether the Home screen is up: chosen with the Home button (`app.home`), or no document is open
/// and Preferences › General › Show The Home Screen When No Documents Are Open is on (#394). Off,
/// an app with no document shows an empty window, and the Home button still opens the screen.
pub(crate) fn home_showing(app: &VectorcraftApp) -> bool {
app.ui.home.is_some() || (app.session.active().is_none() && app.session.prefs.show_home_screen)
}
fn label_of(it: &Item) -> &'static str {
match it {
Item::Cmd(l, _, _) => l,
+41
View File
@@ -79,6 +79,7 @@ struct Applied {
threads: i32,
tool_tips: bool,
scrub: bool,
bare_points: bool,
}
/// Per frame: push UI-side preferences into egui / the renderer when they change.
@@ -95,6 +96,7 @@ pub fn apply_runtime(app: &mut VectorcraftApp, ctx: &egui::Context) {
threads: p.render_threads,
tool_tips: p.show_tool_tips,
scrub: p.scrub_numeric_fields,
bare_points: p.numbers_without_units_are_points,
};
let id = egui::Id::new("dc-applied-prefs");
let prev: Option<Applied> = ctx.data(|d| d.get_temp::<Option<Applied>>(id)).flatten();
@@ -105,6 +107,7 @@ pub fn apply_runtime(app: &mut VectorcraftApp, ctx: &egui::Context) {
let delay = if want.tool_tips { egui::style::Interaction::default().tooltip_delay } else { f32::INFINITY };
ctx.global_style_mut(|s| s.interaction.tooltip_delay = delay);
crate::scrub::set_enabled(ctx, want.scrub);
crate::widgets::set_bare_numbers_are_points(ctx, want.bare_points);
if want.white_canvas {
let mut t = Tokens::get(ctx);
t.pasteboard = egui::Color32::WHITE;
@@ -231,6 +234,11 @@ fn category_fields(ui: &mut egui::Ui, d: &mut Dialog, cat: &str) {
first = false;
let v = d.fields.get(sp.key).cloned().unwrap_or(Value::Null);
match sp.kind {
// Units › Numbers Without Units Are Points only tells points from picas: dimmed
// unless a unit is Picas.
PrefKind::Bool if sp.key == "numbersWithoutUnitsArePoints" => {
ui.add_enabled_ui(picas_in_use(d), |ui| bool_row(ui, d, sp.key, sp.label));
}
PrefKind::Bool => bool_row(ui, d, sp.key, sp.label),
PrefKind::Num { min, max, unit } => {
labeled(ui, sp.label, |ui| {
@@ -319,6 +327,11 @@ fn category_fields(ui: &mut egui::Ui, d: &mut Dialog, cat: &str) {
}
}
/// Is one of the dialog's Units (General, Stroke, Type, East Asian Type) Picas?
fn picas_in_use(d: &Dialog) -> bool {
["unitsGeneral", "unitsStroke", "unitsType", "unitsAsianType"].iter().any(|k| d.str(k) == vectorcraft_doc::Unit::Picas.key())
}
fn bool_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str) {
let mut b = d.bool(key);
if ui.checkbox(&mut b, tl!(label)).changed() {
@@ -473,6 +486,34 @@ mod tests {
assert_eq!(saved["engine_prefs"]["gpuPreference"], json!("highPerformance"));
}
/// Units › Numbers Without Units Are Points (#394): the preference reaches the fields when it
/// changes, and its checkbox is dimmed unless a unit is Picas.
#[test]
fn numbers_without_units_are_points_reaches_the_fields_and_dims_without_picas() {
let mut a = app();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let frame = |a: &mut VectorcraftApp| {
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
apply_runtime(a, ui.ctx());
show(a, ui.ctx());
});
out.textures_delta.clear();
};
let read = |ctx: &egui::Context| widgets::typed_unit(ctx, vectorcraft_doc::Unit::Picas);
frame(&mut a);
assert_eq!(read(&ctx), vectorcraft_doc::Unit::Points, "on by default");
a.run("prefs.set", json!({"key": "numbersWithoutUnitsArePoints", "value": false})).unwrap();
frame(&mut a);
assert_eq!(read(&ctx), vectorcraft_doc::Unit::Picas, "off");
// The checkbox: dimmed with every unit in points, enabled once a unit is Picas.
open(&mut a, Some("Units"));
let d = a.ui.dialog.as_mut().unwrap();
assert!(!picas_in_use(d), "dimmed in points");
d.fields.insert("unitsStroke".into(), json!("picas"));
assert!(picas_in_use(d), "enabled with a unit in picas");
}
#[test]
fn every_category_renders_fields() {
for c in PREF_CATEGORIES {
+23
View File
@@ -258,6 +258,10 @@ pub struct UiState {
pub toolbar_advanced: bool,
#[serde(default = "yes")]
pub task_bar: bool,
/// Where the Contextual Task Bar was dragged or pinned. Not saved, as in Illustrator: the bar
/// starts under the selection at every launch.
#[serde(skip)]
pub task_bar_place: TaskBarPlace,
/// Last tool shown in each toolbar slot (keyed by the slot's first tool id).
#[serde(default)]
pub slot_tool: std::collections::BTreeMap<String, String>,
@@ -389,6 +393,24 @@ pub struct FloatingFlyout {
pub pos: [f32; 2],
}
/// Where the Contextual Task Bar sits once its handle has moved it (`window.taskBar.pin`,
/// `window.taskBar.reset`).
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct TaskBarPlace {
/// More Options › Pin Bar Position: the bar stays where it is instead of following the selection.
pub pinned: bool,
/// Where a pinned bar's top-left corner sits from the canvas's top-left (none when it was
/// pinned before it ever showed, until it is drawn). Unpinning leaves it for the next frame
/// to turn into `offset`.
pub pin_at: Option<egui::Vec2>,
/// Where the bar was last drawn, from the canvas's top-left: where pinning holds it.
pub shown_at: Option<egui::Vec2>,
/// How far an unpinned bar was dragged from its place under the selection, which it keeps while
/// it follows the selection, and the document (`DocState::uid`) it was moved in: in another
/// document the bar starts under the selection again.
pub offset: Option<(u64, egui::Vec2)>,
}
impl UiState {
/// Clear transient state after loading saved preferences.
pub fn sanitized(mut self) -> Self {
@@ -427,6 +449,7 @@ impl Default for UiState {
toolbar_double: false,
toolbar_advanced: false,
task_bar: true,
task_bar_place: TaskBarPlace::default(),
slot_tool: Default::default(),
floating_flyouts: vec![],
status_bar: true,
+43
View File
@@ -39,6 +39,49 @@ fn home_shows_over_open_documents_until_a_document_is_chosen() {
assert!(app.ui.home.is_none());
}
/// Draw one canvas frame; whether it drew any text (the Home screen's labels; an empty window
/// draws none).
fn draws_text(app: &mut VectorcraftApp) -> bool {
fn has_text(s: &egui::Shape) -> bool {
match s {
egui::Shape::Text(_) => true,
egui::Shape::Vec(v) => v.iter().any(has_text),
_ => false,
}
}
app.canvas_rect = None;
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0))), ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| canvas::show(app, ui));
out.textures_delta.clear();
out.shapes.iter().any(|c| has_text(&c.shape))
}
/// General › Show The Home Screen When No Documents Are Open (#394): off, an app with no document
/// shows an empty window instead of the Home screen, and the Home button still opens it.
#[test]
fn home_screen_without_documents_follows_its_preference() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
assert!(app.session.active().is_none());
assert!(draws_text(&mut app), "Home with no document open (the default)");
assert!(crate::menus::home_showing(&app));
app.session.execute("prefs.set", &json!({"key": "showHomeScreen", "value": false})).unwrap();
assert!(!draws_text(&mut app), "off: an empty window");
assert!(!shows_document(&mut app));
assert!(!crate::menus::home_showing(&app), "the Home button isn't lit");
app.run("app.home", json!({})).unwrap();
assert!(draws_text(&mut app), "the Home button still shows the Home screen");
app.run("file.new", json!({})).unwrap();
assert!(shows_document(&mut app));
assert!(app.ui.home.is_none());
app.run("file.close", json!({})).unwrap();
assert!(app.session.active().is_none());
assert!(!draws_text(&mut app), "closing the last document leaves the window empty");
app.session.execute("prefs.set", &json!({"key": "showHomeScreen", "value": true})).unwrap();
assert!(draws_text(&mut app), "on again: Home");
}
#[test]
fn cmd_n_opens_the_new_document_dialog() {
assert_eq!(crate::shortcut_editor::command_for_key("Cmd+N"), Some("file.newDialog"));
+25
View File
@@ -132,6 +132,31 @@ fn plain_fields_do_math_with_their_suffix() {
assert_eq!(f.frame(vec![enter()], &draw), Some(90.0));
}
/// Preferences › Units › Numbers Without Units Are Points (#394): on (the default), a number typed
/// with no unit into a field in picas is read in points; a typed unit still wins (`2p6`, `1in`);
/// off, it is in picas. A field in any other unit reads it in its unit either way.
#[test]
fn bare_numbers_in_picas_fields_are_points_when_the_preference_says_so() {
let mut f = Field::new();
let typed = |f: &mut Field, u: Unit, text: &str| {
let pt = Cell::new(u.to_pt(4.0));
let draw = |ui: &mut egui::Ui| widgets::num_field(ui, "f", Some(pt.get()), u, 80.0).inspect(|&v| pt.set(v));
f.frame(vec![], &draw);
f.frame(f.click(1), &draw);
f.frame(vec![Event::Text(text.into())], &draw);
f.frame(vec![enter()], &draw)
};
let (pc, mm) = (Unit::Picas, Unit::Millimeters);
assert_eq!(typed(&mut f, pc, "12"), Some(12.0), "on by default: points in a picas field");
assert_eq!(typed(&mut f, pc, "2p6"), Some(30.0), "picas and points as typed");
assert_eq!(typed(&mut f, pc, "1in"), Some(72.0), "a typed unit wins");
assert_eq!(typed(&mut f, pc, "10+5"), Some(15.0), "arithmetic in points too");
assert_eq!(typed(&mut f, mm, "12"), Some(mm.to_pt(12.0)), "a millimetre field keeps millimetres");
widgets::set_bare_numbers_are_points(&f.ctx, false);
assert_eq!(typed(&mut f, pc, "12"), Some(pc.to_pt(12.0)), "off: picas");
assert_eq!(typed(&mut f, mm, "12"), Some(mm.to_pt(12.0)));
}
/// ↑/↓ step a focused numeric field by one of its unit (Shift: ten, Ctrl/Cmd: a tenth) and apply it
/// at once, the new value selected so typing replaces it; an unfocused field leaves the arrows to
/// the canvas (nudge).
+21 -4
View File
@@ -146,8 +146,24 @@ pub fn dim_name(ui: &mut Ui, text: &str) -> Response {
ui.label(egui::RichText::new(text).color(t.text).size(12.5))
}
/// Preferences › Units › Numbers Without Units Are Points (#394; on until set): the app sets it
/// when the preference changes (`prefs_dialog::apply_runtime`), the length fields read it.
pub(crate) fn set_bare_numbers_are_points(ctx: &egui::Context, on: bool) {
ctx.data_mut(|d| d.insert_temp(egui::Id::new("bare_numbers_are_points"), on));
}
/// The unit a number typed with no unit into a field in `unit` is read in: `unit`, or for a field
/// in picas points with Numbers Without Units Are Points on (where `12` could be either). A typed
/// unit (`12 mm`, `2p6`, `1in`) always wins.
pub(crate) fn typed_unit(ctx: &egui::Context, unit: Unit) -> Unit {
let bare_points = ctx.data(|d| d.get_temp::<bool>(egui::Id::new("bare_numbers_are_points"))).unwrap_or(true);
if bare_points && unit == Unit::Picas { Unit::Points } else { unit }
}
/// A recessed numeric field showing `value` (points) in `unit`. Returns the new value (points)
/// when the user commits (Enter / focus loss). Supports unit suffixes and arithmetic.
/// when the user commits (Enter / focus loss). Supports unit suffixes and arithmetic; a number
/// without a unit is in `unit` ([`typed_unit`]: in points in a picas field with Numbers Without
/// Units Are Points on).
pub fn num_field(ui: &mut Ui, id: impl std::hash::Hash + std::fmt::Debug, value: Option<f64>, unit: Unit, width: f32) -> Option<f64> {
let t = Tokens::get(ui.ctx());
let id = ui.id().with(id);
@@ -182,11 +198,12 @@ pub fn num_field(ui: &mut Ui, id: impl std::hash::Hash + std::fmt::Debug, value:
.inner;
select_all_on_focus(ui, &resp, &buf);
// ↑/↓ and the wheel step in the field's unit; a drag on its label scrubs it.
let stepped = step_value(ui, &resp, &mut buf, |b| Some(unit.from_pt(unit.parse(b)?)), |v| unit.format(unit.to_pt(v)));
let read = typed_unit(ui.ctx(), unit);
let stepped = step_value(ui, &resp, &mut buf, |b| Some(unit.from_pt(read.parse(b)?)), |v| unit.format(unit.to_pt(v)));
let scrubbed = scrub::field(ui, id, rect, &buf, value.map(|v| unit.from_pt(v)), STEP_DECIMALS);
let commit = resp.lost_focus() && buf != shown;
ui.data_mut(|d| d.insert_temp(id, buf.clone()));
if commit { unit.parse(&buf) } else { stepped.or(scrubbed).map(|v| unit.to_pt(v)) }
if commit { read.parse(&buf) } else { stepped.or(scrubbed).map(|v| unit.to_pt(v)) }
}
/// The places a stepped value in a unit field keeps (no 12.300000001).
@@ -1319,7 +1336,7 @@ pub fn opt_field(ui: &mut Ui, id: impl std::hash::Hash + std::fmt::Debug, value:
ui.data_mut(|d| d.insert_temp(id, buf.clone()));
if resp.lost_focus() && buf != shown {
let s = buf.trim();
if s.is_empty() { Some(None) } else { unit.parse(s).map(Some) }
if s.is_empty() { Some(None) } else { typed_unit(ui.ctx(), unit).parse(s).map(Some) }
} else {
stepped.or(scrubbed).map(|v| Some(unit.to_pt(v)))
}
+10 -1
View File
@@ -18,7 +18,7 @@ so only enable it while you use it. Transport: `apps/vectorcraft/src/control_ser
| `engine.execute` | `{command, params}` | run any engine or UI command (see `engine.commands`) |
| `engine.commands` | | every command with label, shortcut, params doc, enablement |
| `document.inspect` | `{depth?, childLimit?}` | layer tree, selection, history, paint defaults; the options slice the layer tree as `document.node {summary: true}` does |
| `ui.inspect` | | tool, UI state, `screenMode` (0 normal, 1 full screen with menu bar, 2 full screen, 3 Presentation Mode), view, canvas rect, window size, perf, background saves and exports still running |
| `ui.inspect` | | tool, UI state, `screenMode` (0 normal, 1 full screen with menu bar, 2 full screen, 3 Presentation Mode), `taskBar` (`pinned`, and `rect` `[x, y, w, h]` while the Contextual Task Bar shows), view, canvas rect, window size, perf, background saves and exports still running |
| `ui.menu.list` / `ui.menu.invoke` | `{command, params}` | the full menu tree / invoke an item |
| `ui.contextMenu.list` | | the canvas context menu for the current selection, flattened like `ui.menu.list` (`path` holds its submenus). `ui.click {x, y, button: "right"}` on the canvas opens it, after selecting the object there unless it is already selected |
| `ui.tool.select` / `ui.tool.list` | `{tool}` | |
@@ -205,6 +205,15 @@ that open its flyout raise the strip instead. The strips (`ui.floating_flyouts`
and the strip's top-left corner) are saved with the preferences and in user workspaces; the built-in workspaces
float none.
The Contextual Task Bar: its handle (the grip at its left end) drags it anywhere on the canvas, which always holds
it whole, also when the window shrinks. Unpinned, the bar keeps that offset as it follows the selection, until
another document becomes active. Its More Options (…) menu has Hide Bar (`window.taskBar`); Pin Bar Position
(`window.taskBar.pin {pinned?}`, omitted toggles, checked while pinned), which holds the bar where it is across
selection changes (the handle still moves it) and, turned off, lets it follow the selection again from there; Reset
Bar Position (`window.taskBar.reset`), which unpins it and puts it back under the selection; and Show Properties
Panel. As in Illustrator, neither the position nor the pin is saved: each launch starts with the bar under the
selection.
Flatten Transparency: `ui.flattenTransparencyDialog` opens the `flattenTransparency` dialog for the selection
(fields `preset`: a preset name, setting it loads that preset's options; the option keys of
`object.flattenTransparency`: `balance` 0–100, `lineArtPpi` and `gradientPpi` 1–2400, `textToOutlines`,
+8 -2
View File
@@ -1190,9 +1190,11 @@ wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel s
default: in View › Pixel Preview at 600% zoom and above, a line at every document pixel over the art),
`recentFontsCount`, `antiAliasedArtwork` (on by default; off, the canvas draws the art with hard edges — a pixel is
painted when the art covers at least half of it — while raster effects and pattern tiles stay smooth; exports keep
their own Anti-aliasing option) and
their own Anti-aliasing option),
`scrubNumericFields` (on: a horizontal drag on a numeric field's label steps the field, one undo step per drag; the
control channel's `ui.drag` scrubs).
control channel's `ui.drag` scrubs), `showHomeScreen` (on by default: the Home screen while no document is open;
off, an empty window, and the Home button or `app.home` still shows the screen) and `autoCollapseIconPanels` (off by
default: on, a click away from a panel popped out of the icon column puts it away).
The Smart Guides preferences (Preferences › Smart Guides) apply to `pointer_gesture` with Smart Guides on (the
default view) and to the mouse; they change what the tools show and how far a target pulls, never where a snapped
@@ -1325,6 +1327,10 @@ three: General (rulers, positions and sizes, the Info panel, dialog distances, c
(`document.inspect` → `units`): `document.setUnits {units}` (Document Setup) sets it for that document, and
`prefs.set {key: "unitsGeneral", value}` sets it for the active document too (one undo step) and is the units
`file.new` starts in when it gets no `units`. Stroke and Type are the preferences `unitsStroke` and `unitsType`.
`numbersWithoutUnitsArePoints` (on by default) makes the desktop app's length fields in picas read a number typed
with no unit in points (`12` is 12 pt, `2p6` and `1p` stay picas, `12 mm` millimetres); off, it is in picas. Fields in
other units read it in their unit either way, and the Preferences dialog dims the option unless a unit is Picas.
Command params are in points either way.
`prefs.list` marks the length preferences (`keyboardIncrement`, `cornerRadius`, `pasteOffset`, `gridlineEvery`,
`typeSizeIncrement`, `baselineShiftIncrement`) with `measure: "general"|"type"`; they are kept in points and also take
a string with a unit. Unit names: `Points`, `Picas`, `Inches`, `Millimeters`, `Centimeters`, `Pixels`, `Feet & Inches`,