From b8f9ace3da4a9ff55c24b0ddcccd781b2b147099 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 24 Mar 2024 18:32:50 +0100 Subject: [PATCH] use the new macro in examples --- hui-examples/examples/ui_test.rs | 21 ++++++++++++--------- hui-examples/examples/ui_test_2_loading.rs | 16 ++++++++-------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/hui-examples/examples/ui_test.rs b/hui-examples/examples/ui_test.rs index f248ecc..f62e2f4 100644 --- a/hui-examples/examples/ui_test.rs +++ b/hui-examples/examples/ui_test.rs @@ -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.") diff --git a/hui-examples/examples/ui_test_2_loading.rs b/hui-examples/examples/ui_test_2_loading.rs index 73c911c..2af1cb5 100644 --- a/hui-examples/examples/ui_test_2_loading.rs +++ b/hui-examples/examples/ui_test_2_loading.rs @@ -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")