Skip to content
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
bf1c4c0
Add files via upload
samuelvenable Jun 12, 2025
4e81d8c
Create foobar
samuelvenable Jun 12, 2025
2ab674b
Add files via upload
samuelvenable Jun 12, 2025
85d4382
Delete libs/foobar
samuelvenable Jun 12, 2025
b4f83ea
Add files via upload
samuelvenable Jun 12, 2025
5bdbcf3
Add files via upload
samuelvenable Jun 12, 2025
2aa3cd4
Add files via upload
samuelvenable Jun 12, 2025
8d6e5f3
Update LICENSE
samuelvenable Jun 12, 2025
012a684
Update ImFileDialog.cpp
samuelvenable Jun 12, 2025
988a83a
Update ImFileDialog.h
samuelvenable Jun 12, 2025
9f7b732
Update ImFileDialog.cpp
samuelvenable Jun 12, 2025
cdf91e6
Update ImFileDialog.cpp
samuelvenable Jun 12, 2025
e509535
Update example.cpp
samuelvenable Jun 12, 2025
91434ec
Update README.md
samuelvenable Jun 12, 2025
239d55a
Update example.cpp
samuelvenable Jun 12, 2025
79a2c9f
Update example.cpp
samuelvenable Jun 12, 2025
d434fca
Update ImFileDialog.h
samuelvenable Jun 12, 2025
42ab623
Update ImFileDialogMacros.h
samuelvenable Jun 12, 2025
e8993f3
Update example.cpp
samuelvenable Jun 12, 2025
71facb0
Update CMakeLists.txt
samuelvenable Jun 12, 2025
b7db6ae
Update CMakeLists.txt
samuelvenable Jun 12, 2025
1e4d94f
Update CMakeLists.txt
samuelvenable Jun 12, 2025
33bcdae
Update ImFileDialog.cpp
samuelvenable Jun 12, 2025
b5fd5e2
Update ImFileDialog.cpp
samuelvenable Jun 12, 2025
3af2e94
Update CMakeLists.txt
samuelvenable Jun 12, 2025
66aa2f1
Update README.md
samuelvenable Jun 12, 2025
9462df8
Update example.cpp
samuelvenable Jun 12, 2025
0b97006
Update example.cpp
samuelvenable Jun 12, 2025
688f7de
Update example.cpp
samuelvenable Jun 12, 2025
de64e7e
Update example.cpp
samuelvenable Jun 12, 2025
96f46f9
Delete libs/lunasvg directory
samuelvenable Jun 16, 2025
ad21f58
Add files via upload
samuelvenable Jun 16, 2025
bce7408
Add files via upload
samuelvenable Jun 16, 2025
2b4b0e1
Update CMakeLists.txt
samuelvenable Jun 16, 2025
05a8444
Update example.cpp
samuelvenable Jun 16, 2025
177db7c
Add files via upload
samuelvenable Jun 16, 2025
41636fd
Update example.cpp
samuelvenable Jun 16, 2025
d3506ca
yay
samuelvenable Jun 23, 2025
bc6d5e0
Add files via upload
samuelvenable Jul 13, 2025
972c782
Update ImFileDialog.cpp
samuelvenable Jul 13, 2025
4bedc84
Update ImFileDialog.h
samuelvenable Jul 13, 2025
db372e7
Add files via upload
samuelvenable Jul 13, 2025
322d947
Update README.md
samuelvenable Jul 20, 2025
46ab1e3
Update README.md
samuelvenable Jul 20, 2025
29bc665
Update ImFileDialog.cpp
samuelvenable Jul 20, 2025
742829a
Update ImFileDialog.cpp
samuelvenable Jul 20, 2025
7443b3a
Update ImFileDialog.h
samuelvenable Jul 20, 2025
0d5d527
Update ImFileDialog.cpp
samuelvenable Jul 29, 2025
83ca11a
Update ImFileDialog.cpp
samuelvenable Jul 29, 2025
fb9f1a1
Add files via upload
samuelvenable Jul 29, 2025
208eee8
Add files via upload
samuelvenable Jul 29, 2025
585cd1f
Update ImFileDialog.h
samuelvenable Jul 29, 2025
d54395b
Update ImFileDialog.cpp
samuelvenable Jul 30, 2025
4b2bfa3
Update ImFileDialog.cpp
samuelvenable Aug 2, 2025
7b6e053
Update ImFileDialog.cpp
samuelvenable Aug 4, 2025
4f55b67
Update ImFileDialog.cpp
samuelvenable Aug 4, 2025
c6425dc
Update README.md
samuelvenable Aug 4, 2025
bccbf65
Update README.md
samuelvenable Aug 4, 2025
b76ecd5
Add files via upload
samuelvenable Aug 4, 2025
4ae8117
Add files via upload
samuelvenable Aug 4, 2025
4670bd4
Update ImFileDialog.cpp
samuelvenable Aug 4, 2025
d5eedd1
Update example.cpp
samuelvenable Aug 11, 2025
794c618
Update example.cpp
samuelvenable Aug 11, 2025
a386bc8
Update example.cpp
samuelvenable Aug 11, 2025
003c607
Add files via upload
samuelvenable Aug 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add files via upload
  • Loading branch information
samuelvenable authored Jul 29, 2025
commit fb9f1a1c41d47712934df09a1acfc102a893ff59
44 changes: 22 additions & 22 deletions ImFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ struct HumanReadable {

namespace ifd {
/* UI CONTROLS */
bool FolderNode(const char* label, ImTextureID icon, bool& clicked) {
bool FolderNode(const char *label, ImTextureID icon, bool& clicked) {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImGuiWindow *window = g.CurrentWindow;

clicked = false;

Expand All @@ -114,7 +114,7 @@ namespace ifd {
const bool is_mouse_x_over_arrow = (g.IO.MousePos.x >= pos.x && g.IO.MousePos.x < pos.x + g.FontSize);
if (ImGui::InvisibleButton(label, ImVec2(-FLT_MIN, g.FontSize + g.Style.FramePadding.y * 2))) {
if (is_mouse_x_over_arrow) {
int* p_opened = window->StateStorage.GetIntRef(id, 0);
int *p_opened = window->StateStorage.GetIntRef(id, 0);
opened = *p_opened = !*p_opened;
} else {
clicked = true;
Expand All @@ -124,7 +124,7 @@ namespace ifd {
bool active = ImGui::IsItemActive();
bool doubleClick = ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left);
if (doubleClick && hovered) {
int* p_opened = window->StateStorage.GetIntRef(id, 0);
int *p_opened = window->StateStorage.GetIntRef(id, 0);
opened = *p_opened = !*p_opened;
clicked = false;
}
Expand All @@ -142,9 +142,9 @@ namespace ifd {
return opened != 0;
}

bool FileNode(const char* label, ImTextureID icon) {
bool FileNode(const char *label, ImTextureID icon) {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImGuiWindow *window = g.CurrentWindow;

//ImU32 id = window->GetID(label);
ImVec2 pos = window->DC.CursorPos;
Expand All @@ -162,14 +162,14 @@ namespace ifd {
return ret;
}

bool PathBox(const char* label, ghc::filesystem::path& path, char* pathBuffer, ImVec2 size_arg) {
ImGuiWindow* window = ImGui::GetCurrentWindow();
bool PathBox(const char *label, ghc::filesystem::path& path, char *pathBuffer, ImVec2 size_arg) {
ImGuiWindow *window = ImGui::GetCurrentWindow();
if (window->SkipItems)
return false;

bool ret = false;
const ImGuiID id = window->GetID(label);
int* state = window->StateStorage.GetIntRef(id, 0);
int *state = window->StateStorage.GetIntRef(id, 0);

ImGui::SameLine();

Expand Down Expand Up @@ -299,9 +299,9 @@ namespace ifd {
return ret;
}

bool FavoriteButton(const char* label, bool isFavorite) {
bool FavoriteButton(const char *label, bool isFavorite) {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImGuiWindow *window = g.CurrentWindow;

ImVec2 pos = window->DC.CursorPos;
bool ret = ImGui::InvisibleButton(label, ImVec2(GUI_ELEMENT_SIZE, GUI_ELEMENT_SIZE));
Expand Down Expand Up @@ -354,10 +354,10 @@ namespace ifd {
return ret;
}

bool FileIcon(const char* label, bool isSelected, ImTextureID icon, ImVec2 size, bool hasPreview, int previewWidth, int previewHeight) {
bool FileIcon(const char *label, bool isSelected, ImTextureID icon, ImVec2 size, bool hasPreview, int previewWidth, int previewHeight) {
ImGuiStyle& style = ImGui::GetStyle();
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImGuiWindow *window = g.CurrentWindow;

float windowSpace = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x;
ImVec2 pos = window->DC.CursorPos;
Expand Down Expand Up @@ -451,7 +451,7 @@ namespace ifd {
m_setDirectory(ghc::filesystem::current_path(ec), false);

// favorites are available on every OS
FileTreeNode* quickAccess = new FileTreeNode(IFD_QUICK_ACCESS);
FileTreeNode *quickAccess = new FileTreeNode(IFD_QUICK_ACCESS);
quickAccess->Read = true;
m_treeCache.push_back(quickAccess);

Expand Down Expand Up @@ -501,7 +501,7 @@ namespace ifd {
}

// This PC
FileTreeNode* thisPC = new FileTreeNode(IFD_THIS_PC);
FileTreeNode *thisPC = new FileTreeNode(IFD_THIS_PC);
thisPC->Read = true;
DWORD d = GetLogicalDrives();
for (int i = 0; i < 26; i++)
Expand Down Expand Up @@ -551,7 +551,7 @@ namespace ifd {
}

// This PC
FileTreeNode* thisPC = new FileTreeNode(IFD_THIS_PC);
FileTreeNode *thisPC = new FileTreeNode(IFD_THIS_PC);
thisPC->Read = true;
for (const auto& entry : ghc::filesystem::directory_iterator("/", ec)) {
const std::string& filename = entry.path().filename().string();
Expand Down Expand Up @@ -1421,7 +1421,7 @@ namespace ifd {
m_previewLoaderRunning = false;
}

void FileDialog::m_clearTree(FileTreeNode* node) {
void FileDialog::m_clearTree(FileTreeNode *node) {
if (node == nullptr)
return;

Expand Down Expand Up @@ -1601,7 +1601,7 @@ namespace ifd {
}
}

void FileDialog::m_renderTree(FileTreeNode* node) {
void FileDialog::m_renderTree(FileTreeNode *node) {
// directory
std::error_code ec;
ImGui::PushID(node);
Expand Down Expand Up @@ -1650,15 +1650,15 @@ namespace ifd {
ImGui::TableSetupColumn((IFD_NAME + std::string("##filename")).c_str(), ImGuiTableColumnFlags_WidthStretch, 0.0f -1.0f, 0);
ImGui::TableSetupColumn((IFD_DATE_MODIFIED + std::string("##filedate")).c_str(), ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize, 0.0f, 1);
ImGui::TableSetupColumn((IFD_SIZE + std::string("##filesize")).c_str(), ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize, 0.0f, 2);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();

// sort
if (ImGuiTableSortSpecs* sortSpecs = ImGui::TableGetSortSpecs()) {
if (sortSpecs->SpecsDirty) {
if (ImGuiTableSortSpecs *sortSpecs = ImGui::TableGetSortSpecs()) {
if (sortSpecs->SpecsDirty) {
sortSpecs->SpecsDirty = false;
m_sortContent(sortSpecs->Specs->ColumnUserID, sortSpecs->Specs->SortDirection);
}
}
}

// content
Expand Down