mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
Improve the UI for changing the egui theme (#4257)
I added a new demo - a `Frame` editor:  This whole menu is now just a a bit nicer to use: <img width="406" alt="Screenshot 2024-03-28 at 09 49 16" src="https://github.com/emilk/egui/assets/1148717/32d12067-7cf0-4312-aa12-42909a5ed5ac">
This commit is contained in:
@@ -79,7 +79,7 @@ impl FractalClock {
|
||||
ui.add(Slider::new(&mut self.luminance_factor, 0.0..=1.0).text("luminance factor"));
|
||||
ui.add(Slider::new(&mut self.width_factor, 0.0..=1.0).text("width factor"));
|
||||
|
||||
egui::reset_button(ui, self);
|
||||
egui::reset_button(ui, self, "Reset");
|
||||
|
||||
ui.hyperlink_to(
|
||||
"Inspired by a screensaver by Rob Mayoff",
|
||||
|
||||
@@ -245,7 +245,13 @@ impl eframe::App for WrapApp {
|
||||
}
|
||||
|
||||
fn clear_color(&self, visuals: &egui::Visuals) -> [f32; 4] {
|
||||
visuals.panel_fill.to_normalized_gamma_f32()
|
||||
// Give the area behind the floating windows a different color, because it looks better:
|
||||
let color = egui::lerp(
|
||||
egui::Rgba::from(visuals.panel_fill)..=egui::Rgba::from(visuals.extreme_bg_color),
|
||||
0.5,
|
||||
);
|
||||
let color = egui::Color32::from(color);
|
||||
color.to_normalized_gamma_f32()
|
||||
}
|
||||
|
||||
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
|
||||
|
||||
Reference in New Issue
Block a user