diff --git a/CHANGELOG.md b/CHANGELOG.md index b4ef9fd5..a8a54cf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ - Made default egui fonts an optional feature `default_fonts` [#163](https://github.com/fluxxcode/egui-file-dialog/pull/163) (thanks [@StarStarJ](https://github.com/StarStarJ)!) - Filter directory when loading to improve performance [#169](https://github.com/fluxxcode/egui-file-dialog/pull/169) +### 📚 Documentation +- Updated `README.md` to include latest features [#176](https://github.com/fluxxcode/egui-file-dialog/pull/176) + ## 2024-10-01 - v0.7.0 - egui update and QoL changes ### 🚨 Breaking Changes - Updated `egui` from version `0.28.0` to version `0.29.1` [#155](https://github.com/fluxxcode/egui-file-dialog/pull/155) and [#157](https://github.com/fluxxcode/egui-file-dialog/pull/157) (thanks [@crumblingstatue](https://github.com/crumblingstatue)!) diff --git a/README.md b/README.md index 65c99cb1..5e4aa71f 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ The latest changes included in the next release can be found in the [CHANGELOG.m - Create a new folder - Keyboard navigation - Option to show or hide hidden files and folders +- Option to show or hide system files - Navigation buttons to open the parent or previous directories - Search for items in a directory - Add file filters the user can select from a dropdown @@ -49,9 +50,10 @@ The latest changes included in the next release can be found in the [CHANGELOG.m - Customize file and folder icons - Add custom quick access sections to the left sidebar - Customize keybindings used by the file dialog + - Add a right panel with custom UI using ## Example -Detailed examples that can be run can be found in the [examples](https://github.com/fluxxcode/egui-file-dialog/tree/master/examples) folder. +Detailed examples that can be run can be found in the [examples](https://github.com/fluxxcode/egui-file-dialog/tree/develop/examples) folder. The following example shows the basic use of the file dialog with [eframe](https://github.com/emilk/egui/tree/master/crates/eframe) to select a file. @@ -140,6 +142,7 @@ A few highlights of the customization are listed below. For all possible customi - Update the text labels that the dialog uses. See [Multilingual support](#multilingual-support) - Customize file and folder icons using `FileDialog::set_file_icon` (Currently only unicode is supported) - Customize keybindings used by the file dialog using `FileDialog::keybindings`. See [Keybindings](#keybindings) +- Add a right panel with custom UI using `FileDialog::update_with_right_panel_ui` Since the dialog uses the egui style to look like the rest of the application, the appearance can be customized with `egui::Style` and `egui::Context::set_style`. @@ -188,15 +191,20 @@ FileDialog::new() With the options the dialog then looks like this: -The smallest possible dialog can be generated with the following configuration: - +If you want to display your own information in the file dialog, you can update the file dialog with +`update_with_right_panel_ui` instead of `update`. This allows e.g. to display custom image previews or further +information about the selected item. See [custom-right-panel](https://github.com/fluxxcode/egui-file-dialog/tree/develop/examples/custom-right-panel) for the full example. ```rust -FileDialog::new() - .title_bar(false) - .show_top_panel(false) - .show_left_panel(false) +fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + // Update the dialog with a custom right panel + self.file_dialog.update_with_right_panel_ui(ctx, &mut |ui, dialog| { + ui.label("This is a custom label"); + ui.add_space(5.0); + ui.label(format!("Currently selected item:\n{:?}", dialog.active_entry())); + }); +} ``` - + ## Multilingual support For desktop applications it is often necessary to offer different languages. While the dialog currently only offers English labels by default, the labels are fully customizable. This makes it possible to adapt the labels to different languages. diff --git a/media/customization_demo_2.png b/media/customization_demo_2.png deleted file mode 100644 index 90289efc..00000000 Binary files a/media/customization_demo_2.png and /dev/null differ diff --git a/media/right_panel_demo.png b/media/right_panel_demo.png new file mode 100644 index 00000000..54b9c93c Binary files /dev/null and b/media/right_panel_demo.png differ