Skip to main content

euv_ui/component/descriptions/view/
struct.rs

1use super::*;
2
3/// One entry of the [`euv_descriptions`] grid.
4///
5/// A description is a label and the value it describes. The pair is
6/// rendered as a label line over a value line, so a grid cell reads the
7/// same way whether it sits alone or beside its neighbours.
8#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
9pub struct EuvDescriptionsItem {
10    /// The field name rendered in `c_euv_descriptions_label`.
11    #[get(type(copy))]
12    pub label: &'static str,
13    /// The field value rendered in `c_euv_descriptions_value`.
14    #[get(type(copy))]
15    pub value: &'static str,
16}
17
18/// Props for the [`euv_descriptions`] component.
19///
20/// Defines the strongly-typed interface for a key/value detail grid. The
21/// entries are laid out in source order and flow across the grid row by
22/// row, so the column count decides how many entries share a row.
23#[derive(Clone, CustomDebug, Default)]
24pub struct EuvDescriptionsProps {
25    /// The label/value pairs to render; an empty list renders an empty grid.
26    pub items: Vec<EuvDescriptionsItem>,
27    /// The number of grid columns; a count of zero falls back to one column.
28    pub columns: usize,
29}