From 5ce9dda77be10a2c95296302eb201353e1bd5157 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sat, 23 Mar 2024 15:54:33 +0100 Subject: [PATCH] change name function to lower case --- hui/src/element.rs | 4 +++- hui/src/element/builtin/br.rs | 2 +- hui/src/element/builtin/container.rs | 2 +- hui/src/element/builtin/fill_rect.rs | 2 +- hui/src/element/builtin/image.rs | 2 +- hui/src/element/builtin/interactable.rs | 2 +- hui/src/element/builtin/progress_bar.rs | 2 +- hui/src/element/builtin/slider.rs | 2 +- hui/src/element/builtin/spacer.rs | 2 +- hui/src/element/builtin/text.rs | 2 +- hui/src/element/builtin/transformer.rs | 2 +- 11 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hui/src/element.rs b/hui/src/element.rs index 4f4ac52..e245610 100644 --- a/hui/src/element.rs +++ b/hui/src/element.rs @@ -40,7 +40,9 @@ pub struct ProcessContext<'a> { } pub trait UiElement { - /// Get the name of the element, for example "Button" or "ProgressBar" + /// Get the name of the element (in lower case) + /// + /// For example, "button" or "progress_bar" fn name(&self) -> &'static str; /// Get the unique id used for internal state management\ diff --git a/hui/src/element/builtin/br.rs b/hui/src/element/builtin/br.rs index e50dc4b..8270aed 100644 --- a/hui/src/element/builtin/br.rs +++ b/hui/src/element/builtin/br.rs @@ -8,7 +8,7 @@ pub struct Break; impl UiElement for Break { fn name(&self) -> &'static str { - "Break" + "break" } fn measure(&self, _: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/container.rs b/hui/src/element/builtin/container.rs index beb13ee..e8488ad 100644 --- a/hui/src/element/builtin/container.rs +++ b/hui/src/element/builtin/container.rs @@ -133,7 +133,7 @@ impl Container { impl UiElement for Container { fn name(&self) -> &'static str { - "Container" + "container" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/fill_rect.rs b/hui/src/element/builtin/fill_rect.rs index d93b0da..7d397aa 100644 --- a/hui/src/element/builtin/fill_rect.rs +++ b/hui/src/element/builtin/fill_rect.rs @@ -40,7 +40,7 @@ impl Default for FillRect { impl UiElement for FillRect { fn name(&self) -> &'static str { - "FillRect" + "fill_rect" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/image.rs b/hui/src/element/builtin/image.rs index 12c6744..f46e193 100644 --- a/hui/src/element/builtin/image.rs +++ b/hui/src/element/builtin/image.rs @@ -51,7 +51,7 @@ impl Image { impl UiElement for Image { fn name(&self) -> &'static str { - "Image" + "image" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/interactable.rs b/hui/src/element/builtin/interactable.rs index 4ae7f14..c15de60 100644 --- a/hui/src/element/builtin/interactable.rs +++ b/hui/src/element/builtin/interactable.rs @@ -45,7 +45,7 @@ impl Interactable { impl UiElement for Interactable { fn name(&self) -> &'static str { - "Interactable" + "interactable" } fn measure(&self, ctx: MeasureContext) -> crate::measure::Response { diff --git a/hui/src/element/builtin/progress_bar.rs b/hui/src/element/builtin/progress_bar.rs index 6c56a52..c0fd72b 100644 --- a/hui/src/element/builtin/progress_bar.rs +++ b/hui/src/element/builtin/progress_bar.rs @@ -49,7 +49,7 @@ impl Default for ProgressBar { impl UiElement for ProgressBar { fn name(&self) -> &'static str { - "ProgressBar" + "progress_bar" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/slider.rs b/hui/src/element/builtin/slider.rs index 5eb6d2d..e0ec161 100644 --- a/hui/src/element/builtin/slider.rs +++ b/hui/src/element/builtin/slider.rs @@ -103,7 +103,7 @@ impl Slider { impl UiElement for Slider { fn name(&self) -> &'static str { - "Slider" + "slider" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/spacer.rs b/hui/src/element/builtin/spacer.rs index 1a12b6a..f81cc92 100644 --- a/hui/src/element/builtin/spacer.rs +++ b/hui/src/element/builtin/spacer.rs @@ -19,7 +19,7 @@ impl Default for Spacer { impl UiElement for Spacer { fn name(&self) -> &'static str { - "Spacer" + "spacer" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/text.rs b/hui/src/element/builtin/text.rs index 66bac10..fdc6734 100644 --- a/hui/src/element/builtin/text.rs +++ b/hui/src/element/builtin/text.rs @@ -71,7 +71,7 @@ impl Text { impl UiElement for Text { fn name(&self) -> &'static str { - "Text" + "text" } fn measure(&self, ctx: MeasureContext) -> Response { diff --git a/hui/src/element/builtin/transformer.rs b/hui/src/element/builtin/transformer.rs index f04812b..0467ae0 100644 --- a/hui/src/element/builtin/transformer.rs +++ b/hui/src/element/builtin/transformer.rs @@ -38,7 +38,7 @@ impl Transformer { impl UiElement for Transformer { fn name(&self) -> &'static str { - "Transformer" + "transformer" } fn measure(&self, ctx: MeasureContext) -> Response {