summaryrefslogtreecommitdiffstats
path: root/native/src/window
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-16 07:12:59 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-16 07:12:59 +0100
commitf73bacb454615566abdbf45065e3fd11a3276d93 (patch)
treec668f0a580e74cb0c4ee1a5977b7590fb5028402 /native/src/window
parent5de404ddd9484c6e1113697d749524ac79d8c763 (diff)
downloadiced-f73bacb454615566abdbf45065e3fd11a3276d93.tar.gz
iced-f73bacb454615566abdbf45065e3fd11a3276d93.tar.bz2
iced-f73bacb454615566abdbf45065e3fd11a3276d93.zip
Add file events to `iced_native::window::Event`
Diffstat (limited to 'native/src/window')
-rw-r--r--native/src/window/event.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/native/src/window/event.rs b/native/src/window/event.rs
index 89ec0a0c..c913385b 100644
--- a/native/src/window/event.rs
+++ b/native/src/window/event.rs
@@ -1,5 +1,7 @@
+use std::path::PathBuf;
+
/// A window-related event.
-#[derive(PartialEq, Clone, Copy, Debug)]
+#[derive(PartialEq, Clone, Debug)]
pub enum Event {
/// A window was resized
Resized {
@@ -9,4 +11,22 @@ pub enum Event {
/// The new height of the window (in units)
height: u32,
},
+
+ /// A file is being hovered over the window.
+ ///
+ /// When the user hovers multiple files at once, this event will be emitted
+ /// for each file separately.
+ FileHovered(PathBuf),
+
+ /// A file has beend dropped into the window.
+ ///
+ /// When the user drops multiple files at once, this event will be emitted
+ /// for each file separately.
+ FileDropped(PathBuf),
+
+ /// A file was hovered, but has exited the window.
+ ///
+ /// There will be a single `FilesLeft` event triggered even if multiple
+ /// files were hovered.
+ FilesLeft,
}