ui: Fix flags for directory open

This commit is contained in:
Matt Borgerson 2022-05-07 20:15:22 -07:00 committed by mborgerson
parent 328eff8eaa
commit 48bf99f060
1 changed files with 3 additions and 2 deletions

View File

@ -312,9 +312,10 @@ bool FilePicker(const char *str_id, const char **buf, const char *filters,
ImGui::PushID(str_id);
bool status = ImGui::Button("###file_button", bb);
if (status) {
int flags = NOC_FILE_DIALOG_OPEN;
if (dir) flags |= NOC_FILE_DIALOG_DIR;
const char *new_path =
PausedFileOpen(dir ? NOC_FILE_DIALOG_DIR : NOC_FILE_DIALOG_OPEN,
filters, *buf, NULL);
PausedFileOpen(flags, filters, *buf, NULL);
if (new_path) {
free((void*)*buf);
*buf = strdup(new_path);