1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Drag and drop files into egui_glium and egui_web (#637)

* Implement file drag-and-drop for egui_glium

* Implement file drag-and-drop into egui_web

* Cleanup
This commit is contained in:
Emil Ernerfeldt
2021-08-20 22:20:45 +02:00
committed by GitHub
parent 488b1f2462
commit a256ca115b
10 changed files with 239 additions and 6 deletions

View File

@@ -255,6 +255,22 @@ pub fn input_to_egui(
},
});
}
WindowEvent::HoveredFile(path) => {
input_state.raw.hovered_files.push(egui::HoveredFile {
path: Some(path.clone()),
..Default::default()
});
}
WindowEvent::HoveredFileCancelled => {
input_state.raw.hovered_files.clear();
}
WindowEvent::DroppedFile(path) => {
input_state.raw.hovered_files.clear();
input_state.raw.dropped_files.push(egui::DroppedFile {
path: Some(path.clone()),
..Default::default()
});
}
_ => {
// dbg!(event);
}