implement open file dialog for linux
This commit is contained in:
@@ -14,6 +14,9 @@ std::string win32_open_dir();
|
||||
void win32_show_cursor(bool visible);
|
||||
bool win32_clipboard_set_text(const std::string & s);
|
||||
std::string win32_clipboard_get_text();
|
||||
#elif __APPLE__
|
||||
#else
|
||||
#include <tinyfiledialogs.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -190,6 +193,9 @@ void App::pick_file(std::vector<std::string> types, std::function<void (std::str
|
||||
std::string path = win32_open_file(filter.c_str());
|
||||
if (!path.empty())
|
||||
callback(path);
|
||||
#else
|
||||
if (auto p = tinyfd_openFileDialog("Open File", "", 0, nullptr, nullptr, false))
|
||||
callback(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user