summaryrefslogtreecommitdiff
path: root/src/types/element_name.rs
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-11-15 12:33:22 +0100
committerPolesznyák Márk <contact@pml68.dev>2025-11-15 12:33:22 +0100
commite67680b0030a890d75ed35bc1144d1e8880dd3be (patch)
treec465299e27a7af8a6c53d435b8301100702ef3be /src/types/element_name.rs
parentchore: update deps (diff)
downloadiced-builder-e67680b0030a890d75ed35bc1144d1e8880dd3be.tar.gz
feat: add `Grid` as a usable widget
Diffstat (limited to 'src/types/element_name.rs')
-rw-r--r--src/types/element_name.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/types/element_name.rs b/src/types/element_name.rs
index c824fc5..8f8ab7e 100644
--- a/src/types/element_name.rs
+++ b/src/types/element_name.rs
@@ -1,7 +1,8 @@
use serde::{Deserialize, Serialize};
use super::rendered_element::{
- Action, RenderedElement, button, column, container, image, row, svg, text,
+ Action, RenderedElement, button, column, container, grid, image, row, svg,
+ text,
};
use crate::Error;
@@ -14,10 +15,11 @@ pub enum ElementName {
Container,
Row,
Column,
+ Grid,
}
impl ElementName {
- pub const ALL: &'static [Self; 7] = &[
+ pub const ALL: &'static [Self; 8] = &[
Self::Text(String::new()),
Self::Button(String::new()),
Self::Svg(String::new()),
@@ -25,6 +27,7 @@ impl ElementName {
Self::Container,
Self::Row,
Self::Column,
+ Self::Grid,
];
pub fn handle_action(
@@ -40,6 +43,7 @@ impl ElementName {
Self::Container => container(None),
Self::Row => row(vec![]),
Self::Column => column(vec![]),
+ Self::Grid => grid(vec![]),
};
match action {
Action::Stop | Action::Drop => Ok(None),
@@ -79,6 +83,7 @@ impl std::fmt::Display for ElementName {
Self::Container => "Container",
Self::Row => "Row",
Self::Column => "Column",
+ Self::Grid => "Grid",
}
)
}