mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
feat: Added context menu with right-clicking on file provider (#1084)
Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
@@ -224,6 +224,20 @@ namespace hex::plugin::builtin {
|
||||
ImHexApi::Provider::remove(providers[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
std::string popupID = std::string("ProviderMenu.") + std::to_string(tabProvider->getID());
|
||||
if (ImGui::IsMouseReleased(1) && ImGui::IsItemHovered()) {
|
||||
ImGui::OpenPopup(popupID.c_str());
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopup(popupID.c_str())) {
|
||||
for (auto p : tabProvider->getMenuEntries()) {
|
||||
if (ImGui::MenuItem(p.first.c_str())) {
|
||||
p.second();
|
||||
}
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user