mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-21 22:58:42 -06:00
use derive macro in examples
This commit is contained in:
parent
72ff23ac0b
commit
4e4c16ce76
|
@ -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]
|
||||||
|
|
|
@ -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]
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue