Skip to content

Commit

Permalink
[sim] GUI: Don't show Window menu if it has no contents (#7432)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson authored Nov 26, 2024
1 parent fe28fa1 commit b6de7ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions glass/src/lib/native/include/glass/WindowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion simulation/halsim_gui/src/main/native/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit b6de7ac

Please sign in to comment.