BREP_app 0.1.0

The BREP CAD application: an eframe (egui + wgpu) host that draws the brep-render 3D engine into an egui frame — native + wasm from one codebase.
Documentation
//! The SINGLE source of truth for toolbar-button styling — shared by the main
//! toolbar (`toolbar.rs`), the context bar (`context_bar.rs`), and the 2D sketcher
//! toolbar (`sketch.rs`). Every toolbar button goes through here, so sizing/style
//! changes land in ONE place. Buttons show a single UNICODE GLYPH (the same glyphs
//! the retiring UI used) with the human label in the hover TOOLTIP, and
//! are SQUARE (min-width == height) for single-glyph buttons.
use eframe::egui;

/// Square edge length of a single-glyph toolbar button (min-width == height).
pub const TOOLBAR_BTN: f32 = 28.0;

fn square() -> egui::Vec2 {
    egui::vec2(TOOLBAR_BTN, TOOLBAR_BTN)
}

/// A plain action toolbar button: `glyph` shown, `tooltip` on hover. Square.
pub fn button(ui: &mut egui::Ui, glyph: &str, tooltip: &str) -> egui::Response {
    ui.add(egui::Button::new(glyph).min_size(square()))
        .on_hover_text(tooltip)
}

/// A toolbar button enabled only when `enabled` (undo/redo, selection actions).
pub fn button_enabled(ui: &mut egui::Ui, enabled: bool, glyph: &str, tooltip: &str) -> egui::Response {
    ui.add_enabled(enabled, egui::Button::new(glyph).min_size(square()))
        .on_hover_text(tooltip)
}

/// A toolbar TOGGLE button (draw-tool selection, wireframe): pressed when `selected`.
pub fn toggle(ui: &mut egui::Ui, selected: bool, glyph: &str, tooltip: &str) -> egui::Response {
    ui.add(egui::Button::new(glyph).min_size(square()).selected(selected))
        .on_hover_text(tooltip)
}