[sim] GUI: Don't show Window menu if it has no contents (#7432)

This commit is contained in:
Peter Johnson
2024-11-25 17:25:55 -08:00
committed by GitHub
parent fe28fa1ded
commit b6de7acbdb
2 changed files with 6 additions and 1 deletions

View File

@@ -121,6 +121,11 @@ class WindowManager {
*/
void EraseWindows() { m_windows.clear(); }
/**
* Get window count.
*/
size_t GetNumWindows() const { return m_windows.size(); }
protected:
/**
* Removes existing window (by index)

View File

@@ -148,7 +148,7 @@ __declspec(dllexport)
gPlotProvider->DisplayMenu();
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Window")) {
if (HALSimGui::manager->GetNumWindows() > 0 && ImGui::BeginMenu("Window")) {
HALSimGui::manager->DisplayMenu();
ImGui::EndMenu();
}