From 4e5a7ba483e5264a5ce43b1b8ec233d350ec6857 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 29 Mar 2024 15:37:34 +0100 Subject: [PATCH] fix: Closing providers still appearing in the provider list --- plugins/builtin/source/content/ui_items.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/builtin/source/content/ui_items.cpp b/plugins/builtin/source/content/ui_items.cpp index d0fe7e810..d49bc0762 100644 --- a/plugins/builtin/source/content/ui_items.cpp +++ b/plugins/builtin/source/content/ui_items.cpp @@ -404,8 +404,7 @@ namespace hex::plugin::builtin { // Provider switcher ContentRegistry::Interface::addToolbarItem([] { - const auto provider = ImHexApi::Provider::get(); - const bool providerValid = provider != nullptr; + const bool providerValid = ImHexApi::Provider::get() != nullptr; const bool tasksRunning = TaskManager::getRunningTaskCount() > 0; ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical); @@ -430,6 +429,9 @@ namespace hex::plugin::builtin { auto &tabProvider = providers[i]; const auto selectedProviderIndex = ImHexApi::Provider::getCurrentProviderIndex(); + if (std::ranges::contains(ImHexApi::Provider::impl::getClosingProviders(), tabProvider)) + continue; + bool open = true; ImGui::PushID(tabProvider);