Skip to content

Commit 7c4dd62

Browse files
committed
[UPD] : update docs
[RFR] : Refactor
1 parent eefc771 commit 7c4dd62

3 files changed

Lines changed: 25 additions & 23 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ bool IGFD::Utils::ImSplitter(bool split_vertically, float thickness, float* size
793793
ImRect bb;
794794
bb.Min = window->DC.CursorPos + (split_vertically ? ImVec2(*size1, 0.0f) : ImVec2(0.0f, *size1));
795795
bb.Max = bb.Min + CalcItemSize(split_vertically ? ImVec2(thickness, splitter_long_axis_size) : ImVec2(splitter_long_axis_size, thickness), 0.0f, 0.0f);
796-
return SplitterBehavior(bb, id, split_vertically ? ImGuiAxis_X : ImGuiAxis_Y, size1, size2, min_size1, min_size2, 1.0f);
796+
return SplitterBehavior(bb, id, split_vertically ? ImGuiAxis_X : ImGuiAxis_Y, size1, size2, min_size1, min_size2, 1.0f, 0.0, ImGui::GetColorU32(ImGuiCol_FrameBg));
797797
}
798798

799799
// Convert a wide Unicode string to an UTF8 string
@@ -3786,7 +3786,6 @@ void IGFD::FileDialog::m_DrawContent() {
37863786
#ifdef USE_PLACES_FEATURE
37873787
if (!(m_FileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_DisablePlaceMode)) {
37883788
if (m_PlacesPaneShown) {
3789-
// size.x -= m_PlaceWidth;
37903789
float otherWidth = size.x - m_PlacesPaneWidth;
37913790
ImGui::PushID("##splitterplaces");
37923791
IGFD::Utils::ImSplitter(true, 4.0f, &m_PlacesPaneWidth, &otherWidth, 10.0f, 10.0f + m_FileDialogInternal.getDialogConfig().sidePaneWidth, size.y);
@@ -4090,8 +4089,7 @@ void IGFD::FileDialog::m_DrawFileListView(ImVec2 vSize) {
40904089
#endif // USE_CUSTOM_SORTING_ICON
40914090
;
40924091
auto listViewID = ImGui::GetID("##FileDialog_fileTable");
4093-
if (ImGui::BeginTableEx("##FileDialog_fileTable", listViewID, 4, flags, vSize, 0.0f)) //-V112
4094-
{
4092+
if (ImGui::BeginTableEx("##FileDialog_fileTable", listViewID, 4, flags, vSize, 0.0f)) {
40954093
ImGui::TableSetupScrollFreeze(0, 1); // Make header always visible
40964094
ImGui::TableSetupColumn(fdi.headerFileName.c_str(), ImGuiTableColumnFlags_WidthStretch | (defaultSortOrderFilename ? ImGuiTableColumnFlags_PreferSortAscending : ImGuiTableColumnFlags_PreferSortDescending), -1, 0);
40974095
ImGui::TableSetupColumn(fdi.headerFileType.c_str(),

ImGuiFileDialog.h

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,28 +125,27 @@ included in the Lib_Only branch for your convenience.
125125
- 0 => Infinite
126126
- 1 => One file (default)
127127
- n => n files
128-
- Compatible with MacOs, Linux, Windows
129-
- Windows version can list drives
128+
- Compatible with MacOs, Linux, Windows, Emscripten, Android
130129
- Supports modal or standard dialog types
131130
- Select files or directories
132131
- Filter groups and custom filter names
133132
- can ignore filter Case for file searching
134133
- Keyboard navigation (arrows, backspace, enter)
135134
- Exploring by entering characters (case insensitive)
136-
- Directory place
135+
- Custom places (bookmarks, system devices, whatever you want)
137136
- Directory manual entry (right click on any path element)
138137
- Optional 'Confirm to Overwrite" dialog if file exists
139138
- Thumbnails Display (agnostic way for compatibility with any backend, sucessfully tested with OpenGl and Vulkan)
140139
- The dialog can be embedded in another user frame than the standard or modal dialog
141140
- Can tune validation buttons (placements, widths, inversion)
142141
- Can quick select a parrallel directory of a path, in the path composer (when you clikc on a / you have a popup)
143-
- regex support for filters, collection of filters and filestyle (the regex is recognized when between (( and )) in a
144-
filter)
142+
- regex support for filters, collection of filters and filestyle (the regex is recognized when between (( and )) in a filter)
145143
- multi layer extentions like : .a.b.c .json.cpp .vcxproj.filters etc..
146-
- advanced behavior regarding asterisk based filter. like : .* .*.* .vcx.* .*.filters .vcs*.filt.* etc.. (internally
147-
regex is used)
148-
- result modes GetFilePathName, GetFileName and GetSelection (overwrite file ext, keep file, add ext if no user ext
149-
exist)
144+
- advanced behavior regarding asterisk based filter. like : .* .*.* .vcx.* .*.filters .vcs*.filt.* etc.. (internally regex is used)
145+
- result modes GetFilePathName, GetFileName and GetSelection (overwrite file ext, keep file, add ext if no user ext exist)
146+
- you can use your own FileSystem Api
147+
- by default Api Dirent and std::filesystem are defined
148+
- you can override GetDrieveList for specify by ex on android other fs, like local and SDCards
150149
151150
################################################################
152151
## Filter format
@@ -1079,15 +1078,19 @@ the DemoApp branch with the "quick access" paths of win10
10791078
You must add a group first, then add a place to it :
10801079
10811080
```cpp
1082-
// you must add a group first, specifu display order, and say if the user can add or remove palce like (bookmarks)
1083-
ImGuiFileDialog::Instance()->AddPlacesGroup(group_name, display_order, can_be_user_edited);
1081+
// you must add a group first, specifu display order, and say :
1082+
// if the user can add or remove palce like (bookmarks)
1083+
// if the group is opened by default
1084+
ImGuiFileDialog::Instance()->AddPlacesGroup(group_name, display_order, can_be_user_edited, opened_by_default);
10841085
// then you must get the group
10851086
auto places_ptr = ImGuiFileDialog::Instance()->GetPlacesGroupPtr(group_name);
10861087
if (places_ptr != nullptr) {
10871088
// then add a place to the group
10881089
// you msut specify the place name, the palce path, say if the palce can be serialized, and sepcify the style
10891090
// for the moment the style support only the icon, can be extended if user needed in futur
10901091
places_ptr->AddPlace(place_name, place_path, can_be_saved, style);
1092+
// you can also add a separator
1093+
places_ptr->AddPlaceSeparator(separator_thickness);
10911094
}
10921095
```
10931096
@@ -1101,8 +1104,6 @@ Load => ImGuiFileDialog::Instance()->DeserializePlaces(placesString);
11011104
Save => std::string placesString = ImGuiFileDialog::Instance()->SerializePlaces();
11021105
```
11031106
1104-
(please see DemoApp branch for details)
1105-
11061107
################################################################
11071108
## How to Integrate ImGuiFileDialog in your project
11081109
################################################################

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,14 @@ Android Requirements : Api 21 mini
6767
- 0 => Infinite
6868
- 1 => One file (default)
6969
- n => n files
70-
- Compatible with MacOs, Linux, Windows, Emscripten
71-
- Windows version can list drives
70+
- Compatible with MacOs, Linux, Windows, Emscripten, Android
7271
- Supports modal or standard dialog types
7372
- Select files or directories
7473
- Filter groups and custom filter names
7574
- can ignore filter Case for file searching
7675
- Keyboard navigation (arrows, backspace, enter)
7776
- Exploring by entering characters (case insensitive)
78-
- Custom places (bookmarks, devices, whatever you want)
77+
- Custom places (bookmarks, system devices, whatever you want)
7978
- Directory manual entry (right click on any path element)
8079
- Optional 'Confirm to Overwrite" dialog if file exists
8180
- Thumbnails Display (agnostic way for compatibility with any backend, sucessfully tested with OpenGl and Vulkan)
@@ -520,15 +519,19 @@ the DemoApp branch with the "quick access" paths of win10
520519
You must add a group first, then add a place to it :
521520

522521
```cpp
523-
// you must add a group first, specifu display order, and say if the user can add or remove palce like (bookmarks)
524-
ImGuiFileDialog::Instance()->AddPlacesGroup(group_name, display_order, can_be_user_edited);
522+
// you must add a group first, specifu display order, and say :
523+
// if the user can add or remove palce like (bookmarks)
524+
// if the group is opened by default
525+
ImGuiFileDialog::Instance()->AddPlacesGroup(group_name, display_order, can_be_user_edited, opened_by_default);
525526
// then you must get the group
526527
auto places_ptr = ImGuiFileDialog::Instance()->GetPlacesGroupPtr(group_name);
527528
if (places_ptr != nullptr) {
528529
// then add a place to the group
529530
// you msut specify the place name, the palce path, say if the palce can be serialized, and sepcify the style
530531
// for the moment the style support only the icon, can be extended if user needed in futur
531-
places_ptr->AddPlace(place_name, place_path, can_be_saved, style);
532+
places_ptr->AddPlace(place_name, place_path, can_be_saved, style);
533+
// you can also add a separator
534+
places_ptr->AddPlaceSeparator(separator_thickness);
532535
}
533536
```
534537

0 commit comments

Comments
 (0)