Refresh File Browser on Fìle Creation

This commit is contained in:
emerycp
2023-07-09 10:43:45 -04:00
parent d246735339
commit 73ef13932d
2 changed files with 12 additions and 3 deletions

View File

@@ -211,6 +211,8 @@ namespace Nuake {
FileSystem::BeginWriteFile(path);
FileSystem::WriteLine(jsonData.dump(4));
FileSystem::EndWriteFile();
RefreshFileBrowser();
}
}
@@ -224,10 +226,11 @@ namespace Nuake {
if (!path.empty())
{
FileSystem::BeginWriteFile(path);
FileSystem::WriteLine(TEMPLATE_SCRIPT);
FileSystem::EndWriteFile();
RefreshFileBrowser();
}
}
@@ -239,6 +242,12 @@ namespace Nuake {
}
void FileSystemUI::RefreshFileBrowser()
{
FileSystem::Scan();
m_CurrentDirectory = FileSystem::RootDirectory;
}
float h = 200;
static float sz1 = 300;
static float sz2 = 300;
@@ -301,8 +310,7 @@ namespace Nuake {
{
if (ImGui::Button("Refresh"))
{
FileSystem::Scan();
m_CurrentDirectory = FileSystem::RootDirectory;
RefreshFileBrowser();
}
ImGui::SameLine();

View File

@@ -26,5 +26,6 @@ namespace Nuake {
void DrawFile(Ref<File> file);
void DrawDirectoryExplorer();
void DrawContextMenu();
void RefreshFileBrowser();
};
}