mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-31 07:38:06 +00:00
#4985 added a canvas Shift+right-click popup that worked only for the Brush and listed only its painting modes. In the reference application Shift+right-click opens a menu for every painting tool: Edit Brush… (the Brush Preset picker a plain right-click opens), a separator, then the tool's own Mode list from its options bar: - Brush, Pencil: the painting modes with Behind and Clear - Clone Stamp, Pattern Stamp, History Brush: the blend modes - Mixer Brush, Color Replacement, Background Eraser: Edit Brush… only - Eraser: Brush / Pencil / Block (no Edit Brush…) - Blur, Sharpen, Smudge: Edit Brush… (the reference lists modes too) - Dodge, Burn: Shadows / Midtones / Highlights; Sponge: Desaturate / Saturate - Healing Brush: its blend modes; Gradient: the blend modes; Paint Bucket: the blend modes with Clear (no Edit Brush…) - Spot Healing, Magic Eraser and non-painting tools: no menu, the gesture keeps its old route brush_mode_menu.rs is now a per-tool item list (Item enum + items(tool)) instead of a Brush-only list. Each row sets exactly what the tool's options-bar control sets: a brush-based tool's mode through tools.setBrush (Brush/Pencil also Behind and their own Clear flag), the Eraser mode, tone range, sponge mode, gradient and bucket modes as tool options. Blend modes are grouped with separators; the current choice is checked; Behind and Clear are greyed on the Background layer. The menu remembers the tool that opened it and closes on a tool change. Only settings the options bar already has are offered. Not offered yet (no setting here): Behind for the stamps, History Brush, Gradient and Paint Bucket; the Blur/Sharpen/Smudge modes; the Spot Healing modes; the Healing Brush's Sampled/Pattern source and Replace; the History Brush source. Control: ui.inspect's brushModeMenu reports tool, mode, choices (the active tool's labels) and items (label/enabled/checked, separators); ui.context.choose {id: <label>} picks a row, an unknown or greyed row is an error that changes nothing. Tests (kittest): each representative tool's rows in order, choosing a row sets the options-bar state and journal, Edit Brush… opens the picker at the click, Behind/Clear greyed on the Background, Magic Eraser and Spot Healing open nothing; control graceful failure for bad choices. "Edit Brush…" added to every catalog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>