Done is the dialog's default button, as in the reference application: Enter runs it from Change To
(without changing the word) and with nothing focused; a focused button keeps its own Enter and the
suggestions list keeps Enter as Change. Escape stays Done. Ported from storytold/photocraft#14328
by TrevorBrown-dev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ParagraphControls::show_with took `between` as FnOnce and ran it in the
first run of the controls' Stack body only. The Stack runs its body more
than once in a pass (measure, then real), so the host's rows were missing
from one of those runs. A container measured around the controls came out
one row short, and a flyout sized by that measure cut off Hyphenate below
its bottom edge.
`between` is now FnMut and runs in every run of the body. A caller that
passes a closure which only mutates its captures keeps compiling; one
that moves a captured value out needs to clone it.
The new test measures a Stack around the controls with a host row and
checks that the measure reaches the foot of Hyphenate. It fails without
the change (the host row does not show at all in that layout).
Lands #3916 onto main after #3909 and #3914. The only change from the
approved head is the merge resolution in tests/it/find_dialog.rs: all
three PRs appended a test at the end of the file, and all are kept.
Co-Authored-By: batistalucasv <175663788+batistalucasv@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lands #3914 onto main after #3909. The only change from the approved
head is the merge resolution in tests/it/find_dialog.rs: both PRs
appended a test at the end of the file, and both tests are kept.
Co-Authored-By: batistalucasv <175663788+batistalucasv@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts:
- ui-contract items/hooks.rs: rest_lead takes no placement here; main's
lead focus ring block is kept as main wrote it.
- ui-panels docking/mod.rs: main's FocusLook import kept; the memory::sub
import goes, since the dock no longer keeps pass frames in memory.
Follow-ups of the merge:
- MeasureCx::in_row (main) reads row_alone_room from the component's
scope env, as column_room does here.
- The split-handle focus ring trial (main) passes SplitArea's revision.
Reading where the pointer hovers marks what reads it as following the pointer:
Cx::hover_pos marks the part's hit area, and pointer::hover_point_in marks the
rect it reads in. PartResult::hover_pos is crate-private, member responses carry
the pointer only for a press, and the collections' row hover, edge band, the
menus, canvas, colour, timeline and font readers go through the accessors.
design-lint's contract/pointer rule bans egui's hover-position reads.
Cursor requests are journaled, so a replay requests its cursor again. A record
notes the arena roots, follows rects and wheel takers its run registered.
Conflicts:
crates/text/src/lib.rs
Conflict: crates/text/src/lib.rs module docs; this PR's embed paragraph sits beside main's module list. Ported to main's test harness: craft-text runs tests through craft_ui's #[trial] (harness = false), so the embed test is #[trial] and its module is pub(crate) for craft_ui::registry. Local: clippy -D warnings clean, embed test passes.
TextStylesPanel always draws character style 0 as "No character style":
Style Options, Duplicate and Redefine skip it, a double click does
nothing, the row is dimmed and drags of it are refused. An app whose
character style 0 is a real base style cannot open its options from the
panel.
`base_character_style(true)` makes character style 0 behave as paragraph
style 0 does: Style Options, Duplicate and Redefine take it from the
footer, the panel menu, the row menu and a double click, and the row is
drawn like the others. Delete still skips it. The option is off by
default, so apps with a "None" row see no change.
With RootEnv::escape_leaves_fields on, a text field took Escape and gave
up the focus unless it sat in a modal dialog. In a modeless dialog whose
Escape closes it (one with a footer, such as Find and Replace), the
first Escape left nothing focused, and a modeless layer does not take an
Escape while the focus is outside it, so no later Escape closed the
dialog and the focus never went back to the opener.
The field now keeps the focus in any dialog on top whose Escape closes
it, modal or modeless. An Escape the field does not take for its typing
closes the dialog, which returns the focus to its opener. In a modeless
dialog the first Escape still reverts a draft.
Kerning, tracking and the plain number fields fill their grid cell, as the
length fields do, and kerning shows its mark inside its box. Family, style,
font height, anti-aliasing and language span the panel. The row helpers take
the select's sizing from the caller, so the type bar keeps its widths; Format
Text and Style Options fill their cells as well.
The merge of next (b138b533fe) dropped one_line from the paste when it took the step loop. Moving the loop out of
TextEditor::update keeps the update under clippy's cognitive complexity limit.
Conflicts resolved (upstream's design and defaults win; the port's opt-ins stay):
- ui-contract fonts: upstream's served-faces provider, catalog job queue and byte budget;
the port's FaceBytes::chain (Word subset siblings, F-8) re-done on the provider: a served
face lists its served chain faces before the interface faces, a sibling landing after its
owner remakes egui's fonts once, drawing a face marks its chain drawn. The port's chain
trial moves onto upstream's rig, plus a late-sibling trial.
- text editor HostCx follows FacesCx's job-based document_face and document_face_bytes.
- ui-widgets Swatch: upstream's SwatchFill (split, spectrum, image, empty) with the port's
Swatch::optional / SwatchFace::optional (new SwatchFill::None, the "no colour" diagonal)
and Swatch::icon (glyph on the empty well) on top; both word sets kept.
- draw PaintBar: upstream's MixerLoad fill.
- font-manager: upstream's sample band; host rows (port) use it too.
- ui-panels / ui-patterns dock grips: upstream's drag_origin and named slack.
- platform clipboard tests: both trials kept.
Co-Authored-By: Claude <noreply@anthropic.com>
Upstream's editor runs in a restoring focus scope (FocusPolicy::TAB_LAYER), so an ended
session hands focus back to the stop it came from. A form field's editor takes focus
from the field's own page part, and focus arriving back there opens the field again:
Esc, Enter and picks no longer closed PdfCraft's fields. Component::focus_scope (default
FOCUS_SCOPE) lets an instance choose its scope; returns_focus(false) opens none.
Upstream's default is unchanged. Trial: an_editor_that_does_not_return_focus_leaves_its_opener_alone.
Real fixes, no allows: split long functions (portal first reads, canvas wheel read, text editor input pass, list row toggle parts, notice action rows, thumbnails grid aspect and edit rules, comments row entries), boxed the large Entry item row, type aliases for complex types, a StatusMeasure for the status cell's measures, double #[must_use] removed where the type is #[must_use], Copy clones and useless conversions dropped, struct-update syntax in place of field reassignment, a split press-pass test.
Pages: the port's page view keeps its pass (pre-draw tool callback, pager, GoTo, its picture stores) and takes
upstream's editor and inactive edits, snap and tool regions, rulers strips, picture reach with resident counts,
the zoom anchor and non-easing reflow, the thumb tip and Go To placement; PlacedPage::new takes upstream's
four arguments with showing() for the picture; page spacing is the theme insets for Creative and upstream's for
Productivity. Review: comment rows keep badges, lead and submit key beside upstream's balloon actions, body rows
and push buttons; a new lead keeps its own edit draft. Text: editor keeps holds_drafts with upstream's focus
scope. Module lists, stories and trials are the union.
257 conflicted files staged with their conflict markers (630 hunks). The one
modify/delete, crates/ui-patterns/src/patterns/preferences/body.rs (deleted
upstream, modified by the port), keeps the port's file for its area to carry
into upstream's preferences/page.rs. Plan: landing/fw-sync-plan.md.