Skip to content

Commit 58c08c3

Browse files
committed
[ADD] : add defines for let default boormarks and devices opened by default or not
1 parent 34bd2cd commit 58c08c3

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,13 @@ inline bool inRadioButton(const char* vLabel, bool vToggled) {
332332
#endif // placesButtonHelpString
333333
#ifndef placesBookmarksGroupName
334334
#define placesBookmarksGroupName "Bookmarks"
335-
#endif // placesBookmarksName
335+
#endif // placesBookmarksGroupName
336+
#ifndef PLACES_BOOKMARK_DEFAULT_OPEPEND
337+
#define PLACES_BOOKMARK_DEFAULT_OPEPEND true
338+
#endif // PLACES_BOOKMARK_DEFAULT_OPEPEND
339+
#ifndef PLACES_DEVICES_DEFAULT_OPEPEND
340+
#define PLACES_DEVICES_DEFAULT_OPEPEND true
341+
#endif // PLACES_DEVICES_DEFAULT_OPEPEND
336342
#ifndef placesBookmarksDisplayOrder
337343
#define placesBookmarksDisplayOrder 0
338344
#endif // placesBookmarksDisplayOrder
@@ -2999,10 +3005,10 @@ IGFD::PlacesFeature::PlacesFeature() {
29993005
#ifdef USE_PLACES_FEATURE
30003006
void IGFD::PlacesFeature::m_InitPlaces(FileDialogInternal& vFileDialogInternal) {
30013007
#ifdef USE_PLACES_BOOKMARKS
3002-
AddPlacesGroup(placesBookmarksGroupName, placesBookmarksDisplayOrder, true);
3008+
AddPlacesGroup(placesBookmarksGroupName, placesBookmarksDisplayOrder, true, PLACES_BOOKMARK_DEFAULT_OPEPEND);
30033009
#endif // USE_PLACES_BOOKMARK
30043010
#ifdef USE_PLACES_DEVICES
3005-
AddPlacesGroup(placesDevicesGroupName, placesDevicesDisplayOrder, false);
3011+
AddPlacesGroup(placesDevicesGroupName, placesDevicesDisplayOrder, false, PLACES_DEVICES_DEFAULT_OPEPEND);
30063012
auto devices_ptr = GetPlacesGroupPtr(placesDevicesGroupName);
30073013
if (devices_ptr != nullptr && vFileDialogInternal.fileManager.GetFileSystemInstance() != nullptr) {
30083014
const auto& devices = vFileDialogInternal.fileManager.GetFileSystemInstance()->GetDevicesList();

ImGuiFileDialogConfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@
139139

140140
// a group for bookmarks will be added by default, but you can also create it yourself and many more
141141
// #define USE_PLACES_BOOKMARKS
142+
// #define PLACES_BOOKMARK_DEFAULT_OPEPEND true
142143
// #define placesBookmarksGroupName "Bookmarks"
143144
// #define placesBookmarksDisplayOrder 0 // to the first
144145

145146
// a group for system devices (returned by IFileSystem), but you can also add yours
146147
// by ex if you would like to display a specific icon for some devices
147148
// #define USE_PLACES_DEVICES
149+
// #define PLACES_DEVICES_DEFAULT_OPEPEND true
148150
// #define placesDevicesGroupName "Devices"
149151
// #define placesDevicesDisplayOrder 10 // to the end

0 commit comments

Comments
 (0)