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

View file

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

View file

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