mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Demo: add button to reset the demo
This commit is contained in:
@@ -93,6 +93,23 @@ impl epi::App for WrapApp {
|
||||
if self.backend_panel.open || ctx.memory().everything_is_visible() {
|
||||
egui::SidePanel::left("backend_panel").show(ctx, |ui| {
|
||||
self.backend_panel.ui(ui, frame);
|
||||
|
||||
ui.separator();
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
if ui
|
||||
.button("Reset egui")
|
||||
.on_hover_text("Forget scroll, positions, sizes etc")
|
||||
.clicked()
|
||||
{
|
||||
*ui.ctx().memory() = Default::default();
|
||||
}
|
||||
|
||||
if ui.button("Reset everything").clicked() {
|
||||
*self = Default::default();
|
||||
*ui.ctx().memory() = Default::default();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user