use gooey::value::Dynamic; use gooey::widget::MakeWidget; use gooey::widgets::input::InputValue; use gooey::widgets::slider::Slidable; use gooey::widgets::{Checkbox, Custom}; use gooey::Run; use kludgine::figures::units::Lp; fn main() -> gooey::Result { let allow_blur = Dynamic::new(true); "Input Field" .and(Dynamic::::default().into_input()) .and("Range Slider") .and(Dynamic::::default().slider_between(0_u8, 100_u8)) .and("Range Slider") .and(Dynamic::new(10..=30).slider_between(0_u8, 100_u8)) .and(Checkbox::new( allow_blur.clone(), "Allow Custom Widget to Lose Focus", )) .and( Custom::empty() .on_accept_focus(|_| true) .on_redraw(|context| { context.fill(context.theme().secondary.color); if context.focused() { context.draw_focus_ring(); } }) .on_allow_blur(move |_| allow_blur.get()) .height(Lp::inches(1)), ) .into_rows() .run() }