diff options
| author | Martin Haug <mhaug@live.de> | 2022-06-04 12:57:45 +0200 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-06-04 12:57:45 +0200 |
| commit | 4640585fbdf72df993dbed46799844aa78996cce (patch) | |
| tree | 38a09389885a61068970441d6d27178a2ae4f115 /src/library/structure/table.rs | |
| parent | a937462491a63f5cff3551b5bb8bc45fb350f0b6 (diff) | |
First iteration of outline items
Diffstat (limited to 'src/library/structure/table.rs')
| -rw-r--r-- | src/library/structure/table.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs index cd70db30..60115612 100644 --- a/src/library/structure/table.rs +++ b/src/library/structure/table.rs @@ -1,5 +1,6 @@ -use crate::library::layout::{BlockSpacing, GridNode, TrackSizing}; +use crate::library::layout::{BlockSpacing, GridNode, GridSemantics, TrackSizing}; use crate::library::prelude::*; +use crate::model::StyleEntry; /// A table of items. #[derive(Debug, Hash)] @@ -49,10 +50,17 @@ impl TableNode { impl Show for TableNode { fn unguard(&self, sel: Selector) -> ShowNode { + let mut map = StyleMap::with_role(Role::TableCell); + map.push(StyleEntry::Unguard(sel)); + Self { tracks: self.tracks.clone(), gutter: self.gutter.clone(), - cells: self.cells.iter().map(|cell| cell.unguard(sel)).collect(), + cells: self + .cells + .iter() + .map(|cell| cell.clone().styled_with_map(map.clone())) + .collect(), } .pack() } @@ -100,7 +108,9 @@ impl Show for TableNode { tracks: self.tracks.clone(), gutter: self.gutter.clone(), cells, - })) + semantic: GridSemantics::Table, + }) + .styled_with_map(StyleMap::with_role(Role::Table))) } fn finalize( |
