cleanup elements #13

This commit is contained in:
2025-08-01 19:24:39 -05:00
parent bbff192788
commit 75827260cc
4 changed files with 29 additions and 90 deletions
+20 -20
View File
@@ -17,6 +17,26 @@ pub struct FlexCol {
size: (u16, u16),
}
impl FlexRow {
pub fn new(gap: u16) -> Self {
Self {
children: Mutex::new(Vec::new()),
size: (0, 0),
gap,
}
}
}
impl FlexCol {
pub fn new(gap: u16) -> Self {
Self {
children: Mutex::new(Vec::new()),
size: (0, 0),
gap,
}
}
}
impl Element for FlexRow {
fn render(&mut self, scope: &mut crate::render_scope::RenderScope) {
let (width, height) = scope.get_size_or(self.size.0, self.size.1);
@@ -73,16 +93,6 @@ impl Element for FlexRow {
}
}
impl FlexRow {
pub fn new(gap: u16) -> Self {
Self {
children: Mutex::new(Vec::new()),
size: (0, 0),
gap,
}
}
}
impl Element for FlexCol {
fn render(&mut self, scope: &mut crate::render_scope::RenderScope) {
let (width, height) = scope.get_size_or(self.size.0, self.size.1);
@@ -138,13 +148,3 @@ impl Element for FlexCol {
self
}
}
impl FlexCol {
pub fn new(gap: u16) -> Self {
Self {
children: Mutex::new(Vec::new()),
size: (0, 0),
gap,
}
}
}