mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Refresh File Browser on Fìle Creation
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -26,5 +26,6 @@ namespace Nuake {
|
||||
void DrawFile(Ref<File> file);
|
||||
void DrawDirectoryExplorer();
|
||||
void DrawContextMenu();
|
||||
void RefreshFileBrowser();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user