From d9d3001d5eb5c6c012d3e48c5559295cf78c094d Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:27:45 -0800 Subject: [PATCH] More style work --- src/elements.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/elements.rs b/src/elements.rs index 786de60..b71fdcb 100644 --- a/src/elements.rs +++ b/src/elements.rs @@ -2,26 +2,30 @@ pub mod dioxus_elements { pub use crate::events::events; + const NAME_SPACE: Option<&'static str> = Some("bevy_ui"); pub type AttributeDescription = (&'static str, Option<&'static str>, bool); pub struct node; impl node { pub const TAG_NAME: &'static str = "node"; - pub const NAME_SPACE: Option<&'static str> = Some("bevy_ui"); + pub const NAME_SPACE: Option<&'static str> = NAME_SPACE; // TODO: The rest of Style + pub const display: AttributeDescription = ("display", None, false); + pub const position: AttributeDescription = ("position", None, false); + pub const flex_direction: AttributeDescription = ("flex-direction", None, false); + pub const background_color: AttributeDescription = ("background-color", None, false); + pub const padding: AttributeDescription = ("padding", None, false); pub const width: AttributeDescription = ("width", None, false); pub const height: AttributeDescription = ("height", None, false); pub const justify_content: AttributeDescription = ("justify-content", None, false); - pub const flex_direction: AttributeDescription = ("flex-direction", None, false); - pub const padding: AttributeDescription = ("padding", None, false); - pub const background_color: AttributeDescription = ("background-color", None, false); + pub const align_content: AttributeDescription = ("align-content", None, false); } pub struct text; impl text { pub const TAG_NAME: &'static str = "text"; - pub const NAME_SPACE: Option<&'static str> = Some("bevy_ui"); + pub const NAME_SPACE: Option<&'static str> = NAME_SPACE; pub const text: AttributeDescription = ("text", None, false); pub const text_alignment: AttributeDescription = ("text-alignment", None, false); @@ -29,11 +33,14 @@ pub mod dioxus_elements { pub const font_color: AttributeDescription = ("font-color", None, false); // TODO: The rest of Style // TODO: Reduce duplication + pub const display: AttributeDescription = ("display", None, false); + pub const position: AttributeDescription = ("position", None, false); + pub const flex_direction: AttributeDescription = ("flex-direction", None, false); + pub const background_color: AttributeDescription = ("background-color", None, false); + pub const padding: AttributeDescription = ("padding", None, false); pub const width: AttributeDescription = ("width", None, false); pub const height: AttributeDescription = ("height", None, false); pub const justify_content: AttributeDescription = ("justify-content", None, false); - pub const flex_direction: AttributeDescription = ("flex-direction", None, false); - pub const padding: AttributeDescription = ("padding", None, false); - pub const background_color: AttributeDescription = ("background-color", None, false); + pub const align_content: AttributeDescription = ("align-content", None, false); } }