From 5b70754809df9d9f4f3a2f7d4d348dd58bd86aa3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 6 Jan 2025 23:25:57 +0100 Subject: Rename `window::change_*` tasks to `set_*` --- runtime/src/window.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'runtime') diff --git a/runtime/src/window.rs b/runtime/src/window.rs index ab805e52..94ee0ae5 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -68,7 +68,7 @@ pub enum Action { Move(Id, Point), /// Change the [`Mode`] of the window. - ChangeMode(Id, Mode), + SetMode(Id, Mode), /// Get the current [`Mode`] of the window. GetMode(Id, oneshot::Sender), @@ -111,7 +111,7 @@ pub enum Action { GainFocus(Id), /// Change the window [`Level`]. - ChangeLevel(Id, Level), + SetLevel(Id, Level), /// Show the system menu at cursor position. /// @@ -136,7 +136,7 @@ pub enum Action { /// /// - **X11:** Has no universal guidelines for icon sizes, so you're at the whims of the WM. That /// said, it's usually in the same ballpark as on Windows. - ChangeIcon(Id, Icon), + SetIcon(Id, Icon), /// Runs the closure with the native window handle of the window with the given [`Id`]. RunWithHandle(Id, Box) + Send>), @@ -351,11 +351,6 @@ pub fn move_to(id: Id, position: Point) -> Task { task::effect(crate::Action::Window(Action::Move(id, position))) } -/// Changes the [`Mode`] of the window. -pub fn change_mode(id: Id, mode: Mode) -> Task { - task::effect(crate::Action::Window(Action::ChangeMode(id, mode))) -} - /// Gets the current [`Mode`] of the window. pub fn get_mode(id: Id) -> Task { task::oneshot(move |channel| { @@ -363,6 +358,11 @@ pub fn get_mode(id: Id) -> Task { }) } +/// Changes the [`Mode`] of the window. +pub fn set_mode(id: Id, mode: Mode) -> Task { + task::effect(crate::Action::Window(Action::SetMode(id, mode))) +} + /// Toggles the window to maximized or back. pub fn toggle_maximize(id: Id) -> Task { task::effect(crate::Action::Window(Action::ToggleMaximize(id))) @@ -400,8 +400,8 @@ pub fn gain_focus(id: Id) -> Task { } /// Changes the window [`Level`]. -pub fn change_level(id: Id, level: Level) -> Task { - task::effect(crate::Action::Window(Action::ChangeLevel(id, level))) +pub fn set_level(id: Id, level: Level) -> Task { + task::effect(crate::Action::Window(Action::SetLevel(id, level))) } /// Show the [system menu] at cursor position. @@ -420,8 +420,8 @@ pub fn get_raw_id(id: Id) -> Task { } /// Changes the [`Icon`] of the window. -pub fn change_icon(id: Id, icon: Icon) -> Task { - task::effect(crate::Action::Window(Action::ChangeIcon(id, icon))) +pub fn set_icon(id: Id, icon: Icon) -> Task { + task::effect(crate::Action::Window(Action::SetIcon(id, icon))) } /// Runs the given callback with the native window handle for the window with the given id. -- cgit