Update ProjectManager.cpp
This commit is contained in:
parent
231181ef92
commit
c5d9985d00
@ -130,7 +130,8 @@ bool FileExplorer::Init()
|
|||||||
|
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
fs::recursive_directory_iterator it(s_root, fs::directory_options::skip_permission_denied, ec);
|
fs::recursive_directory_iterator it(s_root, fs::directory_options::skip_permission_denied, ec);
|
||||||
for (const fs::recursive_directory_iterator end; it != end; it.increment(ec)) {
|
fs::recursive_directory_iterator end;
|
||||||
|
for (; it != end; it.increment(ec)) {
|
||||||
if (ec) {
|
if (ec) {
|
||||||
Logger::LogWarning("FileExplorer: skipping '%s': %s",
|
Logger::LogWarning("FileExplorer: skipping '%s': %s",
|
||||||
it->path().string().c_str(),
|
it->path().string().c_str(),
|
||||||
@ -177,15 +178,13 @@ void FileExplorer::Show(bool* p_open)
|
|||||||
if (node.path == s_currentDir)
|
if (node.path == s_currentDir)
|
||||||
flags |= ImGuiTreeNodeFlags_Selected;
|
flags |= ImGuiTreeNodeFlags_Selected;
|
||||||
|
|
||||||
// 1) icon
|
ImGui::Image((ImTextureID)s_folderIcon, ImVec2(16,16));
|
||||||
ImGui::Image(s_folderIcon, ImVec2(16,16));
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
// 2) label
|
|
||||||
const char* label = (node.path == lastTreeRoot)
|
const char* label = (node.path == lastTreeRoot)
|
||||||
? "res://"
|
? "res://"
|
||||||
: node.path.filename().string().c_str();
|
: node.path.filename().string().c_str();
|
||||||
const bool open = ImGui::TreeNodeEx(
|
bool open = ImGui::TreeNodeEx(
|
||||||
node.path.string().c_str(),
|
node.path.string().c_str(),
|
||||||
flags,
|
flags,
|
||||||
"%s",
|
"%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user