mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-12-22 12:28:19 -06:00
use the new macro in examples
This commit is contained in:
parent
2a4af1aa35
commit
b8f9ace3da
|
@ -1,5 +1,8 @@
|
|||
use hui::{
|
||||
color, element::{container::Container, text::Text, UiElementExt}, frame::FrameRect, layout::Alignment, size
|
||||
color, size, frame_rect,
|
||||
element::{container::Container, text::Text, UiElementExt},
|
||||
frame::FrameRect,
|
||||
layout::Alignment,
|
||||
};
|
||||
|
||||
#[path = "../boilerplate.rs"]
|
||||
|
@ -12,10 +15,10 @@ ui_main!(|ui, size, _| {
|
|||
.with_align(Alignment::Center)
|
||||
.with_padding(5.)
|
||||
.with_gap(10.)
|
||||
.with_background(
|
||||
FrameRect::color(color::WHITE)
|
||||
.with_corner_radius(10.)
|
||||
)
|
||||
.with_background(frame_rect! {
|
||||
color: (0.5, 0.5, 0.5, 1.),
|
||||
corner_radius: 10.,
|
||||
})
|
||||
.with_children(|ui| {
|
||||
Text::default()
|
||||
.with_text("Hello, world")
|
||||
|
@ -24,10 +27,10 @@ ui_main!(|ui, size, _| {
|
|||
.add_child(ui);
|
||||
Container::default()
|
||||
.with_padding((10., 20.))
|
||||
.with_background(
|
||||
FrameRect::color(color::DARK_RED)
|
||||
.with_corner_radius((2.5, 30., 2.5, 2.5))
|
||||
)
|
||||
.with_background(frame_rect! {
|
||||
color: color::DARK_RED,
|
||||
corner_radius: (2.5, 30., 2.5, 2.5),
|
||||
})
|
||||
.with_children(|ui| {
|
||||
Text::default()
|
||||
.with_text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
|
||||
|
|
|
@ -45,10 +45,10 @@ ui_main!(
|
|||
.with_children(|ui| {
|
||||
Container::default()
|
||||
.with_padding((10., 15.))
|
||||
.with_background(
|
||||
FrameRect::color((0., 0., 0., 0.5))
|
||||
.with_corner_radius(8.)
|
||||
)
|
||||
.with_background(frame_rect! {
|
||||
color: (0., 0., 0., 0.5),
|
||||
corner_radius: 8.,
|
||||
})
|
||||
.with_children(|ui| {
|
||||
let flash = 1. - 0.5 * (4. * instant.elapsed().as_secs_f32()).sin().powi(2);
|
||||
Text::default()
|
||||
|
@ -111,10 +111,10 @@ ui_main!(
|
|||
.with_children(|ui| {
|
||||
Container::default()
|
||||
.with_padding(10.)
|
||||
.with_background(
|
||||
FrameRect::color((0., 0., 0., 0.5))
|
||||
.with_corner_radius(8.)
|
||||
)
|
||||
.with_background(frame_rect!{
|
||||
color: (0., 0., 0., 0.5),
|
||||
corner_radius: 8.,
|
||||
})
|
||||
.with_children(|ui| {
|
||||
Text::default()
|
||||
.with_text("Level 5")
|
||||
|
|
Loading…
Reference in a new issue