Commit Graph
42 Commits
Author SHA1 Message Date
bflatastic 1b72220272 behavior: a grid's least probe keeps its Fill columns Fill, unbounded, so a field that fills its width there measures its own width instead of none; the fill column's least is then the field's, so a grid beside a menu no longer squeezes the field under it, stacks its label in rows measured unstacked, and overlaps the next row 2026-11-24 08:07:49 +07:00
bflatastic e433ef83eb ui-widgets: trial: a grid row holds a field whose label stacks above its control for want of room 2026-11-23 17:28:13 +07:00
aiongg a2cb4687ce Trials: labelled check boxes in scopes in an egui grid cell keep one line and shared rows; an egui grid directly in a right-to-left body or row stays finite and as wide as under left-to-right 2026-11-21 22:46:07 +00:00
aiongg 9d928c7954 Trials: flow facts stop at egui containers, a Lazy keeps the row's line, labels in egui grid cells and narrow horizontals 2026-11-21 21:50:53 +00:00
aiongg 7547d34702 Layout: a labelled control in a flow egui lays out without wrapping decides its label at its own width
egui::Grid offers a column with no width from the last frame its least cell width (40 points). A check box's label
after it was decided in that width, so it wrapped, its cell grew taller than the one-line cells beside it, and
egui::Grid centred the shorter cells lower: in PhotoCraft's Conditional Mode Change dialog, Bitmap and RGB Color
no longer shared a row. The column then stayed that narrow.

In a Ui that egui lays out (no body installed its env for it) where egui extends text instead of wrapping it
(Ui::wrap_mode: ui.horizontal, an egui::Grid without a max column width), the label step's row has no end: the
label keeps its natural width, a beside label never stacks for want of room, and the step's flow widens from the
row's start edge to what the label and control need. Craft's own rows, bars and grid cells, and vertical and
wrapping flows, keep their bounded room.
2026-11-21 20:43:45 +00:00
aiongg aae6c5a458 Layout: a body's row line and grid cells are for its direct children only
A component an app shows inside an egui container (an egui::Grid, ui.horizontal) in a Row or Grid body read the body's
env up the Ui stack and was placed as one of the body's children: a labelled check box in an egui::Grid inside a
full-width form row took a slot as high as the row's whole line, so every grid row was as tall as the block
(PhotoCraft's Conditional Mode Change dialog), and a check box in ui.horizontal in a Grid body took the grid's cells.

Env::installed_for says whether a Ui has an env entry of its own; row_line_of and grid_of give the row's line and the
grid's cells only there. The spread row's sweeps install the row's env for the Ui its children run in.
2026-11-21 20:15:40 +00:00
aiongg 71e51851ae Merge remote-tracking branch 'upstream/next' into wc-regressions
# Conflicts:
#	crates/ui-contract/src/layout/mod.rs
#	docs/contract-api.md
2026-11-21 17:53:07 +00:00
aiongg 2ef7bbff38 A field labelled above sits on a row's line by its control, as a control labelled above does
A container labelled above its body reports its body's first control line as the line it sits on in a row, so a
button beside a field labelled above sits level with the field's control, not its label.
2026-11-21 10:33:46 +00:00
aiongg 688df999d5 Layout: a labelled control's row takes its place in flow through place_in_cell, its control on the line 2026-11-21 10:18:40 +00:00
aiongg 786c71f812 craft-ui: remove Divider::length; regenerate contract-api.md
Divider::length has no caller since the ribbon groups fill their line; its story and trial go with it (the filling
divider trial stays). docs/contract-api.md is regenerated with the contract-api bin and lists ContainerProps::least_height
and Row::least_height.
2026-11-21 07:07:21 +00:00
FredApps 9793d1a452 Merge branch 'next' of https://github.com/storytold/craft-libs into publish/registry-2332
# Conflicts:
#	crates/dialogs/src/lib.rs
#	crates/dialogs/src/ui/mod.rs
#	crates/draw/src/ui/gradient/mod.rs
#	crates/draw/src/ui/gradient/swatch.rs
#	crates/menu/src/shortcuts/view.rs
#	crates/menu/tests/it/main.rs
#	crates/menu/tests/it/shortcuts/mod.rs
#	crates/pages/tests/it/main.rs
#	crates/print/src/lib.rs
#	crates/review/tests/it/main.rs
#	crates/story-render/src/main.rs
#	crates/table/tests/it/main.rs
#	crates/text/tests/it/main.rs
#	crates/ui-canvas/src/canvas/navigate/mod.rs
#	crates/ui-canvas/tests/it/canvas/mod.rs
#	crates/ui-contract/tests/it/access/mod.rs
#	crates/ui-contract/tests/it/fonts/mod.rs
#	crates/ui-contract/tests/it/runtime/mod.rs
#	crates/ui-gallery/src/foundations/mod.rs
#	crates/ui-patterns/src/patterns/preferences/mod.rs
#	crates/ui-patterns/tests/it/docking/mod.rs
#	crates/ui-patterns/tests/it/form_dialogs/mod.rs
#	crates/ui-patterns/tests/it/panels/palette.rs
#	crates/ui-patterns/tests/it/preferences/mod.rs
#	crates/ui-shell/src/shell/mod.rs
#	crates/ui-shell/tests/it/shell/mod.rs
#	crates/ui-widgets/src/tabs/strip.rs
#	crates/ui-widgets/tests/it/bars/mod.rs
#	crates/ui-widgets/tests/it/contract/mod.rs
#	crates/ui-widgets/tests/it/layout/mod.rs
#	crates/ui-widgets/tests/it/main.rs
#	crates/ui-widgets/tests/it/menu/mod.rs
#	crates/ui-widgets/tests/it/pickers/mod.rs
#	crates/ui-widgets/tests/it/text/mod.rs
2026-11-20 15:04:36 +01:00
Martin Ball f77301a76d Merge follow-up: resolve_in takes Reads; the host-key trial gives states through CommandStates; cargo fmt 2026-11-20 00:40:05 +00:00
Martin BallandClaude Opus 5.5 e368403605 fwstub-1: a labelled leaf in a wrapping row starts a new line when it would not fit the rest of the line (it is placed before egui allocates it, so the row never wrapped a radio and squeezed the last label); Page Setup's Text snaps to characters takes its second line again; trial
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:25:32 +00:00
Martin Ball 99c2bdf38b look-7a: Pad::Page, a full-window page's margin (two and a half roomy pads, 40 pt compact), as WordCraft's File pages stand off the window; trial and the Stack story's pad choice 2026-11-19 19:54:29 +00:00
Martin Ball d928a407cf look-7a: a container's least width holds in the measure its parent places it by, as in its own extent; a row gave a File page's side menu only its widest name (about 123 pt for 200); trial 2026-11-19 19:50:43 +00:00
Martin Ball de091d4186 Merge branch 'red/look-rest-3' into area/ribbon-fw 2026-11-19 14:24:06 +00:00
Martin BallandClaude Opus 5.5 e2ed478fea look-ribbon-3: a ribbon group ends with its title: Divider::length gives a separator its own length (no fill), a group's separator is as tall as the group; the title sits directly under the body on one caption line in every group; the dialog launcher sits on that line at the group's end, shown at its place so it never makes the title line taller; trials and story
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 14:19:21 +00:00
Martin Ball cc0293e33b look-rest-3: a wrapping row wraps at its container's paragraph line length (a dialog's wrap width) instead of widening a content-sized dialog; Page Setup's grid kinds take two lines as WordCraft's; trial 2026-11-19 14:16:43 +00:00
Martin Ball 8de74f788c look-rest-3: a control with its label after it in a grid cell takes the width of the two, not the grid's; check boxes stand two to a line in a two-column grid (the Font dialog's Effects); trial 2026-11-19 14:12:32 +00:00
Martin Ball 9e3d7bbc1f look-rest-2: WrapWidth::Column (size.dock.column) and Stack::wrap_width, a settings column beside a preview breaks its paragraphs instead of widening; trial and story 2026-11-19 13:55:17 +00:00
Martin BallandClaude Opus 5.5 e080fa2098 look-backstage: Sizing::FillHeight, a container as wide as its content and as tall as the room (a side menu beside a page), with its trial and story
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:31:11 +00:00
FredApps b04d18a735 Select UI suite items through explicit registries 2026-11-19 12:20:08 +01:00
aiongg bab1a99b85 Drop an unused import in the zero-width trials 2026-11-17 12:10:57 +00:00
aiongg 1a55c72e1e Grid: each column is a column group, so the labels beside the fields of one column share a width and the fields start at one x 2026-11-17 07:52:46 +00:00
aiongg 6c358f48d2 A container that scrolls one axis keeps an axis it was measured unbounded along unbounded for its children, so a row given no width never lays a child out in a NaN room 2026-11-17 05:24:50 +00:00
aiongg abddf29103 Row shrink step: a row that does not scroll drops its cut-first units from the end when they do not fit at their least 2026-11-13 17:57:00 +00:00
aiongg 5f0331fbff Row line: a one-line child sits on the row's line, a taller one at its top
A child placed on an unwrapped row's line reports how far below its top
the centre of its first line lies: half a control's height, a row body's
line, or a container's first child's first line (its header's, else its
body's), which its measuring run records. A child whose first line lies
at half its height is one line (a control, a row of one-line children, a
field with its label beside its control) and sits with its centre on the
row's line, so a side-labelled field holding smaller controls centres
them. A child of more than one line (a column, a field with its label
above or a help line below) sits at the row's top, as does one with no
line of its own (a collection whose rows run along Y), so columns beside
each other share their tops. The row's line is the lowest centre of its
one-line children, or of the line it shares with its container's inline
regions; the row records the line's centre and its height, and takes
that height in its measuring run.

Replaces the line/block split, where every container sat at the row's top.
2026-11-12 15:53:56 +00:00
aiongg 46061c8e44 A stack's header and footer are spaced from its body by the stack's gap
The header is the stack's first row and the footer its last, so the gap
between the stack's children also separates them from the body. A gap set
after the header or footer keeps them in step; footer_gap still sets the
footer's own.
2026-11-12 15:53:56 +00:00
aiongg b47165073c A short row gives blank room before content
A row's shrink step first takes its shortfall from the room its leaves hold
beyond their content (a field's or select's length past its text), down to
the width at which each shows its content whole. Only then does content give
way: units made to be cut first, then the rest. A row's children measured in
no room take what they would alone in the row, so a text after a field
reports its line, not what the field left it.

FindBar's count stays on one line beside the search field.
2026-11-12 14:32:51 +00:00
aiongg d85de0024d A content-sized body offers its children the body's width, not its end region's
The env's offered width, the room a body's children share, came from the
container's room or, in a content-sized real run, from what all its regions
took together, less only a side label's column. The end region beside the body
(a dialog's side buttons) and an inline header were left in, so a fill-width
child widened past the body region and its clip cut its end edge. The regions
record the width they give the regions beside the body on its line, and the body
offers what is left.
2026-11-12 14:32:50 +00:00
aiongg 8b364c53b7 MetadataTable: the search field sits in the header region of the table's Stack, inset at its sides only, so the first group starts under the field; the rows are text rows; Stack::header_inset sets a header's side padding 2026-11-12 14:32:50 +00:00
aiongg f21f832308 A stack shown at a rect is a given column: its fill children take the rect's width
A content-sized stack shown at a rect counted as a content column, so a
fill-width child in it was held at its measured width. Since collections
follow the content-column rule, TimelinePanel's track panes (each a
content stack at its split-area rect) measured their TrackStacks at the
header columns' width and showed no lanes, ruler or clips. A stack is a
content column only where its width comes from its content (!wide).
2026-11-12 14:32:48 +00:00
aiongg 13221fd697 Collections take their width from content where their column gives none, and honour their pad
A collection that fills the width (Fill or FillWidth) follows the rule a
container does: where the enclosing body does not give its width (sized
from content, or a content column), a measuring run takes the width from
its content (header least width, else its largest row, at least its
ideal_width) and the column holds it across the width it settles on. A
FillWidth TabStrip or list in a dialog's column no longer sets the
column to the screen's width. Env::gives_width names the rule for both.

Collections honour ContainerProps::pad as containers do: the items hook
reports it (ShapeHooks::pad), the pass carries it in Resolved::pad, and
step 5, the measure view's room and step 7's content rect read the
padding through steps::padding. The header, rows, scroll bar and empty
text sit inside it; the surface covers the whole rect. #[container]
forwards pad, so Panel's own copy goes.

The spelling, file list and glyph wells are a List or TileGrid with
surface(Sunken).pad(Control); RelinkDialog's table is FillWidth.
2026-11-12 14:32:48 +00:00
aiongg 2cd84ca3d1 A child that fills a content-height row's height spans its line
A leaf that fills its height in an unwrapped row whose height comes from its
content is held at its measured height in the row's measuring run and shown
across the line the row settles on (`row_line`), as a fill-width child of a
content column is held at its measured width and shown across the column. It
never sets the line, so a vertical divider spans the row beside its tallest
child. A row given its height already gives it; a wrapped row has no line, and
a container that fills keeps its capped content height.

The cross_fill trial shows the divider spanning the row, the row as tall as
its tallest child, a button keeping its height, and a settled frame measuring
nothing.
2026-11-12 14:32:48 +00:00
aiongg 9b22aa4e0f Fill propagates down a column whose width is given
A content-sized inline container shown in a `Stack` body given its width
passes that width on to its own body: its children measure and show as in
a given column, so a child that fills (a fill-width row, a list, a divider,
a picture, a side-labelled control) takes the width, and the container
takes what its content took. A content-sized mount (dialog, popover, menu),
a row, a grid or a held container stops it, so their bodies stay content
columns and measure as before.

The env carries the fact as `given_column`, set by a `Stack` body that is
not a content column and listed in the measure key's env facts. No pass,
record or measuring run is added.

Panel roots that set `fill_width()` only to span their pane now take the
default: CharacterControls, ParagraphControls, TimecodePanel,
ReorderableSections and BlendIfBar each hold a fill child, and where they
sit in a content column (BlendIfBar in the Layer Style page) the column
around them hugs them either way.

The fill_column trial shows the given column, nesting, a row stopping it,
the hug kept in a popover, and the measuring-run count against a
fill-width column.
2026-11-12 14:32:47 +00:00
aiongg b64714e088 Rows narrow content made to be cut first: an eliding Text or Link (Component::cut_first) gives its room before a select or button label is cut, and an eliding Link's least is the ellipsis 2026-11-12 14:32:47 +00:00
aiongg fcdd810bbc Text: a wrapping text is never narrower than its widest word, so a row breaks it between words, not inside one 2026-11-12 14:32:47 +00:00
aiongg ab33c9783b A child of a wrapping row measures in a whole line, as a body there already did: one too wide for the rest of the line goes on the next line at its own width instead of being cut to the rest, the same in either direction 2026-11-12 14:32:44 +00:00
aiongg 8c3715256c Pictures take the width they are given
`MeasureCx::picture_width`: a picture takes its column's room, between its
least and its most, and its least at `Proposal::Min`. CurveGraph's own rule
moves onto it. Band pictures (the point picker and the colour area, the
histogram, the vectorscope, the navigator preview, the preview pane, the
reading view) take the width at least `size.plot.width` and keep their
height; the colour wheel and disc are squares between `size.plot.height`
and `size.plot.width`.

ColorWheel, ScopePanel's plots and the ColorPicker area fill the card's
width as the old ones did.
2026-11-12 14:32:41 +00:00
aiongg 52e81f80ae Grid columns keep their least: a column that takes its room leaves the others theirs
A grid's measuring run measures each content column in the room the other
columns leave at their least. When the columns do not fit beside each other,
it asks every column for its least in a probe sweep (every leaf at its least,
no column bounded) and measures once more: a content column in the room the
others leave at their least, a fill column never below its least. Columns
whose leasts do not fit beside each other are laid out one under another
across the room, so no column is cut. The leasts and the stacked layout are
recorded for the real run.

A wrapped text's least is its widest word: a line breaks between words.

FontsPanelView's list column and ColorPicker Full's channel column no longer
collapse at card width.
2026-11-12 14:32:41 +00:00
aiongg 476602d4a3 A filling story's card is as tall as its content, and content taller than the room shares it
Along a height its parent sizes from its content, a container that fills takes its content height, at most the
room it is offered. When the content is taller, the measuring run is taken back and the container is laid out as
given the room, so its list and the bar under it share it; a record of the content height lets later runs and kept
transcripts lay it out the same. room_height only offers a finite room inside a scroll: a gallery card is as tall as
its story's content, at most the view, as the old gallery's tiles were.

layout_memory::draft runs a measuring run whose hand-forwards can be taken back once its result is seen: records,
kept transcripts, the open transcript's items, leaves and inputs, and each contribution (Contribution::undo for
column widths, label control minimums and reads). steps::id::draft takes the Auto id ordinals back with it. The
shrinking row's least probe is a draft taken back that reads nothing from outside.

A scrolling collection that fills keeps to its measured height in the real run under a body sized from its content,
so a footer under it stays below its rows. The PlacesTree story keeps the old 380 pt box.
2026-11-12 14:32:40 +00:00
aiongg a2676b8eac Framework UI crates: widgets, panels, canvas, patterns, shell and the craft-ui facade 2026-11-12 14:09:32 +00:00