1
0
mirror of synced 2025-02-17 18:59:21 +01:00

impr: Make sure no empty popup appears when right clicking search box

This commit is contained in:
WerWolv 2023-12-18 22:51:08 +01:00
parent a3f1a5b0a9
commit eb21a5992f

View File

@ -182,14 +182,18 @@ namespace hex::plugin::builtin {
});
EventFrameBegin::subscribe([] {
if (ImGui::BeginPopup("ProviderMenu")) {
if (rightClickedProvider != nullptr && !rightClickedProvider->getMenuEntries().empty())
if (rightClickedProvider != nullptr && !rightClickedProvider->getMenuEntries().empty()) {
if (ImGui::BeginPopup("ProviderMenu")) {
drawProviderContextMenu(rightClickedProvider);
ImGui::EndPopup();
ImGui::EndPopup();
}
}
});
EventProviderChanged::subscribe([](auto, auto){
rightClickedProvider = nullptr;
});
ContentRegistry::Interface::addToolbarItem([] {
auto provider = ImHexApi::Provider::get();
bool providerValid = provider != nullptr;