change name function to lower case

This commit is contained in:
griffi-gh 2024-03-23 15:54:33 +01:00
parent 1b3671a3bf
commit 98065f46af
11 changed files with 13 additions and 11 deletions

View file

@ -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\

View file

@ -8,7 +8,7 @@ pub struct Break;
impl UiElement for Break {
fn name(&self) -> &'static str {
"Break"
"break"
}
fn measure(&self, _: MeasureContext) -> Response {

View file

@ -133,7 +133,7 @@ impl Container {
impl UiElement for Container {
fn name(&self) -> &'static str {
"Container"
"container"
}
fn measure(&self, ctx: MeasureContext) -> Response {

View file

@ -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 {

View file

@ -51,7 +51,7 @@ impl Image {
impl UiElement for Image {
fn name(&self) -> &'static str {
"Image"
"image"
}
fn measure(&self, ctx: MeasureContext) -> Response {

View file

@ -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 {

View file

@ -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 {

View file

@ -103,7 +103,7 @@ impl Slider {
impl UiElement for Slider {
fn name(&self) -> &'static str {
"Slider"
"slider"
}
fn measure(&self, ctx: MeasureContext) -> Response {

View file

@ -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 {

View file

@ -71,7 +71,7 @@ impl Text {
impl UiElement for Text {
fn name(&self) -> &'static str {
"Text"
"text"
}
fn measure(&self, ctx: MeasureContext) -> Response {

View file

@ -38,7 +38,7 @@ impl Transformer {
impl UiElement for Transformer {
fn name(&self) -> &'static str {
"Transformer"
"transformer"
}
fn measure(&self, ctx: MeasureContext) -> Response {