summaryrefslogtreecommitdiffstats
path: root/winit/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Michael Aaron Murphy <mmstick@pm.me>2022-10-06 20:38:21 +0200
committerLibravatar Michael Aaron Murphy <mmstick@pm.me>2022-10-11 21:39:53 +0200
commit7ea7dbef578ddbe2a9a50da6aab253ba016f1362 (patch)
tree9d74af6e938a01b99d710f8ec780dadd358ba97b /winit/src/window.rs
parent77c838011fe6f8f567389d5994584a1a1b8420c5 (diff)
downloadiced-7ea7dbef578ddbe2a9a50da6aab253ba016f1362.tar.gz
iced-7ea7dbef578ddbe2a9a50da6aab253ba016f1362.tar.bz2
iced-7ea7dbef578ddbe2a9a50da6aab253ba016f1362.zip
feat: Add window drag support from winit
Exposes access to the winit window's window_drag method as an action.
Diffstat (limited to 'winit/src/window.rs')
-rw-r--r--winit/src/window.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/winit/src/window.rs b/winit/src/window.rs
index 265139f7..61c9c3fe 100644
--- a/winit/src/window.rs
+++ b/winit/src/window.rs
@@ -4,6 +4,11 @@ use iced_native::window;
pub use window::{Event, Mode};
+/// Begins dragging the window while the left mouse button is held.
+pub fn drag<Message>() -> Command<Message> {
+ Command::single(command::Action::Window(window::Action::Drag))
+}
+
/// Resizes the window to the given logical dimensions.
pub fn resize<Message>(width: u32, height: u32) -> Command<Message> {
Command::single(command::Action::Window(window::Action::Resize {