From dfeeb666333b6e991e1f84a4ed009fba46e890f6 Mon Sep 17 00:00:00 2001 From: Filipe Rodrigues Date: Mon, 24 Jan 2022 02:04:27 +0000 Subject: [PATCH] Fixed panels' collapsing ui to close itself when changing geometry. This was due to using the geometry as an id, we now just enumerate the panels. --- src/app.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index 67cd8c9..83a9984 100644 --- a/src/app.rs +++ b/src/app.rs @@ -343,8 +343,8 @@ impl App { // Then render it settings_window.open(&mut *settings_window_open).show(ctx, |ui| { let mut panels = inner.panels.lock(); - for panel in &mut *panels { - ui.collapsing(format!("Panel {}", panel.geometry), |ui| { + for (idx, panel) in panels.iter_mut().enumerate() { + ui.collapsing(format!("Panel {idx}"), |ui| { // TODO: Make a macro to make this more readable ui.horizontal(|ui| { // Calculate the limits