Commit Graph
6875 Commits
Author SHA1 Message Date
aiongg 1fadb03453 Document faces: one queue per context, lost loads fail, replays mark faces drawn, one byte budget
- The load queue is made once per context, as TextureLoader's is: without a
  host, default_jobs() returned a new Arc each call, so every new face made a
  new queue and dropped the loads before it.
- The begin-pass step marks a face unavailable when its load is neither
  queued nor running and delivered no result (a job that panicked), so the
  row stops asking for passes.
- A kept face's draw mark is journaled, so a settled view's replay marks the
  faces its run drew and eviction keeps them while on screen.
- One budget over the files the registry keeps plus the files egui still
  holds for faces taken out. Past it, the faces drawn longest ago go down to
  half the budget and egui's fonts are made again once. The budget is a
  registry field; trials set it with testing::document_face_budget.
- FacesCx::document_face takes a closure that makes the load, called only
  for a new key, so a ready face clones no FaceInfo or catalog.
- Similar fonts weigh a family by its file's raw usWeightClass again
  (FaceInfo::weight_class, None without OS/2; 400 then), not the scan's
  weight. The review point that families without OS/2 data now join Similar
  fonts was checked: the old read_traits listed them too, with zero PANOSE
  and weight 400, so they stay.
2026-11-23 03:25:59 +00:00
aiongg de01d25a52 font-catalog: name the per-file slot type (clippy type_complexity) 2026-11-23 03:06:37 +00:00
aiongg 67409c465f Font picker: sample faces load off the UI thread and stay while drawn lately
Opening the font list read and parsed every visible row's font file on the UI
thread, re-read a collection for each family it holds, rebuilt egui's whole
font set for each face added, and dropped off-screen faces after 64, so
scrolling back loaded them again.

- Document faces reach egui through one served-faces provider: egui parses a
  face the first time text is laid out in it, so a face arriving keeps the
  parsed faces, the atlas and the galley caches. Faces over the interface
  fonts use the same provider; edit_faces' add path and
  MAX_INTERFACE_FACE_BYTES go.
- Catalog faces load as jobs on a per-context JobQueue (the host's jobs) and
  are ready from the pass after they land; loads no frame asks for are
  dropped. Faces whose bytes the app holds register in the same pass.
- The registry keeps faces up to MAX_DOCUMENT_FACE_BYTES (512 MiB of distinct
  file bytes), least recently drawn out first; past the same budget of
  withdrawn files egui's fonts are made again to free them.
- The picker's coverage check reads the registry's loaded bytes instead of
  the file; traits come from FaceInfo, which the scan now fills with
  sFamilyClass, PANOSE and the post fixed-pitch flag.
- Catalog::file_bytes shares one read per file across threads.
2026-11-23 03:00:47 +00:00
aiongg dbcf3998ac craft-pdf: the cos suite uses the crate's testkit instead of loading the file a second time 2026-11-23 00:27:47 +00:00
aiongg 134abcc8dc Build the tests next lost in the sync into the crates' test executables
pdf (cos, crypt, filters, font_tables), cms (gpu_matrix_shaper) and prepress (marks, flatten_timings) had no mod line in tests/main.rs, so they never compiled. Module paths inside the one executable are adjusted (crate:: to super::, the child-process test name).
2026-11-23 00:11:29 +00:00
David Mann a4e08cdaf2 Merge pull request #3105 from davidmann4/fix/16461-toolbar-background
WIP: docked toolbar background fills its column, thinner divider, grip grab cursor (photocraft#16461, #16467)
2026-11-23 00:58:28 +01:00
David MannandClaude Opus 5.5 487f822571 Dock: a toolbar's marked grip shows the grab cursor (photocraft#16467)
The grip a tool rail is dragged by showed the plain arrow, while the grips
of a collapsed column show grab and grabbing. A movable marked GroupGrip now
requests Grab over it and Grabbing while held, at part priority, so a drop
target's cursor during the drag still wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:38:41 +01:00
David MannandClaude Opus 5.5 55d3a66134 Dock: a docked tool rail column takes the dock's height; tight-gap dividers (photocraft#16461)
A docked stepped column (a tool rail) was clamped to its content's height, so under a docked
toolbar the window background showed instead of the toolbar's surface. The reference
application keeps the docked toolbar's column surface down to the dock's foot, with the tools
at the top. Docked, a stepped column now takes the dock's height like any column; a floating
stepped window stays as tall as its content.

The dividers between docked columns and between a dock and the document area were the inline
gap (6 px comfortable, 4 compact); the reference application's are 3 px at 100%. They are now
the tight gap (3 px comfortable, 2 compact).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:16 +01:00
David MannandClaude Opus 5.5 269c33ea55 Crop: a move of a turned document crop may take the frame past its bounds
A turned frame stopped at the image's edge on a move (photocraft#16460);
the reference application lets it go past and fills the area there, as for
an upright frame (photocraft#16404). Only the turn itself still keeps the
frame inside the turned image (photocraft#10869).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:25:17 +01:00
aiongg 8d436f486a Merge pull request #3087 from aiongg/dropdown-drives
Dropdowns name the list that takes their opener's keys (font picker Enter after typing)
2026-11-22 15:05:41 -05:00
David Mann 1cb53fbbf4 Merge pull request #3055 from davidmann4/fix/16403-16406-navigator-crop-bar-grip
Navigator drag, Crop move and shield seam, options bar clip, grip ink (photocraft#16403, #16404, #16405, #16406, #16410)
2026-11-22 21:02:29 +01:00
aiongg 49988e9187 A dropdown's named list takes the keys only while it is shown
dropdown_target hands the opener's list keys to the named collection only when
it registered a stop in the last pass, so a dropdown that shows no list (the
font picker with no matching family) leaves Enter with the field, which
commits the typed name. The font picker names its family list on every pass.
The trial covers the no-match case with the class column shown.
2026-11-22 19:10:03 +00:00
aiongg fe271bf574 Dropdowns name the list that takes their opener's keys
A dropdown's opener (a picker's field or button) hands Up, Down, Page keys,
Enter and Tab to a collection in its dropdown. The framework took the first
type-ahead collection it found in the layer. The font picker's dropdown holds
the class column before the family list, so with filters shown Enter and the
arrows went to the class column: typing a name and pressing Enter picked
nothing.

Overlay::list (FocusPolicy::list) names the collection instead, and every
dropdown names its list: Select, ComboBox, TreePicker, completions, number
presets, PopupList (new PopupList::list) and the font picker, which names its
family list while it shows one. The type-ahead guess is gone.
2026-11-22 18:59:40 +00:00
David MannandClaude Opus 5.5 78a7530424 Dock grips: 2 points more room above the marks; a lighter grip ink in Pro dark (photocraft#16426)
The grip strip keeps 2 points more above its marks than below them in
every theme, so the marks stand clear of the column bar or icon group
above. Pro's dark mode pins line.grip to #555555 (it derived #474747 on
the #323232 panel), easier to see; token dumps follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:59:30 +01:00
David MannandClaude Opus 5.5 1b14d4e3e9 Navigator: a view past the document stays; only the Navigator's own moves are kept inside it (photocraft#16328, photocraft#12025)
Every pass the Navigator pulled the view's centre back into the document
and wrote it back when it differed, also when it had moved nothing. With
Overscroll on, a view the scroll bars or the Hand put on the pasteboard
went back to the document's edge at once: the scroll bars stopped there
(the thumb never reached its track's ends) and their drags ended on the
change, while the Navigator panel was shown. Only a centre the Navigator
moved in its pass is kept inside the document now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:44:49 +01:00
David MannandClaude Opus 5.5 8995360551 Docking: a floating tool rail dropped by its grip keeps the grabbed point under the pointer (photocraft#16426)
GroupDrag carries the press a rail's grip started it with; a drop that
moves the floating window it is the whole of moves the window by the
pointer's travel from there (kept inside the float area) and keeps its
size, instead of putting its title row under the pointer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:25:33 +01:00
David MannandClaude Opus 5.5 daf0a8d827 Docking: a floating tool rail's grip moves its window (photocraft#16426)
The grip under a tool rail's column bar starts a drag of the rail's group;
released over empty room it floated the group under the pointer, which the
model refuses for a group that floats already, so a floating toolbar's grip
did nothing. A unit that is a whole floating window now moves that window
under the pointer (Action::MoveFloating), as its title row does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:18:21 +01:00
David MannandClaude Opus 5.5 9b25308edc Dock grips: the strip keeps space above and below the marks (photocraft#16426)
The grip strip above an icon group and under a tool rail's column bar
was the least hit size (8 points), so the 5-point ticks nearly touched
its top edge. It is now tall enough for the theme's marks with
space.gap.tight above and below them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:09:43 +01:00
aiongg 3c1c1284d8 FontSample: a face not yet ready reserves the room's width
Without a ready face the sample measured no width, so an unavailable sample
allocated nothing. It reserves the most the ready layout can take, the width it is
offered, at LINE_EM of its size: the band the sample will draw in. A ready face
lays out as before.
2026-11-22 17:01:21 +00:00
aiongg 0f8efcadd9 ListRow: the collection's leaves setting is a pub(crate) prop
The derive writes the setter, as design-lint's props/hand-setter asks.
2026-11-22 17:01:21 +00:00
David MannandClaude Opus 5.5 4ba7c7e215 DocumentWindow: a level of its own; first_placed says the window is kept there (photocraft#16415)
DocumentWindow::level stands the window at a WindowLevel; with Palette a
floating document stays above the app's main window while the app is
active, drops below a blocking dialog and hides with the minimized main
window. first_placed's doc says what it does: the window is kept at the
rect while shown, so a caller whose user moves the window follows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:51:51 +01:00
David MannandClaude Opus 5.5 cdde34581e Theme: the dock grips' shape is a theme setting, apart from the reference by default (photocraft#16426)
shape.grip in a theme file sets the grips' marks: ticks or dots, how many,
a tick's length, a mark's width and the gap. Each value is optional and
keeps the default, now eleven ticks five points tall (one more mark and
one point taller than the reference application's ten of four). The
theme editor, the writer (unknown keys kept) and the token dumps carry it;
GripMarks paints from the tokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:49:02 +01:00
aiongg 57c4b23a70 Font picker: the banner shows what the family's row shows
The banner drew the preview text in the current family even when its face lacks the
text's characters (tofu). It takes the rows' sample text, through the same
FamilyInfos::sample_text: the text, else the family's name, else its first glyphs.
2026-11-22 16:10:48 +00:00
aiongg a47b795b1f Font picker: one sample per row, in the sample text
Every row's sample shows the picker's sample text: the host's preview text, else the
sample word. The Arabic second sample and its script check are gone. A face that
lacks the text's characters keeps the existing fallback: its name, else its first
glyphs.

A sample, in a row, the banner or the panel, is laid out and drawn only in its own
face once it is ready. Until then (and for good when the face is unavailable or the
family has none, SampleFace::Missing) it keeps its band, LINE_EM of its size high,
and draws nothing, instead of laying the text out in the interface face, which may
lack its characters.

The Arabic story becomes font_picker_arabic_sample_text: an Arabic preview text over
a catalog with Noto Sans Arabic.
2026-11-22 16:08:54 +00:00
aiongg e8254eb4b4 List rows: a hosted trailing field takes its own height up to its row's
A trailing or optional field was capped at the base row height, so in a taller row
(a large thumbnail) a field that measures taller was cut to one base row and centred,
clipping what it drew outside that band (the font picker's Arabic sample lost its
hamza and dots). It is capped at its slot, the row's height, as cell fields are.
2026-11-22 16:08:54 +00:00
David MannandClaude Opus 5.5 1f1437c4d9 Crop: a move past the canvas with Auto Center Preview, snapping and the Crop tool's defaults
The overlay test also moves the image with Auto Center Preview on, and a CropTool test moves an
upright frame past the canvas with the default settings (image mode, Auto Center, Delete Cropped
Pixels on), at 31 % and with snapping to the document's edges, as the app runs it.

Part of storytold/photocraft#16404.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:56:28 +01:00
aiongg 5c14a9d042 Font picker: give the Arabic sample story Noto Sans Arabic from the craft fonts set
The story's catalog had no face that maps Arabic, so no row showed the
Arabic sample. craft-font-manager's build script embeds Noto Sans Arabic
with fonts-build's Embed when the suite feature is on and CRAFT_FONTS_DIR
names a craft-fonts checkout; without it the table is empty and the story
shows the other families only.
2026-11-22 15:41:05 +00:00
aiongg 315a223e69 Merge pull request #3010 from aiongg/font-picker-port
FontPicker: production's font menu (row layout, aligned names, sample column, banner, separators)
2026-11-22 10:29:58 -05:00
aiongg 0baee1ff93 Merge pull request #3028 from aiongg/ime-empty-commit
ime: an empty commit with nothing marked is no edit
2026-11-22 10:29:45 -05:00
aiongg 25f2207178 Merge pull request #2995 from aiongg/win-hit-root
ui-shell: embed::before_ui takes the window handle, outside the app feature (photocraft#15870)
2026-11-22 10:29:32 -05:00
Martin Ball fa466c2639 Merge pull request #3049 from batistalucasv/fix/companion-layer-inbar-padding
ui-widgets: add bar padding, InBar env, and start alignment to Menu::companion CompanionLayer
2026-11-22 15:23:44 +00:00
David MannandClaude Opus 5.5 1aabfe2baf Memoized views keep the row line they stand on, so a memoized bar fills its slot
A memoized view starts a layout room of its own (`start_view_room`), which dropped the row line of
the row around it. A fill-width row shown through a memoized view (an app's options bar in the
shell's options slot) then measured its content with its padding on top and bottom instead of
taking the slot's line: its members sat below the slot's middle and the bottom of a text button's
outline was cut off. The view now keeps the line as a levelled unit does (`places: false`): its
content fills the line without taking slots on it.

Fixes storytold/photocraft#16405.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:07:21 +01:00
David MannandClaude Opus 5.5 0130c9090f Dock grips: drop the import the grip ink no longer needs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:07:21 +01:00
David MannandClaude Opus 5.5 8f8d03b771 Crop shield: one unfeathered mesh, no seam between its pieces
`paint_outside` filled each convex piece of the area outside the frame on its own, feathered on all
its edges, so along an edge two pieces share both faded out and the translucent shield left a thin
strip less covered than the rest: a light line from the frame's corner to the window's edge. The
pieces are now one mesh without feathering (`Draw::data_fill_tiled`), whose triangles meet with no
gap and no overlap. Crop and Perspective Crop both paint through it.

Fixes storytold/photocraft#16410.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:46:51 +01:00
David MannandClaude Opus 5.5 13d70a400d Theme: a line.grip token for the dock grips' marks, a little apart from the panel
The dock grips drew their marks at 0.83 of the panel colour, as the references do on their lighter
panels; on our dark panels that is #2a2a2a on #323232, almost invisible, and no theme could choose
it. The marks now use a `line.grip` token: by default two steps from the panel (lighter in dark
mode, darker in light mode; Pro dark #474747 on #323232), and a theme can pin its own.

Fixes storytold/photocraft#16406.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:42:58 +01:00
David MannandClaude Opus 5.5 4d059df7ce Crop: a move of an upright document crop may take the frame past its bounds
An edge or corner drag of a document crop already goes past the canvas (photocraft#16043); a move
of the frame (Classic Mode) or of the image under it (image mode) still stopped at the canvas
edge, so a crop could not take in the area past it by a move. In the reference application it
does. A move of an upright document crop now goes past the bounds too; a turned frame's move, turns,
drawn frames, nudges and a placed picture's crop keep their limits.

Fixes storytold/photocraft#16404.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:38:14 +01:00
David MannandClaude Opus 5.5 7536627202 Navigator: a view box drag follows every pointer move over a settling canvas
The canvas settles the view a drag proposes to whole device pixels, so the view the app writes
back differs from the Navigator preview's proposal by a fraction of a pixel. The preview used the
default `same_value` (exact equality), so the host-change check ended its drag after the first
move and the canvas only caught up on the release. It now compares with the tolerance the canvas
scroll bars use (photocraft#16006), shared as `settled_as_proposed`.

Fixes storytold/photocraft#16403.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:38:14 +01:00
batistalucasv de9d130f0d ui-panels: restore AlertDialog role and AccessKit reason description in UnsavedChangesDialog (#3040) 2026-11-22 10:27:52 -03:00
batistalucasv 7cd2de8667 ui-widgets: add bar padding, InBar env, and start alignment to Menu::companion CompanionLayer 2026-11-22 09:22:07 -03:00
Martin Ball 9906b2b9da Merge pull request #2983 from batistalucasv/fix/canvas-scrollbar-thickness-margin
ui-canvas: restore comfortable vertical scrollbar thickness and right edge margin
2026-11-22 12:06:23 +00:00
David Mann e953d47a37 Merge pull request #2978 from davidmann4/fix/16328-held-thumb-release
Canvas scroll bars: a thumb's pressed extent belongs to its press (photocraft#16328, photocraft#16329)
2026-11-22 12:09:32 +01:00
aiongg dad1d6ab80 ime: an empty commit with nothing marked is no edit
An empty commit inserts nothing, so it replaces no selection (the Type
tool's selected placeholder, photocraft#15556) and ends no composition
whose confirming key needs the guard frame. An empty commit that ends a
composition still ends it.
2026-11-22 09:06:38 +00:00
aiongg c6c2a816ef Merge pull request #3002 from aiongg/type-cursor-canvas
text: editor I-beam only over its text
2026-11-22 01:58:56 -05:00
aiongg 640864d0e2 FontPicker: the name column is as wide as its widest row and at least the field's sample name (ColumnSpec::at_least); library list leaves always aligned; one SAMPLE_EM; star trial checks the favourite and the family 2026-11-22 06:57:34 +00:00
aiongg de6b66d7e7 ListRow::leaves is set only by List::tree_leaves 2026-11-22 06:57:34 +00:00
aiongg 8a546e58f1 One separator between option groups: ListRow::rule goes, the preset browser, command palette and brush settings use ListRow::separator, whose height comes from the Divider's SeparatorRule 2026-11-22 06:57:34 +00:00
aiongg 54f5950a26 font-catalog: a background scan that panics lets the next call scan again 2026-11-22 06:57:26 +00:00
aiongg 771220fca5 Rows and grids clear the layer floor only where one is set 2026-11-22 06:57:26 +00:00
aiongg 4963e8405d FontPicker: popup sized to its content, aligned leaves keep the disclosure column, name column as wide as the field's sample
- FontPreviewBanner measures its name and sample, not the room: reporting the room sized the popup layer to the banner, so the rows under it took no pointer input.
- TreeLeaves::Aligned keeps an empty disclosure column on top-level leaves instead of adding an indent step, which the shrink rule gave up first. The picker aligns only lists that have a family to open, so a plain list keeps its names at the start. ListRow::leaves is a derived prop.
- A collection inside a row or grid takes no layer floor: the class column took the field's width beside the font list.
- The name column is as wide as NAME_SAMPLE, the rule the field's width follows; the list shows no column header; style rows stay in the name column and reserve the check column.
- Row samples are named "{name}: {sample}", as the font manager names its samples, so the row keeps the family's name to itself.
- The Arabic sample shows as an optional trailing field.
- FontPreviewBanner has stories; the open-list story shows the recent group, a family with styles and the class column.
2026-11-22 06:37:11 +00:00
aiongg 2450df6735 FontPicker: production's row (star column, aligned names, unframed sample column, format badge), preview banner on a well, class column as options, ghost Clear All, rule after recents, private families hidden, samples need outlines, loading state 2026-11-22 06:07:57 +00:00