make TUI widgets cross framework

This commit is contained in:
Evan Almloff committed 2023-03-24 12:43:51 -05:00
1 parent 9a16687bdc
commit 625dc662d2
32 files changed
+3023 -1091

No files matched your search

+26 -1
View File
@@ -126,7 +126,7 @@ impl AttributeMask {
pub fn union(&self, other: &Self) -> Self {
match (self, other) {
(AttributeMask::Some(s), AttributeMask::Some(o)) => {
AttributeMask::Some(s.intersection(o).cloned().collect())
AttributeMask::Some(s.union(o).cloned().collect())
}
_ => AttributeMask::All,
}
@@ -187,25 +187,50 @@ impl NodeMask {
self.attritutes = self.attritutes.union(&attributes);
}
/// Get the mask for the attributes
pub fn attributes(&self) -> &AttributeMask {
&self.attritutes
}
/// Set the mask to view the tag
pub fn set_tag(&mut self) {
self.tag = true;
}
/// Get the mask for the tag
pub fn tag(&self) -> bool {
self.tag
}
/// Set the mask to view the namespace
pub fn set_namespace(&mut self) {
self.namespace = true;
}
/// Get the mask for the namespace
pub fn namespace(&self) -> bool {
self.namespace
}
/// Set the mask to view the text
pub fn set_text(&mut self) {
self.text = true;
}
/// Get the mask for the text
pub fn text(&self) -> bool {
self.text
}
/// Set the mask to view the listeners
pub fn set_listeners(&mut self) {
self.listeners = true;
}
/// Get the mask for the listeners
pub fn listeners(&self) -> bool {
self.listeners
}
}
/// A builder for a mask that controls what attributes are visible.