GUI: add backdrop if system file picker is open

This commit is contained in:
tildearrow 2022-04-30 02:02:55 -05:00
parent 52c0044bd9
commit ba657fe4db
4 changed files with 18 additions and 1 deletions

View file

@ -13,7 +13,6 @@
- maybe YMU759 ADPCM channel - maybe YMU759 ADPCM channel
- ADPCM chips - ADPCM chips
- more effects for FM param control - more effects for FM param control
- store system presets in new file
- Game Boy envelope macro/sequence - Game Boy envelope macro/sequence
- option to display chip names instead of "multi-system" on title bar - option to display chip names instead of "multi-system" on title bar
- rewrite the system name detection function anyway - rewrite the system name detection function anyway

View file

@ -95,6 +95,10 @@ bool FurnaceGUIFileDialog::render(const ImVec2& min, const ImVec2& max) {
} }
} }
bool FurnaceGUIFileDialog::isOpen() {
return opened;
}
String FurnaceGUIFileDialog::getPath() { String FurnaceGUIFileDialog::getPath() {
if (sysDialog) { if (sysDialog) {
if (curPath.size()>1) { if (curPath.size()>1) {

View file

@ -24,6 +24,7 @@ class FurnaceGUIFileDialog {
bool accepted(); bool accepted();
void close(); void close();
bool render(const ImVec2& min, const ImVec2& max); bool render(const ImVec2& min, const ImVec2& max);
bool isOpen();
String getPath(); String getPath();
String getFileName(); String getFileName();
explicit FurnaceGUIFileDialog(bool system): explicit FurnaceGUIFileDialog(bool system):

View file

@ -2882,6 +2882,19 @@ bool FurnaceGUI::loop() {
#endif #endif
} }
if (fileDialog->isOpen() && settings.sysFileDialog) {
ImGui::OpenPopup("System File Dialog Pending");
}
if (ImGui::BeginPopupModal("System File Dialog Pending",NULL,ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove)) {
if (!fileDialog->isOpen()) {
ImGui::CloseCurrentPopup();
}
ImDrawList* dl=ImGui::GetForegroundDrawList();
dl->AddRectFilled(ImVec2(0.0f,0.0f),ImVec2(scrW*dpiScale,scrH*dpiScale),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_MODAL_BACKDROP]));
ImGui::EndPopup();
}
if (fileDialog->render(ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) { if (fileDialog->render(ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) {
bool openOpen=false; bool openOpen=false;
//ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NavEnableKeyboard; //ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NavEnableKeyboard;