Skip to content

Commit

Permalink
Move button in demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Sep 13, 2024
1 parent 4c035a3 commit 7d287d0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crates/egui_demo_app/src/backend_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,6 @@ impl BackendPanel {

self.run_mode_ui(ui);

ui.horizontal(|ui| {
if ui.button("Request discard").clicked() {
ui.ctx().request_discard();

if !ui.ctx().will_discard() {
ui.label("Discard denied!");
}
}
});

ui.separator();

self.frame_history.ui(ui);
Expand Down Expand Up @@ -157,7 +147,7 @@ impl BackendPanel {
if cfg!(debug_assertions) {
ui.collapsing("More…", |ui| {
ui.horizontal(|ui| {
ui.label("Frame number:");
ui.label("Total ui passes:");
ui.monospace(ui.ctx().cumulative_pass_nr().to_string());
});
if ui
Expand All @@ -171,6 +161,16 @@ impl BackendPanel {
ctx.request_repaint_after(std::time::Duration::from_secs(3));
});
}

ui.horizontal(|ui| {
if ui.button("Request discard").clicked() {
ui.ctx().request_discard();

if !ui.ctx().will_discard() {
ui.label("Discard denied!");
}
}
});
});
}
}
Expand Down

0 comments on commit 7d287d0

Please sign in to comment.