Rename fetch_location to fetch_position

This commit is contained in:
Héctor Ramón Jiménez 2024-02-22 09:19:51 +01:00
parent 59885e9a36
commit d6454b5d0c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 47 additions and 45 deletions

View file

@ -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)))