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
1 changed files with 8 additions and 6 deletions

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();