GUI: center file picker and limit to win size

This commit is contained in:
tildearrow 2022-01-20 00:31:36 -05:00
parent 3a87017821
commit 797ffd62da
2 changed files with 2 additions and 1 deletions

View file

@ -3617,6 +3617,7 @@ namespace IGFD
}
if (beg)
{
ImGui::SetWindowPos(ImVec2((ImGui::GetMainViewport()->Size.x-ImGui::GetWindowWidth())*0.5f,(ImGui::GetMainViewport()->Size.y-ImGui::GetWindowHeight())*0.5f));
#ifdef IMGUI_HAS_VIEWPORT
// if decoration is enabled we disable the resizing feature of imgui for avoid crash with SDL2 and GLFW3
if (ImGui::GetIO().ConfigViewportsNoDecoration)

View file

@ -3501,7 +3501,7 @@ bool FurnaceGUI::loop() {
drawPattern();
drawSettings();
if (ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse,ImVec2(600.0f*dpiScale,400.0f*dpiScale))) {
if (ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoMove,ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) {
if (ImGuiFileDialog::Instance()->IsOk()) {
fileName=ImGuiFileDialog::Instance()->GetFilePathName();
if (fileName!="") {