add show directory button in filedialog

This commit is contained in:
marmare314 2023-03-17 11:16:50 +01:00
parent e5a51d5952
commit b477173b8a

View file

@ -4591,6 +4591,7 @@ void CEditor::RenderFileDialog()
static int s_RefreshButton = 0;
static int s_NewFolderButton = 0;
static int s_MapInfoButton = 0;
static int s_ShowDirectoryButton = 0;
CUIRect Button;
ButtonBar.VSplitRight(50.0f, &ButtonBar, &Button);
@ -4669,6 +4670,16 @@ void CEditor::RenderFileDialog()
if(DoButton_Editor(&s_RefreshButton, "Refresh", 0, &Button, 0, nullptr) || (s_ListBoxUsed && (Input()->KeyIsPressed(KEY_F5) || (Input()->ModifierIsPressed() && Input()->KeyIsPressed(KEY_R)))))
FilelistPopulate(m_FileDialogLastPopulatedStorageType, true);
ButtonBar.VSplitRight(40.0f, &ButtonBar, nullptr);
ButtonBar.VSplitRight(90.0f, &ButtonBar, &Button);
if(DoButton_Editor(&s_ShowDirectoryButton, "Show directory", 0, &Button, 0, "Open the current directory in the file browser"))
{
if(!open_file(aPath))
{
dbg_msg("editor", "couldn't open file '%s'", aPath);
}
}
if(m_FileDialogStorageType == IStorage::TYPE_SAVE)
{
ButtonBar.VSplitLeft(40.0f, nullptr, &ButtonBar);