imageView: Merge set_image_from_file with set_images_from_files

Also changing behavior when opening with multiple command line
arguments or when multiple images were selected from other
applications.

Old behavior: Spawn an instance of Loupe for each argument.
New behavior: One Loupe instance containing all arguments.

Closes #195
This commit is contained in:
Huan Nguyen 2023-05-30 12:52:59 +00:00 • committed by Sophie Herold
parent 6dda1eeb50
commit 735451250c
3 changed files with 12 additions and 17 deletions

View file

@ -71,10 +71,8 @@ mod imp {
// Handles opening files from the command line or other applications
fn open(&self, files: &[gio::File], _hint: &str) {
let application = self.obj();
for file in files {
let win = LpWindow::new(&*application);
win.image_view().set_image_from_file(file.clone());
}
let win = LpWindow::new(&*application);
win.image_view().set_images_from_files(files.to_vec());
}
}