22#include <imgui_impl_glfw.h>
23#include <imgui_impl_opengl3.h>
24#include <imgui_internal.h>
36inline std::ostream&
operator<<(std::ostream& os,
const ImGuiStyle& style) {
38 <<
"Alpha: " << style.Alpha <<
", "
39 <<
"DisabledAlpha: " << style.DisabledAlpha <<
", "
40 <<
"WindowPadding: (" << style.WindowPadding.x <<
", "
41 << style.WindowPadding.y <<
"), "
42 <<
"WindowRounding: " << style.WindowRounding <<
", "
43 <<
"WindowBorderSize: " << style.WindowBorderSize <<
", "
44 <<
"FramePadding: (" << style.FramePadding.x <<
", "
45 << style.FramePadding.y <<
"), "
46 <<
"FrameRounding: " << style.FrameRounding <<
", "
47 <<
"ItemSpacing: (" << style.ItemSpacing.x <<
", " << style.ItemSpacing.y
49 <<
"ScrollbarSize: " << style.ScrollbarSize <<
", "
50 <<
"ScrollbarRounding: " << style.ScrollbarRounding <<
", "
51 <<
"GrabMinSize: " << style.GrabMinSize <<
", "
52 <<
"GrabRounding: " << style.GrabRounding <<
", "
53 <<
"TabRounding: " << style.TabRounding <<
" }\n";
56 for (
int i = 0; i < ImGuiCol_COUNT; ++i) {
57 const ImVec4& col = style.Colors[i];
58 os <<
" [" << ImGuiCol_(i) <<
"] (" << col.x <<
", " << col.y <<
", "
59 << col.z <<
", " << col.w <<
")\n";
78 const char* filterList =
nullptr,
const char* defaultPath =
nullptr)
87 [[nodiscard]] std::filesystem::path
Open()
const {
88 nfdchar_t* outPath =
nullptr;
92 if (result == NFD_OKAY) {
93 std::filesystem::path path(outPath);
106 [[nodiscard]] std::filesystem::path
Save()
const {
107 nfdchar_t* outPath =
nullptr;
111 if (result == NFD_OKAY) {
112 std::filesystem::path path(outPath);
125 [[nodiscard]] std::vector<std::filesystem::path>
OpenMultiple()
const {
126 nfdpathset_t pathSet;
130 if (result == NFD_OKAY) {
131 std::vector<std::filesystem::path> paths;
132 size_t count = NFD_PathSet_GetCount(&pathSet);
133 paths.reserve(count);
134 for (
size_t i = 0; i < count; ++i) {
135 nfdchar_t* path = NFD_PathSet_GetPath(&pathSet, i);
136 paths.emplace_back(path);
138 NFD_PathSet_Free(&pathSet);
150 [[nodiscard]] std::filesystem::path
Dir()
const {
151 nfdchar_t* outPath =
nullptr;
152 nfdresult_t result = NFD_PickFolder(
m_DefaultPath, &outPath);
154 if (result == NFD_OKAY) {
155 std::filesystem::path path(outPath);
std::ostream & operator<<(std::ostream &os, const ImGuiStyle &style)
Streams a readable dump of an ImGui style object.
Definition Gui.h:36
std::filesystem::path Dir() const
Opens a directory picker dialog.
Definition Gui.h:150
const char * m_FilterList
Definition Gui.h:163
std::filesystem::path Save() const
Opens a save-file dialog.
Definition Gui.h:106
const char * m_DefaultPath
Definition Gui.h:164
std::vector< std::filesystem::path > OpenMultiple() const
Opens a multi-select file picker dialog.
Definition Gui.h:125
FileDialog(const char *filterList=nullptr, const char *defaultPath=nullptr)
Creates a file dialog helper with optional filter and start path.
Definition Gui.h:77
std::filesystem::path Open() const
Opens a single-file picker dialog.
Definition Gui.h:87