rename Br to Break

This commit is contained in:
griffi-gh 2024-03-23 15:52:54 +01:00
parent 328f745c39
commit fa994e659a
3 changed files with 12 additions and 12 deletions

View file

@ -7,7 +7,7 @@ use hui::{
container::Container, container::Container,
text::Text, text::Text,
image::Image, image::Image,
br::Br, br::Break,
interactable::ElementInteractableExt, interactable::ElementInteractableExt,
UiElementExt, UiElementExt,
}, },
@ -44,7 +44,7 @@ ui_main!(
Text::new("Number of images:") Text::new("Number of images:")
.with_text_size(24) .with_text_size(24)
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
Container::default() Container::default()
.with_padding(10.) .with_padding(10.)
.with_background(color::ORANGE) .with_background(color::ORANGE)
@ -74,7 +74,7 @@ ui_main!(
}) })
.on_click(|| CounterSignal::Increment) .on_click(|| CounterSignal::Increment)
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
for _ in 0..*counter { for _ in 0..*counter {
Image::new(*image) Image::new(*image)
.with_size(size!(48, 48)) .with_size(size!(48, 48))

View file

@ -6,7 +6,7 @@ use hui::{
container::Container, container::Container,
text::Text, text::Text,
image::Image, image::Image,
br::Br, br::Break,
slider::Slider, slider::Slider,
UiElementExt, UiElementExt,
}, },
@ -43,22 +43,22 @@ ui_main!(
Text::new(format!("Number of images: {counter}")) Text::new(format!("Number of images: {counter}"))
.with_text_size(32) .with_text_size(32)
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
Text::new("Absolute tracking slider:") Text::new("Absolute tracking slider:")
.with_text_size(16) .with_text_size(16)
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
Slider::new(*counter as f32 / 100.) Slider::new(*counter as f32 / 100.)
.with_size(size!(66%, 20)) .with_size(size!(66%, 20))
.on_change(|x| { .on_change(|x| {
CounterSignal::ChangeValue((x * 100.).round() as u32) CounterSignal::ChangeValue((x * 100.).round() as u32)
}) })
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
Text::new("Relative tracking slider (Experimental):") Text::new("Relative tracking slider (Experimental):")
.with_text_size(16) .with_text_size(16)
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
Slider::new(*counter as f32 / 100.) Slider::new(*counter as f32 / 100.)
.with_size(size!(66%, 20)) .with_size(size!(66%, 20))
.with_follow_mode(hui::element::slider::SliderFollowMode::Relative) .with_follow_mode(hui::element::slider::SliderFollowMode::Relative)
@ -66,7 +66,7 @@ ui_main!(
CounterSignal::ChangeValue((x * 100.).round() as u32) CounterSignal::ChangeValue((x * 100.).round() as u32)
}) })
.add_child(ui); .add_child(ui);
Br.add_child(ui); Break.add_child(ui);
for _ in 0..*counter { for _ in 0..*counter {
Image::new(*image) Image::new(*image)
.with_size(size!(48, 48)) .with_size(size!(48, 48))

View file

@ -4,11 +4,11 @@ use crate::{
}; };
#[derive(Clone, Copy, Debug, Default)] #[derive(Clone, Copy, Debug, Default)]
pub struct Br; pub struct Break;
impl UiElement for Br { impl UiElement for Break {
fn name(&self) -> &'static str { fn name(&self) -> &'static str {
"Br" "Break"
} }
fn measure(&self, _: MeasureContext) -> Response { fn measure(&self, _: MeasureContext) -> Response {