summaryrefslogtreecommitdiffstats
path: root/runtime/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-22 09:19:51 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-22 09:19:51 +0100
commitd6454b5d0ca4c3812d1614805de1094638153df1 (patch)
tree18418ebe4c69ae1d3cb9668aed9069338cf70270 /runtime/src/window.rs
parent59885e9a363dd73b3a3e8dd125decf0e34130c59 (diff)
downloadiced-d6454b5d0ca4c3812d1614805de1094638153df1.tar.gz
iced-d6454b5d0ca4c3812d1614805de1094638153df1.tar.bz2
iced-d6454b5d0ca4c3812d1614805de1094638153df1.zip
Rename `fetch_location` to `fetch_position`
Diffstat (limited to 'runtime/src/window.rs')
-rw-r--r--runtime/src/window.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs
index c5acfddc..24171e3e 100644
--- a/runtime/src/window.rs
+++ b/runtime/src/window.rs
@@ -101,22 +101,22 @@ pub fn minimize<Message>(id: Id, minimized: bool) -> Command<Message> {
Command::single(command::Action::Window(Action::Minimize(id, minimized)))
}
-/// 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)))
-}
-
-/// Fetches the window's location in logical coordinates.
-pub fn fetch_location<Message>(
+/// 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::FetchLocation(
+ 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)))
+}
+
/// Changes the [`Mode`] of the window.
pub fn change_mode<Message>(id: Id, mode: Mode) -> Command<Message> {
Command::single(command::Action::Window(Action::ChangeMode(id, mode)))