From 350c00c52ae60d4025b9065639d653bbbfd4689b Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Wed, 27 Dec 2023 18:26:20 -0800 Subject: [PATCH] Rename text_alignment --- src/elements.rs | 3 ++- src/hot_reload.rs | 2 +- src/parse_attributes.rs | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/elements.rs b/src/elements.rs index 5753e8f..52e721b 100644 --- a/src/elements.rs +++ b/src/elements.rs @@ -88,7 +88,8 @@ pub mod dioxus_elements { pub const NAME_SPACE: Option<&'static str> = NAME_SPACE; pub const text: AttributeDescription = ("text", None, false); pub const text_direction: AttributeDescription = ("text_direction", None, false); - pub const text_alignment: AttributeDescription = ("text_alignment", None, false); + pub const text_multiline_alignment: AttributeDescription = + ("text_multiline_alignment", None, false); pub const text_size: AttributeDescription = ("text_size", None, false); pub const text_color: AttributeDescription = ("text_color", None, false); node_attributes!(); diff --git a/src/hot_reload.rs b/src/hot_reload.rs index 0f22fa9..3b44e5f 100644 --- a/src/hot_reload.rs +++ b/src/hot_reload.rs @@ -34,7 +34,7 @@ impl HotReloadingContext for HotReloadContext { let attribute = match attribute_name_rust { "text" => Some(("text", None)), "text_direction" => Some(("text_direction", None)), - "text_alignment" => Some(("text_alignment", None)), + "text_multiline_alignment" => Some(("text_multiline_alignment", None)), "text_size" => Some(("text_size", None)), "text_color" => Some(("text_color", None)), _ => None, diff --git a/src/parse_attributes.rs b/src/parse_attributes.rs index a213faf..58b7ff4 100644 --- a/src/parse_attributes.rs +++ b/src/parse_attributes.rs @@ -186,13 +186,13 @@ pub fn set_attribute( ("text_direction", "right_to_left") if text.is_some() => { style.direction = Direction::RightToLeft; } - ("text_alignment", "left") if text.is_some() => { + ("text_multiline_alignment", "left") if text.is_some() => { text.unwrap().alignment = TextAlignment::Left; } - ("text_alignment", "center") if text.is_some() => { + ("text_multiline_alignment", "center") if text.is_some() => { text.unwrap().alignment = TextAlignment::Center; } - ("text_alignment", "right") if text.is_some() => { + ("text_multiline_alignment", "right") if text.is_some() => { text.unwrap().alignment = TextAlignment::Right; } ("text_size", value) if text.is_some() => {