From 7ced15be5c4fe487b43d5ac193d224d5e257fb82 Mon Sep 17 00:00:00 2001 From: pjht Date: Wed, 31 Jan 2024 15:44:25 -0600 Subject: [PATCH] Fix behaivior of load bin file entry in menu --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 38c2722..1cbe1ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,9 +88,10 @@ impl AltairEmulator { ); ui.close_menu(); } - if ui.button("Load binary file").clicked() { + if ui.add_enabled(!self.windows.contains_key("load_bin"), Button::new("Load binary file")).clicked() { self.windows - .insert("load_bin_window", Box::new(LoadBinWindow::new(ui.ctx()))); + .insert("load_bin", Box::new(LoadBinWindow::new(ui.ctx()))); + ui.close_menu(); } }); });