Skip to main content

Module tab

Module tab 

Source
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 index come first, by index (as HTML’s positive tabindex); 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 current in order (before it when back): None at either end unless cycle, when it wraps round. A current not in the order goes to the first stop (the last when back).
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). rtl reads each row from right to left.