Add better documentation for epi::NativeOptions::drag_and_drop_support
Closes https://github.com/emilk/egui/issues/747
This commit is contained in:
parent
e2bdd40985
commit
76cdbe2cf8
4 changed files with 11 additions and 3 deletions
|
@ -95,6 +95,9 @@ impl MyApp {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let options = eframe::NativeOptions::default();
|
||||
let options = eframe::NativeOptions {
|
||||
drag_and_drop_support: true,
|
||||
..Default::default()
|
||||
};
|
||||
eframe::run_native(Box::new(MyApp::default()), options);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,9 @@ pub struct RawInput {
|
|||
pub hovered_files: Vec<HoveredFile>,
|
||||
|
||||
/// Dragged files dropped into egui.
|
||||
///
|
||||
/// Note: when using `eframe` on Windows you need to enable
|
||||
/// drag-and-drop support using `epi::NativeOptions`.
|
||||
pub dropped_files: Vec<DroppedFile>,
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ fn main() {
|
|||
let options = eframe::NativeOptions {
|
||||
// Let's show off that we support transparent windows
|
||||
transparent: true,
|
||||
drag_and_drop_support: true,
|
||||
..Default::default()
|
||||
};
|
||||
eframe::run_native(Box::new(app), options);
|
||||
|
|
|
@ -180,8 +180,9 @@ pub struct NativeOptions {
|
|||
pub decorated: bool,
|
||||
|
||||
/// On Windows: enable drag and drop support.
|
||||
/// Default is `false` to avoid issues with crates such as cpal which
|
||||
/// uses that use multi-threaded COM API <https://github.com/rust-windowing/winit/pull/1524>
|
||||
/// Default is `false` to avoid issues with crates such as [`cpal`](https://github.com/RustAudio/cpal) which
|
||||
/// will hang when combined with drag-and-drop.
|
||||
/// See <https://github.com/rust-windowing/winit/issues/1255>.
|
||||
pub drag_and_drop_support: bool,
|
||||
|
||||
/// The application icon, e.g. in the Windows task bar etc.
|
||||
|
|
Loading…
Reference in a new issue