Implement Selectable for ListItem and ListHeader

This commit is contained in:
Marshall Bowers
2023-11-30 13:26:12 -05:00
parent 865baaa1a1
commit e78538e162
8 changed files with 21 additions and 20 deletions
@@ -62,8 +62,10 @@ impl ListHeader {
self.meta = meta;
self
}
}
pub fn selected(mut self, selected: bool) -> Self {
impl Selectable for ListHeader {
fn selected(mut self, selected: bool) -> Self {
self.selected = selected;
self
}
+7 -5
View File
@@ -83,11 +83,6 @@ impl ListItem {
self
}
pub fn selected(mut self, selected: bool) -> Self {
self.selected = selected;
self
}
pub fn left_child(mut self, left_content: impl IntoElement) -> Self {
self.left_slot = Some(left_content.into_any_element());
self
@@ -109,6 +104,13 @@ impl ListItem {
}
}
impl Selectable for ListItem {
fn selected(mut self, selected: bool) -> Self {
self.selected = selected;
self
}
}
impl ParentElement for ListItem {
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement; 2]> {
&mut self.children
-2
View File
@@ -18,7 +18,6 @@ mod disableable;
mod fixed;
pub mod prelude;
mod selectable;
mod slot;
mod styled_ext;
mod styles;
pub mod utils;
@@ -29,6 +28,5 @@ pub use disableable::*;
pub use fixed::*;
pub use prelude::*;
pub use selectable::*;
pub use slot::*;
pub use styled_ext::*;
pub use styles::*;