From 09074c1ab535dcd29eeee8878d0b1c6a1efe23b3 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 21 May 2025 21:28:27 +0200 Subject: [PATCH] fix imgui post update --- framework/imgui/src/mm/imgui/widgets/filesystem.cpp | 4 ++-- framework/imgui/src/mm/imgui/widgets/texture.cpp | 4 ++-- framework/imgui/src/mm/services/engine_tools.cpp | 2 +- framework/imgui/src/mm/services/imgui_s.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/imgui/src/mm/imgui/widgets/filesystem.cpp b/framework/imgui/src/mm/imgui/widgets/filesystem.cpp index 4b3ae92..f09b1c7 100644 --- a/framework/imgui/src/mm/imgui/widgets/filesystem.cpp +++ b/framework/imgui/src/mm/imgui/widgets/filesystem.cpp @@ -49,7 +49,7 @@ void FilePicker(const char* label, MM::Services::FilesystemService& fs, std::str //ImGui::TextUnformatted(dirlist_path.c_str()); if (dirlist_path != "/") { - if (ImGui::Selectable(ICON_II_FOLDER " ..", false, ImGuiSelectableFlags_DontClosePopups)) { + if (ImGui::Selectable(ICON_II_FOLDER " ..", false, ImGuiSelectableFlags_NoAutoClosePopups)) { path = internal_remove_last_folder(dirlist_path); } } @@ -69,7 +69,7 @@ void FilePicker(const char* label, MM::Services::FilesystemService& fs, std::str tmp_text += i; - if (ImGui::Selectable(tmp_text.c_str(), false, ImGuiSelectableFlags_DontClosePopups)) { + if (ImGui::Selectable(tmp_text.c_str(), false, ImGuiSelectableFlags_NoAutoClosePopups)) { if (path.back() != '/') { path = internal_remove_last_folder(path); } diff --git a/framework/imgui/src/mm/imgui/widgets/texture.cpp b/framework/imgui/src/mm/imgui/widgets/texture.cpp index 463c9ca..6cdde79 100644 --- a/framework/imgui/src/mm/imgui/widgets/texture.cpp +++ b/framework/imgui/src/mm/imgui/widgets/texture.cpp @@ -17,7 +17,7 @@ void Texture(MM::OpenGL::Texture::handle_t& texture, bool dropTarget) { ImGui::BeginGroup(); if (texture) { - ImGui::Image(texture->getHandle(), size, {0.f, 1.f}, {1.f, 0.f}, ImVec4(1,1,1,1), ImVec4(1,1,1,1)); + ImGui::ImageWithBg(texture->getHandle(), size, {0.f, 1.f}, {1.f, 0.f}, ImVec4(1,1,1,1), ImVec4(1,1,1,1)); // "tooltip" if (ImGui::IsItemHovered()) { @@ -32,7 +32,7 @@ void Texture(MM::OpenGL::Texture::handle_t& texture, bool dropTarget) { auto id = MM::ResourceManager::ref().id_from_handle(texture); if (id) { ImGui::SetDragDropPayload(IMGUI_PAYLOAD_TYPE_MM_REND_TEXTURE, &(id.value()), sizeof(id.value())); - ImGui::Image(texture->getHandle(), size, {0.f, 1.f}, {1.f, 0.f}, ImVec4(1,1,1,1), ImVec4(1,1,1,1)); + ImGui::ImageWithBg(texture->getHandle(), size, {0.f, 1.f}, {1.f, 0.f}, ImVec4(1,1,1,1), ImVec4(1,1,1,1)); } ImGui::EndDragDropSource(); } diff --git a/framework/imgui/src/mm/services/engine_tools.cpp b/framework/imgui/src/mm/services/engine_tools.cpp index 91a0128..75e1037 100644 --- a/framework/imgui/src/mm/services/engine_tools.cpp +++ b/framework/imgui/src/mm/services/engine_tools.cpp @@ -98,7 +98,7 @@ static void renderUpdateStratGraph( //ImGui::BeginChild("canvas", {0, 0}, true); const ImVec2 cp = ImGui::GetCursorScreenPos(); - const auto max_cont = ImGui::GetWindowContentRegionMax(); + const auto max_cont = ImGui::GetContentRegionAvail(); ImGui::Dummy(max_cont); auto* dl = ImGui::GetWindowDrawList(); diff --git a/framework/imgui/src/mm/services/imgui_s.cpp b/framework/imgui/src/mm/services/imgui_s.cpp index 281a590..ddc98d0 100644 --- a/framework/imgui/src/mm/services/imgui_s.cpp +++ b/framework/imgui/src/mm/services/imgui_s.cpp @@ -29,7 +29,7 @@ bool ImGuiService::enable(Engine& engine, std::vector();