Skip to content

Commit

Permalink
Added labels_mut and config_mut (#79)
Browse files Browse the repository at this point in the history
* Add config_mut and labels_mut

* Update CHANGELOG.md
  • Loading branch information
fluxxcode authored Feb 25, 2024
1 parent e1affea commit e6a12a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

### ✨ Features
- Added `FileDialog::take_selected` as an alternative to `FileDialog::selected` [#52](https://github.com/fluxxcode/egui-file-dialog/pull/52)
- Added `FileDialogConfig`, `FileDialog::with_config` and `FileDialog::overwrite_config` to set and override the configuration of a file dialog. This is useful if you want to configure multiple `FileDialog` objects with the same options. [#58](https://github.com/fluxxcode/egui-file-dialog/pull/58) and [#67](https://github.com/fluxxcode/egui-file-dialog/pull/67)
- Added `FileDialogLabels` and `FileDialog::labels` to enable multiple language support [#69](https://github.com/fluxxcode/egui-file-dialog/pull/69)
- Added `FileDialogConfig`, `FileDialog::with_config`, `FileDialog::overwrite_config` and `FileDialog::config_mut` to set and override the configuration of a file dialog. This is useful if you want to configure multiple `FileDialog` objects with the same options. [#58](https://github.com/fluxxcode/egui-file-dialog/pull/58), [#67](https://github.com/fluxxcode/egui-file-dialog/pull/67) and [#79](https://github.com/fluxxcode/egui-file-dialog/pull/79)
- Added `FileDialogLabels`, `FileDialog::labels` and `FileDialog::labels_mut` to enable multiple language support [#69](https://github.com/fluxxcode/egui-file-dialog/pull/69) and [#79](https://github.com/fluxxcode/egui-file-dialog/pull/79)
- Added `FileDialog::directory_separator` to overwrite the directory separator that is used when displaying the current path [#68](https://github.com/fluxxcode/egui-file-dialog/pull/68)
- Added `FileDialog::err_icon`, `FileDialog::default_folder_icon` and `FileDialog::default_file_icon` to customize the respective icons [#72](https://github.com/fluxxcode/egui-file-dialog/pull/72) Renamed with [#74](https://github.com/fluxxcode/egui-file-dialog/pull/74)
- Added `FileDialog::set_file_icon` and `FileDialogConfig::set_file_icon` to customize the icon for different types of files and directories [#74](https://github.com/fluxxcode/egui-file-dialog/pull/74)
Expand Down
10 changes: 10 additions & 0 deletions src/file_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ impl FileDialog {
self
}

/// Mutably borrow internal `config`.
pub fn config_mut(&mut self) -> &mut FileDialogConfig {
&mut self.config
}

/// Sets the labels the file dialog uses.
///
/// Used to enable multiple language support.
Expand All @@ -380,6 +385,11 @@ impl FileDialog {
self
}

/// Mutably borrow internal `config.labels`.
pub fn labels_mut(&mut self) -> &mut FileDialogLabels {
&mut self.config.labels
}

/// Sets the first loaded directory when the dialog opens.
/// If the path is a file, the file's parent directory is used. If the path then has no
/// parent directory or cannot be loaded, the user will receive an error.
Expand Down

0 comments on commit e6a12a9

Please sign in to comment.