summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-06-08 12:30:10 +0200
committerMartin Haug <mhaug@live.de>2022-06-08 12:30:10 +0200
commit6d8b65c4b24206a1482ea143791d7a1c410a4313 (patch)
treee11046d9b92928969b904a63cc6f59540b95d0a7 /src/model
parent4640585fbdf72df993dbed46799844aa78996cce (diff)
More consistent role application
Diffstat (limited to 'src/model')
-rw-r--r--src/model/content.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/model/content.rs b/src/model/content.rs
index 21bf8369..2b9eb182 100644
--- a/src/model/content.rs
+++ b/src/model/content.rs
@@ -204,6 +204,11 @@ impl Content {
Self::Styled(Arc::new((self, styles)))
}
+ /// Assign a role to this content by adding a style map.
+ pub fn role(self, role: Role) -> Self {
+ self.styled_with_map(StyleMap::with_role(role))
+ }
+
/// Reenable the show rule identified by the selector.
pub fn unguard(&self, sel: Selector) -> Self {
self.clone().styled_with_entry(StyleEntry::Unguard(sel))