From 3c7c7834a4d741e8b305f336f5bcbbe65f09a259 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 20 Jul 2024 09:15:57 -0400 Subject: [PATCH] clear status popup with space --- src/app/editor/master_editor.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index ea9b6c1c..f0b6bfae 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -274,6 +274,10 @@ void MasterEditor::ManageKeyboardShortcuts() { } } + if (ImGui::IsKeyDown(ImGuiKey_F1)) { + about_ = true; + } + // If CMD + Q is pressed, quit the application if (ImGui::IsKeyDown(ImGuiKey_Q) && (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { @@ -352,7 +356,8 @@ void MasterEditor::DrawStatusPopup() { Separator(); ImGui::NewLine(); SameLine(128); - if (ImGui::Button("OK", gui::kDefaultModalSize)) { + if (ImGui::Button("OK", gui::kDefaultModalSize) || + ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) { show_status_ = false; status_ = absl::OkStatus(); } @@ -389,7 +394,8 @@ void MasterEditor::DrawInfoPopup() { Text("Title: %s", rom()->title()); Text("ROM Size: %ld", rom()->size()); - if (ImGui::Button("Close", gui::kDefaultModalSize)) { + if (ImGui::Button("Close", gui::kDefaultModalSize) || + ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) { rom_info_ = false; ImGui::CloseCurrentPopup(); } @@ -731,7 +737,7 @@ void MasterEditor::DrawHelpMenu() { if (MenuItem("Supported Features")) open_supported_features = true; if (MenuItem("How to manage a project")) open_manage_project = true; - if (MenuItem("About")) about_ = true; + if (MenuItem("About", "F1")) about_ = true; ImGui::EndMenu(); }