mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-02 02:52:40 +00:00
GUI: implement clear recent file list option
This commit is contained in:
parent
0c79280aae
commit
492b1a8347
2 changed files with 16 additions and 0 deletions
|
@ -3291,6 +3291,11 @@ bool FurnaceGUI::loop() {
|
|||
}
|
||||
if (recentFile.empty()) {
|
||||
ImGui::Text("nothing here yet");
|
||||
} else {
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("clear history")) {
|
||||
showWarning("Are you sure you want to clear the recent file list?",GUI_WARN_CLEAR_HISTORY);
|
||||
}
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
@ -4630,6 +4635,16 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
break;
|
||||
case GUI_WARN_CLEAR_HISTORY:
|
||||
if (ImGui::Button("Yes")) {
|
||||
recentFile.clear();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("No")) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
break;
|
||||
case GUI_WARN_GENERIC:
|
||||
if (ImGui::Button("OK")) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
|
|
|
@ -355,6 +355,7 @@ enum FurnaceGUIWarnings {
|
|||
GUI_WARN_CLEAR,
|
||||
GUI_WARN_SUBSONG_DEL,
|
||||
GUI_WARN_SYSTEM_DEL,
|
||||
GUI_WARN_CLEAR_HISTORY,
|
||||
GUI_WARN_GENERIC
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue