max / alloy_tui
| 1 | //! Selection chrome: the marker glyph and the selected-row style. |
| 2 | //! |
| 3 | //! Ported from sysop-tui's `selection.rs`, retinted from the theme. The marker |
| 4 | //! stays a plain triangle rather than a Nerd Font glyph so selection survives |
| 5 | //! a console without the patched font — the TTY before the session starts, a |
| 6 | //! remote shell, `alloy` over SSH. Per docs/ICONOGRAPHY.md, Nerd Font glyphs |
| 7 | //! decorate; they never carry state on their own. |
| 8 | |
| 9 | use ; |
| 10 | |
| 11 | use crateTheme; |
| 12 | |
| 13 | /// The selected-row marker. Rendered in the gutter, one cell plus a space. |
| 14 | pub const MARKER: &str = "▶"; |
| 15 | |
| 16 | /// Blank gutter for unselected rows — the same width as [`MARKER`], so rows do |
| 17 | /// not shift horizontally as selection moves. |
| 18 | pub const MARKER_BLANK: &str = " "; |
| 19 | |
| 20 | /// Style for the selected row. |
| 21 | /// |
| 22 | /// Uses `surface.raised` as the selection field rather than an accent fill: |
| 23 | /// DESIGN-LANGUAGE.md keeps color off chrome, so selection reads as a *raised* |
| 24 | /// surface plus weight, and any `Severity` color already on the row survives |
| 25 | /// unchanged instead of being drowned by an accent background. |
| 26 | |
| 27 | default |
| 28 | .bg |
| 29 | .fg |
| 30 | .add_modifier |
| 31 | |
| 32 | |
| 33 | /// Style for an unselected row. |
| 34 | |
| 35 | default.fg |
| 36 | |
| 37 |