Files
sophia/editor/panels/asset_browser_panel.cpp
T

24 lines
670 B
C++

#include "asset_browser_panel.hpp"
#include <imgui.h>
void AssetBrowserPanel::onUpdate(const sophia::FrameInfo&) {
ImGui::BeginChild("Folders", ImVec2(150, 0), true);
for (int i = 0; i < static_cast<int>(folders.size()); i++) {
if (ImGui::Selectable(folders[static_cast<size_t>(i)].name.c_str(),
selectedFolder == i)) {
selectedFolder = i;
}
}
ImGui::EndChild();
ImGui::SameLine();
ImGui::BeginChild("Files", ImVec2(0, 0), true);
const Folder& folder = folders[static_cast<size_t>(selectedFolder)];
for (const std::string& file : folder.files) {
ImGui::Selectable(file.c_str());
}
ImGui::EndChild();
}