summaryrefslogtreecommitdiffstats
path: root/runtime/src/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/window.rs')
-rw-r--r--runtime/src/window.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs
index 04bcfcd8..24171e3e 100644
--- a/runtime/src/window.rs
+++ b/runtime/src/window.rs
@@ -101,6 +101,17 @@ pub fn minimize<Message>(id: Id, minimized: bool) -> Command<Message> {
Command::single(command::Action::Window(Action::Minimize(id, minimized)))
}
+/// Fetches the current window position in logical coordinates.
+pub fn fetch_position<Message>(
+ id: Id,
+ f: impl FnOnce(Option<Point>) -> Message + 'static,
+) -> Command<Message> {
+ Command::single(command::Action::Window(Action::FetchPosition(
+ id,
+ Box::new(f),
+ )))
+}
+
/// Moves the window to the given logical coordinates.
pub fn move_to<Message>(id: Id, position: Point) -> Command<Message> {
Command::single(command::Action::Window(Action::Move(id, position)))