mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 23:30:04 -04:00
Add widget egui::reset_button
This commit is contained in:
@@ -2,7 +2,7 @@ use egui::*;
|
||||
use std::f64::INFINITY;
|
||||
|
||||
/// Showcase sliders
|
||||
#[derive(serde::Deserialize, serde::Serialize)]
|
||||
#[derive(PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct Sliders {
|
||||
pub min: f64,
|
||||
@@ -108,8 +108,6 @@ impl Sliders {
|
||||
ui.checkbox(smart_aim, "Smart Aim");
|
||||
ui.label("Smart Aim will guide you towards round values when you drag the slider so you you are more likely to hit 250 than 247.23");
|
||||
|
||||
if ui.button("Reset slider demo").clicked {
|
||||
*self = Default::default();
|
||||
}
|
||||
egui::reset_button(ui, self);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user