changes for ImGui
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include "panel_registry_panel.hpp"
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
namespace sophia {
|
||||
|
||||
void PanelRegistryPanel::onUpdate(const FrameInfo&) {
|
||||
ImGui::Begin("PanelRegistry");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
} // namespace sophia
|
||||
Reference in New Issue
Block a user