Skip to content

About

Simple File Selector for Dear ImGui with MacOS layout and Dear ImGui look and feel

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MacOS status Linux status Windows status
Repo size Repo activity
License Maintained

ImGuiFileSelector

Simple File Selector for Dear ImGui with a MacOS pedigree/layout and a Dear ImGui look and feel.

The code for this widget is part of a larger project (ObjectTalk) and this repository is simply a snapshot of the relevant file selector code to provide easy reuse. As part of this code is automatically generated, references to the master project are provided where required. You can find all file selector source code components in the ObjectTalk repository.

Screenshot

Features

  • Works on MacOS, Linux and Windows.
  • Works with latest Dear ImGui version (currently v1.92.9 and 1.93.0) and does not use deprecated functions.
  • Is C++17 based (not unreasonable in 2026 I think) although Dear ImGui still uses C++11.
  • Has no runtime dependencies other than Dear ImGui and the C++17 Standard Template Library (STL).
  • Offers four different modes:
    • Select a file to open.
    • Select a file to save to.
    • Select multiple files.
    • select a directory.
  • Labels and action names can be fully customized to support internationalization.
  • API calls are available to see what user selected, see example and documentation.
  • Provides optional sidebar for quick navigation to favorites, cloud, locations and/or media.
  • Sidebar groups are collapsible and are hidden when empty.
  • Sidebar size can be adjusted by dragging right side.
  • Default sidebar is MacOS-like but can be completely customized/adjusted.
  • Provides directory history navigation (backwards, forwards) as if they are hyperlinks in a browser.
  • Provides 3 view types that can be user selected or set through API:
    • Icon view
    • List view (default)
    • Columns View
  • A small set of icons is included for icon view but a custom icon renderer can be provided by the application.
  • Directory filtering:
    • Show/hide hidden files/directories.
    • Filter files by extension.
    • Text based name filtering based on standard Dear ImGui text filtering.
      • "" display all entries
      • xxx display entries containing "xxx"
      • xxx yyy display entries containing "xxx" and "yyy"
      • "xxx yyy" display entries containing "xxx yyy"
      • xxx,yyy display entries containing "xxx" or "yyy"
      • -xxx hide entries containing "xxx"
  • Directories can be sorted (ascending/descending) by name, file type, date or size.
  • Quick navigation to any parent directory.
  • Quick navigation to places recently visited.
  • Ability to create a new folder.
  • Context menu for each directory entry to:
    • Rename file or folder.
    • Move file or folder to trash.
    • Duplicate a file or folder.
    • Change file/folder permissions.
    • Show in Finder (or File Manager).
  • Provides optional accessory views (e.g. custom format selector for Save As).
  • State is automatically preserved between selector popups while application is running.
  • API calls are available to preserve state between application runs.

Integration

As explained above, the file selector is developed and maintained as part of a larger project. In that bigger project, the file selector is spread out over multiple source files and some of those are automatically generated using tools. Every time the file selector is updated in the bigger project, relevant files are concatenated into a simple distribution which is included here.

This repository therefore provides a simple mechanism to reuse the file selector in any Dear ImGui context by doing the following:

  • Include the FileSelector.cpp and FileSelector.h files in your project.
  • See the documentation on how to use the widget.

Versioning

This repository includes releases with a numbering scheme synchronized with Dear ImGui. This will allow people to quickly find a version of the widgets compatible with a specific Dear ImGui version.

Issues

If you are interested in using this File Selector, steal parts of the code, make suggestions for improvements or contribute fixes/enhancements, be my guest as this repository is released under the MIT license. For people that want to contribute, Contributing Guidelines and a Code of Conduct are available. If you find any problems or want to make a suggestion for improvement, please raise an issue on this repository.

Credits

ImGuiFileSelector was written from scratch by Johan A. Goossens and if you end up using (parts of) this repository, a shoutout or Github star would be appreciated. Other file selectors for Dear ImGui exist on GitHub but many of them have not been maintained for a bit and none of them have a MacOS pedigree.

A big thank you to Omar Cornut for creating Dear ImGui in the first place. Without you, this file selector would not exist.

License

This work is licensed under the terms of the MIT license. For a copy, see https://opensource.org/licenses/MIT.

The included file and folder icons are derived from Pictogrammers that are released as free, open-source, and GPL friendly. You may use them for commercial projects, open-source projects, or anything really. Icons are distributed under the Apache 2.0 license.

About

Simple File Selector for Dear ImGui with MacOS layout and Dear ImGui look and feel

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages