pub struct HeaderLayout<'a> { /* private fields */ }Expand description
A collapsed block fold’s one-line display layout: the (inline-fold-
aware) header text, the … placeholder gap, then the fold’s real closing
tail — fn main() { … }. The single source for the placeholder render,
caret placement on the tail, selection washes, hit-testing, the hover-chip
rect, and the preview anchor, so they agree to the pixel by construction.
Implementations§
Source§impl<'a> HeaderLayout<'a>
impl<'a> HeaderLayout<'a>
Sourcepub fn head(&self) -> &RowLayout<'a>
pub fn head(&self) -> &RowLayout<'a>
The header row’s projection (for hits resolving to HeaderHit::Head).
Sourcepub fn head_cells(&self) -> u32
pub fn head_cells(&self) -> u32
Rendered display width of the header text — where the placeholder gap begins. Inline-fold aware: a collapsed inline fold before the block’s opener shrinks it.
Sourcepub fn gap_center(&self) -> f32
pub fn gap_center(&self) -> f32
The fractional cell at the center of the … gap, where the chip and
its … glyph both center.
Sourcepub fn tail_start_col(&self) -> u32
pub fn tail_start_col(&self) -> u32
Byte column on the last row where the visible tail starts.
Sourcepub fn tail_col_cell(&self, col: u32) -> Option<u32>
pub fn tail_col_cell(&self, col: u32) -> Option<u32>
Byte column on the last row → display cell on the header row, using
full-line tab stops (the caret/hit/selection convention). None for a
column in the leading whitespace before the visible tail.
Sourcepub fn tail_cells(&self) -> u32
pub fn tail_cells(&self) -> u32
The tail’s rendered width in cells.
Sourcepub fn width(&self) -> u32
pub fn width(&self) -> u32
The collapsed line’s total rendered width (head + gap + tail), in cells.
Sourcepub fn tail_glyphs(&self) -> impl Iterator<Item = TailGlyph> + '_
pub fn tail_glyphs(&self) -> impl Iterator<Item = TailGlyph> + '_
The visible tail glyphs at their header-row display cells.
Sourcepub fn hit(&self, cell: f32, bias: Bias) -> HeaderHit
pub fn hit(&self, cell: f32, bias: Bias) -> HeaderHit
Resolve a (fractional) display cell on the collapsed header line to the region it falls in, with the ±half-cell boundaries the hit-test has always used: at/after the tail (minus half a cell) → the tail column; past the header text (plus half a cell) → the gap; else the head.