22#include <imgui_impl_glfw.h>
23#include <imgui_impl_opengl3.h>
24#include <imgui_internal.h>
34 return IM_COL32(255 - r, 255 - g, 255 - b, 255);
44inline std::ostream&
operator<<(std::ostream& os,
const ImGuiStyle& style) {
46 <<
"Alpha: " << style.Alpha <<
", "
47 <<
"DisabledAlpha: " << style.DisabledAlpha <<
", "
48 <<
"WindowPadding: (" << style.WindowPadding.x <<
", "
49 << style.WindowPadding.y <<
"), "
50 <<
"WindowRounding: " << style.WindowRounding <<
", "
51 <<
"WindowBorderSize: " << style.WindowBorderSize <<
", "
52 <<
"FramePadding: (" << style.FramePadding.x <<
", "
53 << style.FramePadding.y <<
"), "
54 <<
"FrameRounding: " << style.FrameRounding <<
", "
55 <<
"ItemSpacing: (" << style.ItemSpacing.x <<
", " << style.ItemSpacing.y
57 <<
"ScrollbarSize: " << style.ScrollbarSize <<
", "
58 <<
"ScrollbarRounding: " << style.ScrollbarRounding <<
", "
59 <<
"GrabMinSize: " << style.GrabMinSize <<
", "
60 <<
"GrabRounding: " << style.GrabRounding <<
", "
61 <<
"TabRounding: " << style.TabRounding <<
" }\n";
64 for (
int i = 0; i < ImGuiCol_COUNT; ++i) {
65 const ImVec4& col = style.Colors[i];
66 os <<
" [" << ImGuiCol_(i) <<
"] (" << col.x <<
", " << col.y <<
", "
67 << col.z <<
", " << col.w <<
")\n";
86 const char* filterList =
nullptr,
const char* defaultPath =
nullptr)
95 [[nodiscard]] std::filesystem::path
Open()
const {
96 nfdchar_t* outPath =
nullptr;
100 if (result == NFD_OKAY) {
101 std::filesystem::path path(outPath);
114 [[nodiscard]] std::filesystem::path
Save()
const {
115 nfdchar_t* outPath =
nullptr;
119 if (result == NFD_OKAY) {
120 std::filesystem::path path(outPath);
133 [[nodiscard]] std::vector<std::filesystem::path>
OpenMultiple()
const {
134 nfdpathset_t pathSet;
138 if (result == NFD_OKAY) {
139 std::vector<std::filesystem::path> paths;
140 size_t count = NFD_PathSet_GetCount(&pathSet);
141 paths.reserve(count);
142 for (
size_t i = 0; i < count; ++i) {
143 nfdchar_t* path = NFD_PathSet_GetPath(&pathSet, i);
144 paths.emplace_back(path);
146 NFD_PathSet_Free(&pathSet);
158 [[nodiscard]] std::filesystem::path
Dir()
const {
159 nfdchar_t* outPath =
nullptr;
160 nfdresult_t result = NFD_PickFolder(
m_DefaultPath, &outPath);
162 if (result == NFD_OKAY) {
163 std::filesystem::path path(outPath);
ImGuiCol InvertedImCol(uint8_t r, uint8_t g, uint8_t b)
Definition Gui.h:33
std::ostream & operator<<(std::ostream &os, const ImGuiStyle &style)
Streams a readable dump of an ImGui style object.
Definition Gui.h:44
std::filesystem::path Dir() const
Opens a directory picker dialog.
Definition Gui.h:158
const char * m_FilterList
Definition Gui.h:171
std::filesystem::path Save() const
Opens a save-file dialog.
Definition Gui.h:114
const char * m_DefaultPath
Definition Gui.h:172
std::vector< std::filesystem::path > OpenMultiple() const
Opens a multi-select file picker dialog.
Definition Gui.h:133
FileDialog(const char *filterList=nullptr, const char *defaultPath=nullptr)
Creates a file dialog helper with optional filter and start path.
Definition Gui.h:85
std::filesystem::path Open() const
Opens a single-file picker dialog.
Definition Gui.h:95