#2756 made the browser read its rows from a PresetSource and read the
pointer and the modifiers only for its rows' events, so the browser part
of this branch is next's now. The trial builds its rows from a source
and checks the pointer move only: at rest the browser reads no
modifiers. Its tile view still fails without the tile grid change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The same read as in the Layers and Channels panels: pointer::frame(..).mods
notes the pointer as a tracked input, so a memoized view holding the
component ran on every pointer move in the window. pointer::mods returns
the same modifiers and notes only the modifiers. Fifteen more sites read
the frame for its modifiers only (the preset browser, the tile grid, the
section footer, the dock's drop, the canvas guides, the crop tool, the
bins, Color Range, the raw develop dialog, the table conditions, the form dialogs,
Save for Web) and the text style panel; each reads pointer::mods now.
The preset browser also reads the pointer's buttons, press and release
for its rows' events; it reads the frame only when there are events, so
a pass without one does not depend on the pointer.
In PhotoCraft this left Swatches, Gradients, Patterns, Styles, Shapes,
Tool Presets, Character and Paragraph Styles, Brushes and Glyphs running
on every pointer move over the canvas; with the change every docked
panel replays.
Trial: the preset browser in a host view replays on a pointer move
beside it, in its list view (fails without the browser change) and its
tile view (fails without the tile grid change), and Alt held runs it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Collection requests are a tracked input: request_rename moves it and the item step that takes the request reads
it, so a pending request runs the memoized view that takes it.
- A preset picker opens with the focus in its search field (the browser's search field is the popover's default
stop), so its head and list replay while it is open and idle; without a search field, on its first stop.
- A memoized view's layout room keeps whether its body is a content-sized or a given column, as it keeps the content
axes: a rule that fills the width in a view in a content-sized popover took the open room, not the popover's width.
- Trials: a request runs the taking view once; a view in a popover fills its width as without the view. The escape
revert trial edits roundness by dragging a dot (a press on the tip widget takes no focus).
ParamRows and ParamDialog take a PresetSource for their pattern rows (a hosted dialog's build gives one over owned
inputs); the export and PDF export dialogs, the swatch list (swatch_source, thumbs from the drawn colours), the
gradient palette and Gradient Map picker, the pattern fill editor, the text style picker (style_source) and the Layer
Style dialog (patterns, style presets, contour_source) build their presets from sources. Their painters are fns:
RampSampler, SwatchPainter, ContourSampler. Key types and the model types they are built from are memo props.
A memoized view inside an open popover replays while nothing changes; an open preset picker runs no list row while
nothing changes; a Size drag in the Brush Preset picker runs its head and replays the list.
The Swatches panel's rows stay public as `swatch_rows(groups, words)`, which the source's rows fn calls.
PresetBrowser, PresetPicker, PresetManager and BrushPresetPicker take a PresetSource (the host's
MemoProps inputs and capture-free fns that build the rows and answer can_rename, can_delete,
can_move, accepts and thumb), so the browser's grid or list, its drop zone and row menu run in
a memoized view keyed on the inputs. Rows are kept per inputs and scope units (runtime::derived).
The Brush Preset picker's head and its search-row tools are memoized views of their own; the gear
rows are a fn.
Work in progress: the remaining callers (form dialogs, color-ui, draw gradients and patterns,
text style panel, imaging layer styles) are not moved yet and do not build.
The field measured its face over both formatted ends of the range, in the
caption's proportional figures, so a value between them could still be wider
(4888 beside 5000) and change the chip's width. caption_range now names the
numeric range and decimal places of the caption; the field measures with
NumberCodec::widest of that range, and a face's thumbnail caption shows in
tabular figures, so the widest text is the widest number whatever its digits.
BrushPresetPicker writes its caption with the same codec.
Part of storytold/photocraft#15476, for storytold/photocraft#15859.
A chip whose caption follows a value (the Brush Preset chip's diameter) took the
width of its current caption, so the chip widened as the caption gained a digit.
During a size drag that moved what follows it on the bar, and the bar's kept
measure no longer matched, so the frame ran a second pass.
PresetPicker::caption_range names the captions at the two ends of what the caption
shows; the field measures with the wider, as a number field holds the widest value
of its range. BrushPresetPicker passes the captions of 1 and its largest diameter.
Part of storytold/photocraft#15476, for storytold/photocraft#15859.
DropZone names a rect on an egui layer; drag::zone_target registers a target over it with the
layer order, operation and mark of a component's own target, which now goes through the same
function. Trials: the zone drop (and the covered, outside and group cases), and a PresetPicker
inside a Popover keeping the popover open through open and pick.