fluxxcode / egui-file-dialog

Full featured and customizable file dialog for egui
MIT License
91 stars 14 forks source link

Optional callback to display information for currently highlighted file #166

Closed crumblingstatue closed 1 month ago

crumblingstatue commented 1 month ago

The host application might have the means to display more information for a highlighted file. For example, I would like to display the MIME type for the currently highlighted file.

It could also be used for things like showing image previews in applications that deal with images, etc.

Optionally I could use it to display things like file size (#165) and other properties, but I think that would be a commonly wanted feature on its own, so I made a separate issue for it.

My current idea is that the callback ui could go into an optional right panel inside the picker window.

fluxxcode commented 1 month ago

Thanks for the ticket. It should be easy to implement, but I don't have time at the moment

fluxxcode commented 1 month ago

Hey, just to make sure I understood it correctly. Your idea is a ui.higlighted_item -> Option<Path> and ui.highlitghted_items -> Option<Vec<Path>> (for multi selection) API to return the currently selected item and a file_dialog.right_panel_ui API to implement a custom UI inside the right panel?

crumblingstatue commented 1 month ago

Hey, just to make sure I understood it correctly. Your idea is a ui.higlighted_item -> Option<Path> and ui.highlitghted_items -> Option<Vec<Path>> (for multi selection) API to return the currently selected item and a file_dialog.right_panel_ui API to implement a custom UI inside the right panel?

I haven't thought too hard about what the best API would be, but what you suggested sounds good to me. Currently I'm not working on my hex editor, but I might experiment with this next week, and open up a draft pull request, unless you are feeling motivated to work on this yourself.

fluxxcode commented 1 month ago

I'm also working on another project at the moment, so I don't know when I'll get to it. If you have time to work on this, feel free to assign the issue to yourself. If I can work on it sooner, I will simply assign it to myself 👍

crumblingstatue commented 1 month ago

I took a shot at this with #170

fluxxcode commented 1 month ago

Done with: https://github.com/fluxxcode/egui-file-dialog/pull/170

Thank you for the implementation!