fileDialog: Pre-select current image's folder
Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/287>
This commit is contained in:
parent
229c63719e
commit
4e28ea1cf6
1 changed files with 8 additions and 0 deletions
|
|
@ -502,6 +502,14 @@ impl LpWindow {
|
||||||
.modal(true)
|
.modal(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
chooser.set_initial_folder(
|
||||||
|
self.image_view()
|
||||||
|
.current_image()
|
||||||
|
.and_then(|x| x.file())
|
||||||
|
.and_then(|x| x.parent())
|
||||||
|
.as_ref(),
|
||||||
|
);
|
||||||
|
|
||||||
if let Ok(selected) = chooser.open_multiple_future(Some(self)).await {
|
if let Ok(selected) = chooser.open_multiple_future(Some(self)).await {
|
||||||
let images: Vec<_> = selected
|
let images: Vec<_> = selected
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue