Files
sophia/engine/src/ui/panels/panel_registry_panel.cpp
T

26 lines
559 B
C++

#include "panel_registry_panel.hpp"
#include <imgui.h>
namespace sophia {
void PanelRegistryPanel::onUpdate(const FrameInfo&) {
ImGui::Text("%u panels (%u visible)", registry.size(),
registry.visibleCount());
ImGui::Separator();
for (std::string_view name : registry.names()) {
Panel* panel = registry.find(name);
if (!panel || panel == this) {
continue;
}
bool visible = panel->isVisible();
if (ImGui::Checkbox(name.data(), &visible)) {
panel->setVisible(visible);
}
}
}
} // namespace sophia