Merge pull request #1232 from YohananDiamond/dialog-nitpicks

More dialog nitpicks: cancel popups with ESC
This commit is contained in:
tildearrow 2023-07-11 19:16:32 -05:00 committed by GitHub
commit 641327634e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5252,7 +5252,7 @@ bool FurnaceGUI::loop() {
quit=true;
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
break;
@ -5276,7 +5276,7 @@ bool FurnaceGUI::loop() {
displayNew=true;
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
break;
@ -5300,7 +5300,7 @@ bool FurnaceGUI::loop() {
openFileDialog(GUI_FILE_OPEN);
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
break;
@ -5324,7 +5324,7 @@ bool FurnaceGUI::loop() {
openFileDialog(GUI_FILE_OPEN_BACKUP);
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
break;
@ -5355,7 +5355,7 @@ bool FurnaceGUI::loop() {
nextFile="";
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
nextFile="";
}
@ -5409,7 +5409,7 @@ bool FurnaceGUI::loop() {
syncSettings();
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
break;
@ -5496,7 +5496,7 @@ bool FurnaceGUI::loop() {
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Wait! What am I doing? Cancel!")) {
if (ImGui::Button("Wait! What am I doing? Cancel!") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
break;
@ -5647,7 +5647,7 @@ bool FurnaceGUI::loop() {
ImGui::EndDisabled();
ImGui::SameLine();
}
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
for (std::pair<DivInstrument*,bool>& i: pendingIns) {
i.second=false;
}
@ -5719,7 +5719,7 @@ bool FurnaceGUI::loop() {
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();