From 2e6ab5d6b1ad724123db9f73ae36062485522a03 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Fri, 4 Oct 2024 11:48:53 +0200 Subject: [PATCH] Experiment with styling via extension traits --- examples/hello_world_simple/src/main.rs | 154 ++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/examples/hello_world_simple/src/main.rs b/examples/hello_world_simple/src/main.rs index 4fe49a89d683..a8246da70442 100644 --- a/examples/hello_world_simple/src/main.rs +++ b/examples/hello_world_simple/src/main.rs @@ -2,6 +2,10 @@ #![allow(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; +use eframe::egui::style::{WidgetVisuals, Widgets}; +use eframe::egui::util::IdTypeMap; +use eframe::egui::{Button, Id, Response}; +use std::sync::Arc; fn main() -> eframe::Result { env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). @@ -28,6 +32,156 @@ fn main() -> eframe::Result { age += 1; } ui.label(format!("Hello '{name}', age {age}")); + + ui.add(Button::new("Hi").primary().big()); + + let mut ui = ImprovedUi::new(); + let mut ui = &mut ui; + + ui.widget_styles::