window: Support dropping multiple files
This allows to scroll through all dropped files. No further images from directories are loaded in this mode. Closes #35
This commit is contained in:
parent
e710419a22
commit
aca49427a1
4 changed files with 53 additions and 53 deletions
|
|
@ -70,12 +70,18 @@ impl Default for LpFileModel {
|
|||
|
||||
impl LpFileModel {
|
||||
/// Create with a single element
|
||||
pub fn from_file(file: &gio::File) -> Self {
|
||||
pub fn from_file(file: gio::File) -> Self {
|
||||
Self::from_files(vec![file])
|
||||
}
|
||||
|
||||
pub fn from_files(files: Vec<gio::File>) -> Self {
|
||||
let model = Self::default();
|
||||
|
||||
{
|
||||
let mut vec = model.imp().files.borrow_mut();
|
||||
vec.insert(file.uri(), file.clone());
|
||||
for file in files {
|
||||
vec.insert(file.uri(), file);
|
||||
}
|
||||
}
|
||||
|
||||
model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue