From 4e4c16ce76dd0d0cec29b936375264f161fa6db9 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Mon, 25 Mar 2024 17:51:34 +0100 Subject: [PATCH] use derive macro in examples --- hui-examples/examples/ui_test_5_input.rs | 5 ++--- hui-examples/examples/ui_test_6_slider.rs | 5 ++--- hui-examples/examples/ui_test_7_9patch.rs | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hui-examples/examples/ui_test_5_input.rs b/hui-examples/examples/ui_test_5_input.rs index ab02977..5e1ae0c 100644 --- a/hui-examples/examples/ui_test_5_input.rs +++ b/hui-examples/examples/ui_test_5_input.rs @@ -1,7 +1,6 @@ use hui::{ - color, size, + color, size, Signal, draw::TextureFormat, - signal::Signal, layout::{Alignment, Direction}, element::{ container::Container, @@ -13,11 +12,11 @@ use hui::{ }, }; +#[derive(Signal)] enum CounterSignal { Increment, Decrement, } -impl Signal for CounterSignal {} #[path = "../boilerplate.rs"] #[macro_use] diff --git a/hui-examples/examples/ui_test_6_slider.rs b/hui-examples/examples/ui_test_6_slider.rs index 5422eb6..c0555eb 100644 --- a/hui-examples/examples/ui_test_6_slider.rs +++ b/hui-examples/examples/ui_test_6_slider.rs @@ -9,14 +9,13 @@ use hui::{ UiElementExt, }, layout::{Alignment, Direction}, - signal::Signal, - size, + size, Signal, }; +#[derive(Signal)] enum CounterSignal { ChangeValue(u32) } -impl Signal for CounterSignal {} #[path = "../boilerplate.rs"] #[macro_use] diff --git a/hui-examples/examples/ui_test_7_9patch.rs b/hui-examples/examples/ui_test_7_9patch.rs index ee69cd8..16062d3 100644 --- a/hui-examples/examples/ui_test_7_9patch.rs +++ b/hui-examples/examples/ui_test_7_9patch.rs @@ -11,7 +11,7 @@ use hui::{ frame::nine_patch::{NinePatchAsset, NinePatchFrame}, layout::Alignment, rect::Rect, - signal::Signal, + Signal, size, }; @@ -19,8 +19,8 @@ use hui::{ #[macro_use] mod boilerplate; +#[derive(Signal)] struct SetValue(f32); -impl Signal for SetValue {} ui_main!( "hUI: 9-Patch demo",