summaryrefslogtreecommitdiffstats
path: root/winit/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-09-13 11:49:06 +0700
committerLibravatar GitHub <noreply@github.com>2021-09-13 11:49:06 +0700
commit93fec8d273ef8305e1c2456abe0c8ecd7a9d9407 (patch)
treec0c2445703133293b13657ab4f9c1c936e9cd688 /winit/src/window.rs
parent589f68df0f647d93f2b9dd7bf29cfacb0201351c (diff)
parent01b945b9814b9dc546e783a6dab66e4f7fe49786 (diff)
downloadiced-93fec8d273ef8305e1c2456abe0c8ecd7a9d9407.tar.gz
iced-93fec8d273ef8305e1c2456abe0c8ecd7a9d9407.tar.bz2
iced-93fec8d273ef8305e1c2456abe0c8ecd7a9d9407.zip
Merge pull request #1019 from hecrj/command-actions
Platform-specific `Command` implementations
Diffstat (limited to 'winit/src/window.rs')
-rw-r--r--winit/src/window.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/winit/src/window.rs b/winit/src/window.rs
new file mode 100644
index 00000000..f3207e68
--- /dev/null
+++ b/winit/src/window.rs
@@ -0,0 +1,18 @@
+//! Interact with the window of your application.
+use crate::command::{self, Command};
+use iced_native::window;
+
+pub use window::Event;
+
+/// 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 {
+ width,
+ height,
+ }))
+}
+
+/// Moves a window to the given logical coordinates.
+pub fn move_to<Message>(x: i32, y: i32) -> Command<Message> {
+ Command::single(command::Action::Window(window::Action::Move { x, y }))
+}