guido 0.12.0

A reactive Rust GUI library using wgpu for Wayland layer shell widgets
Documentation
//! Test: 3-level nested transforms
//!
//! Run with: cargo run --example transform_test_3level

use guido::prelude::*;

fn main() {
    App::new().run(|app| {
        app.add_surface(
            SurfaceConfig::new()
                .height(180)
                .anchor(Anchor::TOP | Anchor::LEFT | Anchor::RIGHT)
                .background_color(Color::rgb(0.12, 0.12, 0.16)),
            move || {
                container()
                    .layout(
                        Flex::row()
                            .spacing(60.0)
                            .main_alignment(MainAlignment::Center),
                    )
                    .padding(30.0)
                    .children([
                        // Reference: no rotation at any level
                        three_level(0.0, 0.0, 0.0),
                        // Only grandparent rotates 20°
                        three_level(20.0, 0.0, 0.0),
                        // Each level rotates 10° (total 30°)
                        three_level(10.0, 10.0, 10.0),
                        // Grandparent 30°, others 0°
                        three_level(30.0, 0.0, 0.0),
                    ])
            },
        );
    });
}

fn three_level(gp_rot: f32, p_rot: f32, c_rot: f32) -> Container {
    container()
        .width(120.0)
        .height(120.0)
        .background(Color::rgb(0.25, 0.25, 0.35))
        .corners(12.0)
        .rotate(gp_rot)
        .padding(15.0)
        .child(
            container()
                .width(90.0)
                .height(90.0)
                .background(Color::rgb(0.45, 0.45, 0.55))
                .corners(10.0)
                .rotate(p_rot)
                .padding(12.0)
                .child(
                    container()
                        .width(50.0)
                        .height(50.0)
                        .background(Color::rgb(0.9, 0.6, 0.3))
                        .corners(6.0)
                        .rotate(c_rot),
                ),
        )
}