use appy::{components::*, hooks::*, types::*, *}; use std::rc::Rc; #[derive_component(ComponentBuilder, Default, SnakeFactory)] pub struct FlowButton { text: String, on_click: Option>, } #[function_component] fn _flow_button(p: FlowButton) -> Elements { let hover_state = use_hover_state_ref(); let app_context = use_context::(); let w = app_context.default_font.get_str_width(&*p.text, 24.0); let c = match *hover_state { HoverState::Normal => 0x808080, HoverState::Active => 0x404040, HoverState::Hover => 0xa0a0a0, }; apx! { } } #[main_window] fn main() -> Elements { let img_src = use_state(|| ImageSource::from_memory(include_bytes!("rustacean.png"))); let scale_mode = use_state(|| ScaleMode::Fit); let align = use_state(|| Align::Center); let valign = use_state(|| VAlign::Middle); apx! { } }