use derive macro in examples

This commit is contained in:
griffi-gh 2024-03-25 17:51:34 +01:00
parent 72ff23ac0b
commit 4e4c16ce76
3 changed files with 6 additions and 8 deletions

View file

@ -1,7 +1,6 @@
use hui::{ use hui::{
color, size, color, size, Signal,
draw::TextureFormat, draw::TextureFormat,
signal::Signal,
layout::{Alignment, Direction}, layout::{Alignment, Direction},
element::{ element::{
container::Container, container::Container,
@ -13,11 +12,11 @@ use hui::{
}, },
}; };
#[derive(Signal)]
enum CounterSignal { enum CounterSignal {
Increment, Increment,
Decrement, Decrement,
} }
impl Signal for CounterSignal {}
#[path = "../boilerplate.rs"] #[path = "../boilerplate.rs"]
#[macro_use] #[macro_use]

View file

@ -9,14 +9,13 @@ use hui::{
UiElementExt, UiElementExt,
}, },
layout::{Alignment, Direction}, layout::{Alignment, Direction},
signal::Signal, size, Signal,
size,
}; };
#[derive(Signal)]
enum CounterSignal { enum CounterSignal {
ChangeValue(u32) ChangeValue(u32)
} }
impl Signal for CounterSignal {}
#[path = "../boilerplate.rs"] #[path = "../boilerplate.rs"]
#[macro_use] #[macro_use]

View file

@ -11,7 +11,7 @@ use hui::{
frame::nine_patch::{NinePatchAsset, NinePatchFrame}, frame::nine_patch::{NinePatchAsset, NinePatchFrame},
layout::Alignment, layout::Alignment,
rect::Rect, rect::Rect,
signal::Signal, Signal,
size, size,
}; };
@ -19,8 +19,8 @@ use hui::{
#[macro_use] #[macro_use]
mod boilerplate; mod boilerplate;
#[derive(Signal)]
struct SetValue(f32); struct SetValue(f32);
impl Signal for SetValue {}
ui_main!( ui_main!(
"hUI: 9-Patch demo", "hUI: 9-Patch demo",