1
0
mirror of synced 2024-11-12 02:00:52 +01:00

Don't show Plugin Views menu if there are no views

This commit is contained in:
WerWolv 2021-01-11 09:50:51 +01:00
parent 60e1c23a6b
commit 68bd5569ce

View File

@ -161,13 +161,15 @@ namespace hex {
ImGui::MenuItem((view->getName() + " View").c_str(), "", &view->getWindowOpenState());
}
if (ImGui::BeginMenu("Plugin Views")) {
for (auto &view : this->m_pluginViews) {
if (view->hasViewMenuItemEntry())
ImGui::MenuItem((view->getName() + " View").c_str(), "", &view->getWindowOpenState());
}
if (!this->m_pluginViews.empty()) {
if (ImGui::BeginMenu("Plugin Views")) {
for (auto &view : this->m_pluginViews) {
if (view->hasViewMenuItemEntry())
ImGui::MenuItem((view->getName() + " View").c_str(), "", &view->getWindowOpenState());
}
ImGui::EndMenu();
ImGui::EndMenu();
}
}
ImGui::EndMenu();