Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
29 lines
638 B
C++
29 lines
638 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace mr {
|
|
|
|
// Minimal ImGui file picker (ImGui has no native file dialog).
|
|
class FileBrowser {
|
|
public:
|
|
FileBrowser();
|
|
void open();
|
|
// Draws the popup; returns true when a file was chosen (see selectedPath()).
|
|
bool draw();
|
|
const std::string& selectedPath() const { return selected_; }
|
|
|
|
private:
|
|
void refresh();
|
|
|
|
std::string currentDir_;
|
|
char pathBuffer_[1024] = {};
|
|
std::vector<std::pair<std::string, bool>> entries_; // name, isDirectory
|
|
std::string selected_;
|
|
std::string error_;
|
|
bool openRequested_ = false;
|
|
};
|
|
|
|
} // namespace mr
|