cushy/examples/style.rs
2023-11-09 14:54:41 -08:00

17 lines
501 B
Rust

use gooey::styles::components::TextColor;
use gooey::widget::MakeWidget;
use gooey::widgets::stack::Stack;
use gooey::widgets::{Button, Style};
use gooey::Run;
use kludgine::Color;
fn main() -> gooey::Result {
Stack::rows(Button::new("Green").and(red_text(Button::new("Red"))))
.with(&TextColor, Color::GREEN)
.run()
}
/// Creating reusable style helpers that work with any Widget is straightfoward
fn red_text(w: impl MakeWidget) -> Style {
w.with(&TextColor, Color::RED)
}