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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user