fix imgui post update

This commit is contained in:
Green Sky
2025-05-21 21:28:27 +02:00
parent 5494dda227
commit 09074c1ab5
4 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ void FilePicker(const char* label, MM::Services::FilesystemService& fs, std::str
//ImGui::TextUnformatted(dirlist_path.c_str()); //ImGui::TextUnformatted(dirlist_path.c_str());
if (dirlist_path != "/") { 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); 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; 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() != '/') { if (path.back() != '/') {
path = internal_remove_last_folder(path); path = internal_remove_last_folder(path);
} }

View File

@ -17,7 +17,7 @@ void Texture(MM::OpenGL::Texture::handle_t& texture, bool dropTarget) {
ImGui::BeginGroup(); ImGui::BeginGroup();
if (texture) { 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" // "tooltip"
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
@ -32,7 +32,7 @@ void Texture(MM::OpenGL::Texture::handle_t& texture, bool dropTarget) {
auto id = MM::ResourceManager<MM::OpenGL::Texture>::ref().id_from_handle(texture); auto id = MM::ResourceManager<MM::OpenGL::Texture>::ref().id_from_handle(texture);
if (id) { if (id) {
ImGui::SetDragDropPayload(IMGUI_PAYLOAD_TYPE_MM_REND_TEXTURE, &(id.value()), sizeof(id.value())); 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(); ImGui::EndDragDropSource();
} }

View File

@ -98,7 +98,7 @@ static void renderUpdateStratGraph(
//ImGui::BeginChild("canvas", {0, 0}, true); //ImGui::BeginChild("canvas", {0, 0}, true);
const ImVec2 cp = ImGui::GetCursorScreenPos(); const ImVec2 cp = ImGui::GetCursorScreenPos();
const auto max_cont = ImGui::GetWindowContentRegionMax(); const auto max_cont = ImGui::GetContentRegionAvail();
ImGui::Dummy(max_cont); ImGui::Dummy(max_cont);
auto* dl = ImGui::GetWindowDrawList(); auto* dl = ImGui::GetWindowDrawList();

View File

@ -29,7 +29,7 @@ bool ImGuiService::enable(Engine& engine, std::vector<UpdateStrategies::TaskInfo
ImGui::CreateContext(); ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavNoCaptureKeyboard; io.ConfigNavCaptureKeyboard = false;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // TODO: dont, if ingame ? //io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // TODO: dont, if ingame ?
auto& sdl_ss = engine.getService<MM::Services::SDLService>(); auto& sdl_ss = engine.getService<MM::Services::SDLService>();