Expand description
Line breaking and per-message layout.
Produces a LayoutCache for one message at one width: its total
pixel height and the line boxes needed for hit-testing. This is where
both layouts live: two columns, with the timestamp and nick gutter on
the left and the body indented past it, and one, with the nick at the
start of the body’s first line.
Measurement goes through TextMeasure, one call per run, never
per character. xtext’s find_next_wrap (xtext.c:3685) measured
character by character through a full Pango layout round trip each
time; that is the single hottest thing in its append path and the
reason a resize of a large buffer visibly hitches.
Structs§
- Avatar
Box - A square avatar slot in the gutter, in row-local coordinates.
- Layout
Cache - What a laid-out message knows about itself.
- Layout
Generation - Identifies the conditions a
LayoutCachewas computed under. - Layout
Params - Geometry knobs, supplied by the view.
- LineBox
- One visual line within a message.
Enums§
- Line
Source - What a
LineBoxdraws text from.
Functions§
- estimate_
height - Rough height for a row that has never been laid out.
- is_
muted - Whether a message draws in the muted secondary colour.
- layout_
message - Lay one message out.
- spans_
in - Spans of
pclipped torange, for the view’s snapshot pass.