Merge pull request #893 from traxys/drag_and_drop

Allow disabling drag and drop on windows
This commit is contained in:
Héctor Ramón 2021-06-01 19:59:33 +07:00 committed by GitHub
commit 1dce929dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -100,6 +100,8 @@ impl Window {
if let Some(parent) = self.platform_specific.parent {
window_builder = window_builder.with_parent_window(parent);
}
window_builder = window_builder
.with_drag_and_drop(self.platform_specific.drag_and_drop);
}
window_builder

View File

@ -2,8 +2,20 @@
//! Platform specific settings for Windows.
/// The platform specific window settings of an application.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PlatformSpecific {
/// Parent Window
/// Parent window
pub parent: Option<winapi::shared::windef::HWND>,
/// Drag and drop support
pub drag_and_drop: bool,
}
impl Default for PlatformSpecific {
fn default() -> Self {
Self {
parent: None,
drag_and_drop: true,
}
}
}