Expand description
The Tab order of a focus scope: reading order by default, explicit indices and groups when the layout’s order is wrong.
- Reading order: rows from top to bottom, and in a row from left to right (in a right-to-left language, from right to left). Two stops share a row when the second’s vertical centre lies within the first’s height.
- Groups: the stops of a group follow each other, in reading order (or by their indices), at the place of the group’s first stop.
- Indices: stops with an explicit
indexcome first, by index (as HTML’s positivetabindex); the others follow in reading order. A group with indices takes its smallest. - Skipped: a stop that cannot take the focus (a disabled field) has no place in the order; a read-only one does.
use egui_pop_model::tab::{order, TabEntry};
// Two columns drawn column by column: reading order goes row by row.
let stops = [
TabEntry::at([0.0, 0.0, 100.0, 20.0]), // left, first row
TabEntry::at([0.0, 30.0, 100.0, 20.0]), // left, second row
TabEntry::at([120.0, 0.0, 100.0, 20.0]), // right, first row
];
assert_eq!(order(&stops, false), vec![0, 2, 1]);Structs§
- TabEntry
- One Tab stop as drawn.
Functions§
- next
- The stop after
currentinorder(before it whenback):Noneat either end unlesscycle, when it wraps round. Acurrentnot in the order goes to the first stop (the last whenback). - order
- The Tab order of a scope’s stops (indices into
entries, skipped ones left out); see the rules. - reading_
order - The stops in reading order (indices into
entries, skipped ones left out).rtlreads each row from right to left.