From a2c5b47e34d358f8b9b697fba8a6c52585cff8fa Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 18 Jan 2025 01:26:41 +0100 Subject: collapseable profiler --- client/src/interfaces/profiler.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/src/interfaces/profiler.rs b/client/src/interfaces/profiler.rs index 85b5858..c6256b6 100644 --- a/client/src/interfaces/profiler.rs +++ b/client/src/interfaces/profiler.rs @@ -24,12 +24,15 @@ pub struct Profiler { impl Widget for &mut Profiler { fn ui(self, ui: &mut egui::Ui) -> egui::Response { - ui.heading("Scene"); - ui.add(&*self.idata.scene_prepare); - ui.heading("Download"); - ui.add(&*self.idata.downloader); - ui.heading("Render"); - ui.add(&*self.idata.render_timing.lock().unwrap()); + ui.collapsing("Scene", |ui| { + self.idata.scene_prepare.ui(ui); + }); + ui.collapsing("Download", |ui| { + ui.add(&*self.idata.downloader); + }); + ui.collapsing("Render", |ui| { + ui.add(&*self.idata.render_timing.lock().unwrap()); + }); ui.response() } } -- cgit v1.2.3-70-g09d2