fix: Empty popup opening when right clicking some provider tabs
This commit is contained in:
parent
494223fff6
commit
9cbfaed5fe
@ -322,18 +322,20 @@ namespace hex::plugin::builtin {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string popupID = std::string("ProviderMenu.") + std::to_string(tabProvider->getID());
|
if (!tabProvider->getMenuEntries().empty()) {
|
||||||
if (ImGui::IsMouseReleased(1) && ImGui::IsItemHovered()) {
|
std::string popupID = std::string("ProviderMenu.") + std::to_string(tabProvider->getID());
|
||||||
ImGui::OpenPopup(popupID.c_str());
|
if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) {
|
||||||
}
|
ImGui::OpenPopup(popupID.c_str());
|
||||||
|
}
|
||||||
if (ImGui::BeginPopup(popupID.c_str())) {
|
|
||||||
for (const auto &menuEntry : tabProvider->getMenuEntries()) {
|
if (ImGui::BeginPopup(popupID.c_str())) {
|
||||||
if (ImGui::MenuItem(menuEntry.name.c_str())) {
|
for (const auto &menuEntry : tabProvider->getMenuEntries()) {
|
||||||
menuEntry.callback();
|
if (ImGui::MenuItem(menuEntry.name.c_str())) {
|
||||||
}
|
menuEntry.callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
ImGui::EndPopup();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user